Skip to content

Support alternative struct tags (instead of url) #29

Open
@emmanuel

Description

@emmanuel

We use Gin, and we're looking at using this library. Gin provides a BindQuery method, which decodes query params from a request into a struct, so long as the incoming request matches the expected names, expressed via the struct tag form.

We'd like to be able to use the same struct tags for encoding and decoding. In order to do so, we'd like to be able to configure this library to reflect on a different struct tag during encoding. In our case, we'd like to be able to configure this library to use the same struct tag as Gin, i.e., the form tag.

Would you be open to a PR that implements configurable struct tags?

I'm not sure what the best mechanism would be, perhaps a build flag or ENV_VAR. Any suggestions here would be most welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions