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

Sanitization #71

Closed
svperfecta opened this issue Dec 2, 2016 · 3 comments
Closed

Sanitization #71

svperfecta opened this issue Dec 2, 2016 · 3 comments

Comments

@svperfecta
Copy link

Hi All - I have a use case where I have little control over the incoming JSON. I'd like to do some sanitization on the object keys (all keys, on all nested objects) before I map it to a struct. Specifically, I'd like ensure that all keys have the same case (In my case, camelCase) Is there some way to scrub the JSON object before decoding it?

@svperfecta
Copy link
Author

/cc: @kas240sx89

@kisielk
Copy link
Contributor

kisielk commented Dec 2, 2016

You're free to edit the map being passed to the decoder as much as want beforehand. Or is there something else keeping you from doing that?

@svperfecta
Copy link
Author

I think that would work. Frankly, I'm just not totally clear what that looks like. I'll spend more time with the documentation.

@kisielk kisielk closed this as completed Mar 17, 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

No branches or pull requests

2 participants