a-h / generate

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

Add support for named-type default values. #68

Closed chrisgavin closed 3 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.