📖 2 min read (~ 400 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:additionalPropertiestype docobject additionalProperties (open / closed / typed)examplereference
swagger:alias (deprecated)type aliasno effect — alias rendering is controlled by Go aliases + optionshow-toreference
swagger:allOfembedded field / structan allOf compositionexamplereference
swagger:defaultvalue / field doca default-value anchorexamplereference
swagger:descriptiontype / field / response docoverrides the description (verbatim body with |)how-toreference
swagger:enumnamed typean enum array (+ x-go-enum-desc)examplereference
swagger:fileparam / response field{type: file}examplereference
swagger:ignoretype / field docexcludes the declarationexamplereference
swagger:metapackage doctop-level info, host, basePath, schemes, …examplereference
swagger:modeltype declarationa definitions entryexamplereference
swagger:namefield / method docrenames a JSON propertyexamplereference
swagger:omitembed / type docdrops named fields from what an embed promoteshow-toreference
swagger:operationfunc / var doca paths entry (YAML body)examplereference
swagger:parametersstruct declarationparameters on the named operation(s)examplereference
swagger:patternPropertiestype doctyped patternProperties (regex → value)examplereference
swagger:responsestruct declarationa responses entryexamplereference
swagger:routefunc / var doca paths entry + operationexamplereference
swagger:strfmttype declaration{type: string, format: …} at every useexamplereference
swagger:titletype / field docoverrides the titlehow-toreference
swagger:typetype / field docoverrides the inferred Swagger typeexamplereference

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.