mholt / json-to-go

Translates JSON into a Go type in your browser instantly (original)
https://mholt.github.io/json-to-go/
MIT License
4.51k stars 475 forks source link

fix: camelcase name handling #94

Closed hirochachacha closed 3 years ago

hirochachacha commented 3 years ago

Previous change broke handling of json with camelcase. This CL changes to call toLower() iff arguments are SCREAMING_SNAKE_CASE. Also add simple test to prevent regression.

bhcleek commented 3 years ago

@mholt any chance of getting this merged? As-is, https://mholt.github.io/json-to-go/ lowercases all characters in field names except for the first character because of the bug this fixes.