swagger:alias
Warning
Deprecated. swagger:alias no longer affects the emitted spec. It is an
empty sink that only raises a validate.deprecated diagnostic.
Usage
What it does
Nothing, today. Earlier documentation claimed it published a $ref to
the alias target; that was never accurate. Its only real effect was to
force a named primitive type to inline its scalar (e.g.
{type: string}) instead of producing the $ref a named type
otherwise gets — and that force-inline behaviour has been removed.
Where it went
On a type alias / named-type declaration.
Grammar (EBNF)
The optional IDENT_NAME is ignored — the annotation has no effect.
Migration
- To inline a type at a use site, use
swagger:type inlineon the field (seeswagger:type). - To publish a type as a first-class definition that fields
$ref, useswagger:model. - To control alias rendering globally, use the
RefAliases/TransparentAliasesoptions. A plain (unannotated) Go aliastype T = Otherdissolves to its target by default. See Alias rendering.
Supported keywords
None — the annotation is inert.