ipfs / ipfs/boxo

pinning/http: Pin.meta query string encoding

Open
#381 4 comments 0 reactions 0 assignees View on GitHub
help wanted kind/bug need/analysis
Dominant language
Go
Stars
316
Forks
163
Avg merge
4d 12h
Merged PRs (30d)
8

Description

When listing pins, `Pin.meta` is sent as `fmt.Sprintf("%v", obj)` where `obj` is `map[string]string`, e.g., `meta=map[foo:one bar:two]` (after URL unescaping). That's a bit awkward to parse on the backend. Is there a more idiomatic way to send a `map` as a query param?

Gin [encodes maps](https://github.com/gin-gonic/gin#map-as-querystring-or-postform-parameters) by exploding the keys: "meta[foo]=one&meta[bar]=two".

If I generate the client with another popular Go OpenAPI generator called [oapi-codegen](https://github.com/deepmap/oapi-codegen), it uses [this lib](https://github.com/deepmap/oapi-codegen/blob/master/pkg/runtime/styleparam.go) to encode `Pin.meta` as URL escaped JSON.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.