Generated models

Generate a data model from swagger spec #

The toolkit allows for generating go native structures to serialize and validate a swagger compliant model definition.

The generated objects follow the specified validation rules, including extended format directives for strings and numbers.

Generated models support most Swagger 2.0 features, including polymorphism.

Generated models support most JSON-schema draft4 features, including AllOf, AdditionalProperties and AdditionalItems.

Usage #

generate model -f {spec}

See the full list of available options here.

Model building rules #

Copyright 2015-2024 the go-swagger maintainers. This documentation is under an Apache 2.0 license.

Site built with HUGO using hugo-book