github.com/go-swagger/go-swagger/generator (go): Package generator provides the code generation library for go-swagger.  The general idea is that you should rarely see interface{} in the generated code. You get a complete representation of a swagger document in somewhat idiomatic go.  To do so, there is a set of mapping patterns that are applied, to map a Swagger specification to go types:  NOTE: anyOf and oneOf JSON-schema constructs are not supported by Swagger 2.0  A property on a definition is a pointer when any one of the following conditions is met:  JSONSchema and by extension Swagger allow for items that have a fixed size array, with the schema describing the items at each index. This can be combined with additional items to form some kind of tuple with varargs.  To map this to go it creates a struct that has fixed names and a custom json serializer.  NOTE: the additionalItems keyword is not supported by Swagger 2.0. However, the generator and validator parts in go-swagger do.  The code that is generated also gets the doc comments that are used by the scanner to generate a spec from go code. So that after generation you should be able to reverse generate a spec from the code that was generated by your spec.  It should be equivalent to the original spec but might miss some default values and examples.
Keywords: api|code-generator|go|golang|swagger-codegen|swagger-spec|swagger-specification