dedupe-enums

command
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 repeat 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). The repeat count varies by machine — 2x and 3x have both been seen. When an array is the same block repeated back to back, this collapses it to one copy.

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