{"repo":"twpayne/go-jsonstruct","free":true,"listed":false,"github":"https://github.com/twpayne/go-jsonstruct","clone":"git clone https://github.com/twpayne/go-jsonstruct.git","description":"Generate Go structs from multiple JSON or YAML objects.","language":"Go","stars":366,"topics":["golang","json","json-schema","struct","go","schema","yaml"],"license":"BSD-2-Clause","category":"dev-tools","readme_excerpt":"go-jsonstruct Generate Go structs from multiple JSON or YAML objects. - go-jsonstruct - What does go-jsonstruct do and why should I use it? - How do I use go-jsonstruct? - YAML support - What are go-jsonstruct's key features? - How does go-jsonstruct work? - License What does go-jsonstruct do and why should I use it? go-jsonstruct generates Go structs from multiple JSON or YAML objects. Existing Go struct generators such as json-to-go and json2struct take only a single JSON object as input. go-jsonstruct takes multiple objects as input and generates the most specific Go struct possible into which all the input objects can be unmarshalled. This is useful if you have a collection of JSON objects, where no single object has all properties present, and you want to unmarshal those JSON objects into a Go program. Example collections include: JSON responses received from a REST API with no defined schema. Multiple values from a JSON column in an SQL database. All the JSON documents in a document database. All the YAML configuration files in a directory. How do I use go-jsonstruct? Install go-jsonstruct: Feed it some JSON objects. For example you can feed it with by running This will output: This example demonstrates: age is always observed as an integer, and so is given type int . The lower-case JSON property age is converted into an exported Go field name Age for compatibility with encoding/json . favoriteFoods is observed as a JSON array, but is not always present, but when it is ","default_branch":null,"files":null,"tree":[],"storefront":"/r/twpayne","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/twpayne/go-jsonstruct/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}