Documentation
¶
Overview ¶
Command dedupe-enums works around a swag v2.0.0-rc5 nondeterminism bug: loadExternalPackage (in swag's packages.go) reparses an external module's package without memoizing by import path, which can non-deterministically double the "enum"/"x-enum-varnames" arrays it emits for types defined outside this module (model.ArgumentType, model.Format, model.Icon from github.com/modelcontextprotocol/registry). When an array is exactly two identical halves back to back, this collapses it to one.
Run after `swag init`, on each generated docs/server file:
go run ./cmd/help/dedupe-enums docs/server/docs.go docs/server/swagger.json docs/server/swagger.yaml
Click to show internal directories.
Click to hide internal directories.