You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 570c5ec
Browse filesBrowse the repository at this point in the historyBrowse files
fix(schema): support bare swagger:enum on a type decl (F4b, part C)
Quirk F4b (doc-site-quirks.md): a bare `swagger:enum` (no name argument) on a
type declaration parse-errored (missing-required-arg) and dropped the enum
entirely — even though the name is redundant on a type decl (it IS the type).
Bare `swagger:enum` is now valid and equivalent to `swagger:enum <TypeName>`:
* grammar: the AnnEnum arm no longer raises missing-required-arg for the bare
form — it is structurally valid; "does a type with consts exist?" is a
builder-level question.
* builder: classifierNamedBasic takes the declared type name and, when
swagger:enum is present without an explicit name, infers the enum name from
the declaration (new `enumName` helper) and collects its consts.
With this, a bare `swagger:enum` + `swagger:model` type publishes the same
first-class enum definition as the named form (F4): the definition carries the
enum values + x-go-enum-desc and referencing fields $ref it.
* TestParser_EnumDecl_Empty → TestParser_EnumDecl_Bare (bare form is valid, no
diagnostic); the F1/F2/F4 witness flipped (Priority now carries its enum and
the bare form raises no error); golden regenerated.
* annotations.md swagger:enum: document the optional/bare name and the
swagger:model ⇒ first-class enum definition behaviour.
This completes the F1/F2/F4 reconciliation.
* contributes go-swagger/go-swagger doc-site quirk F4 (bare enum)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
0 commit comments