Skip to content

Add support for JSON encoding a struct field #53

@schmorrison

Description

@schmorrison

Will be submitting a PR to add support for JSON encoding a nested struct field.

A specific API endpoint I am working on requires a URL encoded form but one of the form fields is JSON. The PR will add an option that will encode the field as a JSON string.

For example:

type A struct {
    V string `json:"v"`
}

type B struct {
    A A `url:"a,json"`
}

// url.Values{
//     "a": {`{"v": "abc"}`}
// }

Thanks and best regards,

schmorrison

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions