Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for JSON encoding a struct field #53

Open
schmorrison opened this issue Jul 25, 2021 · 0 comments · May be fixed by #54
Open

Add support for JSON encoding a struct field #53

schmorrison opened this issue Jul 25, 2021 · 0 comments · May be fixed by #54

Comments

@schmorrison
Copy link

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

@schmorrison schmorrison linked a pull request Jul 25, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant