refactor(openapi): remove unused route-group prep state

Simplifies route-group preparation by dropping dead metadata that was no longer used by the OpenAPI builder.

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-02 01:34:14 +00:00
parent 08a2d93776
commit 50b6a9197f

View file

@ -37,9 +37,8 @@ type SpecBuilder struct {
}
type preparedRouteGroup struct {
group RouteGroup
descs []RouteDescription
describable bool
group RouteGroup
descs []RouteDescription
}
// Build generates the complete OpenAPI 3.1 JSON spec.
@ -788,11 +787,9 @@ func prepareRouteGroups(groups []RouteGroup) []preparedRouteGroup {
if isHiddenRouteGroup(g) {
continue
}
describable := isDescribableRouteGroup(g)
out = append(out, preparedRouteGroup{
group: g,
descs: collectRouteDescriptions(g),
describable: describable,
group: g,
descs: collectRouteDescriptions(g),
})
}
@ -838,16 +835,6 @@ func isHiddenRouteGroup(g RouteGroup) bool {
return ok && hg.Hidden()
}
func isDescribableRouteGroup(g RouteGroup) bool {
if _, ok := g.(DescribableGroupIter); ok {
return true
}
if _, ok := g.(DescribableGroup); ok {
return true
}
return false
}
// routeDescriptions returns OpenAPI route descriptions for a group.
// Iterator-backed implementations are preferred when available so builders
// can avoid slice allocation.