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

Respect json struct tags #39

Closed
lestrrat opened this issue Nov 13, 2019 · 0 comments
Closed

Respect json struct tags #39

lestrrat opened this issue Nov 13, 2019 · 0 comments

Comments

@lestrrat
Copy link
Contributor

One of the reasons I use https://github.com/ghodss/yaml is because it supports the json struct tag -- so I don't have to have multiple definitions of the same fields:

// I DO NOT want this
type Foo struct {
    A `json:"foo" yaml:"foo"`
    B `json:"bar,omitempty", yaml:"bar,omitempty"`
    ...
}
// I WANT this to work with this YAML library
type Bar struct {
    A `json:"foo"` 
    B `json:"bar"`
}

I would really like this library to (1) by default look at the YAML tag, and (2) if not found, look at the JSON tag

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

No branches or pull requests

1 participant