📖 2 min read (~ 300 words).

Annotation index

The complete swagger:* vocabulary, one row each. By example jumps to the tutorial that shows the annotation as runnable Go next to the spec it produces; Reference jumps to the exhaustive rule in the Maintainers compendium.

AnnotationAttaches toProducesBy exampleReference
swagger:metapackage doctop-level info, host, basePath, schemes, …examplereference
swagger:modeltype declarationa definitions entryexamplereference
swagger:strfmttype declaration{type: string, format: …} at every useexamplereference
swagger:enumnamed typean enum array (+ x-go-enum-desc)examplereference
swagger:allOfembedded field / structan allOf compositionexamplereference
swagger:aliastype aliasa $ref to the target (vs inline expansion)how-toreference
swagger:routefunc / var doca paths entry + operationexamplereference
swagger:operationfunc / var doca paths entry (YAML body)examplereference
swagger:parametersstruct declarationparameters on the named operation(s)examplereference
swagger:responsestruct declarationa responses entryexamplereference
swagger:ignoretype / field docexcludes the declarationexamplereference
swagger:namefield / method docrenames a JSON propertyexamplereference
swagger:typetype / field docoverrides the inferred Swagger typeexamplereference
swagger:fileparam / response field{type: file}examplereference
swagger:defaultvalue / field doca default-value anchorexamplereference

Keywords, not annotations

Validations, examples and defaults inside a block are driven by keywords (minimum:, pattern:, enum:, example:, default:, …), not annotations. See the Validations and Examples & defaults tutorials, and the Keyword reference.