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

Support for Unmarshalling strict in yaml v3 #602

Closed
Harkishen-Singh opened this issue Apr 20, 2020 · 2 comments
Closed

Support for Unmarshalling strict in yaml v3 #602

Harkishen-Singh opened this issue Apr 20, 2020 · 2 comments

Comments

@Harkishen-Singh
Copy link

Harkishen-Singh commented Apr 20, 2020

We were working around validating the yaml fields inside the rules files, Prometheus. However, we faced an issue that the yaml v3 unmarshalling does not throw an error if it finds unknown fields inside the bytes stream. Earlier we were using Unmarshalstrict() from yaml v2 which was effective to handle this.

Hence, it will be good if yaml v3 supports Unmarshalstrict(). Any other workaround would be great to know as well.

@brian-brazil
Copy link

#557 and #460 seem relevant here.

@niemeyer
Copy link
Contributor

niemeyer commented May 4, 2020

We've replaced "strict" unmarshaling, which is an open-ended term, by more specific terms. The feature you're looking for is currently supported as KnownFields(true/false) in the decoder. We indeed need a way to pass those to the Node.

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

3 participants