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 package option for mimicking encoding/json field name case handling #178

Closed
wants to merge 2 commits into from

Conversation

parsley42
Copy link

I read the other pull request for similar functionality, but didn't want to implement as part of a Decoder/Encoder because it wouldn't give the behavior I wanted when using standard Marshal/Unmarshal. This non-breaking change adds a package option to preserve the case of
field names when marshaling/unmarshaling.

If this approach is acceptable, I'll be glad to get a launchpad ID and fill out the form, but didn't want to bother without getting feedback first. Thanks!

@rogpeppe
Copy link
Contributor

I'm afraid I don't think that having a global variable that modifies YAML unmarshaling behaviour is a good idea. It means that if you have several packages that use YAML in different ways, they can step on each others' toes. In general, package-level mutable variables should be considered a bad idea.

@rogpeppe rogpeppe closed this Jul 21, 2017
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.

None yet

2 participants