dedupe-enums

command
v0.41.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL