a-h / generate

Generates Go (golang) Structs from JSON schema.
MIT License
444 stars 137 forks source link

Add support for named-type default values. #68

Closed chrisgavin closed 5 months ago

chrisgavin commented 4 years ago

This adds some primitive support for handling default values when unmarshalling JSON. The main limitation is that it only supports named-types (e.g. it won't work if the default value is a JSON array), but hopefully this is still useful in many cases, such as when a field has a default value of -1.