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

refactor: use sigs.k8s.io/yaml and json tags #686

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Conversation

luisdavim
Copy link
Collaborator

Since invopop/jsonschema#23 was merged jsonschema no longer supports yaml tags, and we've updated to that version in #682, we'd need to add addition json tags to keep using go-yaml, we can avoid duplicate YAML and JSON tags by using sigs.k8s.io/yaml that first converts YAML to JSON using go-yaml and then uses json.Marshal and json.Unmarshal to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods MarshalJSON and UnmarshalJSON unlike go-yaml.

@luisdavim luisdavim requested a review from mkubaczyk July 17, 2022 19:10
@mkubaczyk mkubaczyk merged commit 1bc5820 into master Jul 21, 2022
@mkubaczyk mkubaczyk deleted the jsonschema branch July 21, 2022 13:42
mkubaczyk added a commit that referenced this pull request Aug 18, 2023
refactor: use sigs.k8s.io/yaml and json tags
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 this pull request may close these issues.

2 participants