Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Generate Go structs from multiple JSON objects (github.com/twpayne)
1 point by twp 15 days ago | hide | past | favorite
If you need to unmarshal arbitrary JSON or YAML data (e.g. consuming data from a REST/JSON endpoint with no defined schema) then https://github.com/twpayne/go-jsonstruct will automatically create your Go structs for you. What's special about go-jsonstruct compared to other JSON-to-Go generators, is that go-jsonstruct can accept multiple documents as input and generate the most specific Go struct into which all of the documents can be unmarshalled. You can give it a few example responses from your REST/JSON endpoint and go-jsonstruct will infer the struct for you.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: