go-swagger toolkit

Swagger 2.0 describes your API's for you, so you don't have to

swagger:model

spec

A swagger:model annotation optionally gets a model name as extra data on the line. when this appears anywhere in a comment for a struct, then that struct becomes a schema in the definitions object of swagger. The struct gets analyzed and all the collected models are added to the tree. The refs are tracked separately so that they can be renamed later on. swagger:model [?model name]

14 Nov 2015

swagger:meta

spec

The swagger:meta annotation flags a file as source for metadata about the API. This is typically a doc.go file with your package documentation. You can specify a Consumes and Produces key which has a new content type on each line Schemes is a tag that is required and allows for a comma separated string composed of: http, https, ws or wss Host and BasePath can be specified but those values will be defaults, they should get substituted when serving the swagger spec.

14 Nov 2015

swagger:allOf

spec

Marks an embedded type as a member for allOf swagger:allOf Example: // An AllOfModel is composed out of embedded structs but it should build // an allOf property type AllOfModel struct { // swagger:allOf SimpleOne // swagger:allOf mods.Notable Something // not annotated with anything, so should be included CreatedAt strfmt.DateTime `json:"createdAt"` }

14 Nov 2015