google / google/go-querystring

Add support for JSON encoding a struct field

Open
#53 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.1k
Forks
188
Avg merge
10h 23m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.