fix(api): remove global openapi bearer security

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-02 08:54:24 +00:00
parent 192f8331f2
commit d40ff2c294
2 changed files with 2 additions and 13 deletions

View file

@ -74,11 +74,6 @@ func (sb *SpecBuilder) Build(groups []RouteGroup) ([]byte, error) {
},
"paths": sb.buildPaths(prepared),
"tags": sb.buildTags(prepared),
"security": []any{
map[string]any{
"bearerAuth": []any{},
},
},
}
if sb.LicenseName != "" {

View file

@ -197,14 +197,8 @@ func TestSpecBuilder_Good_EmptyGroups(t *testing.T) {
if bearerAuth["scheme"] != "bearer" {
t.Fatalf("expected bearerAuth.scheme=bearer, got %v", bearerAuth["scheme"])
}
security := spec["security"].([]any)
if len(security) != 1 {
t.Fatalf("expected one default security requirement, got %d", len(security))
}
req := security[0].(map[string]any)
if _, ok := req["bearerAuth"]; !ok {
t.Fatal("expected default bearerAuth security requirement")
if _, ok := spec["security"]; ok {
t.Fatal("expected no global security requirement in the document")
}
}