Skip to content

Commit 379bc58

Browse files
refactor(api): initialize schema extensions with spec.Extensions{}
Address review feedback from gemini-code-assist on pkg/cmd/server/openapi.go: markOpenObject and sanitizeForV2 initialized s.Extensions with the generic map[string]any{}; use the named spec.Extensions{} type instead, matching the kube-openapi types and the generated definitions in zz_generated.openapi.go. No behavioral change — spec.Extensions is defined as map[string]interface{}. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent b1b84bc commit 379bc58

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎pkg/cmd/server/openapi.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func markOpenObject(s *spec.Schema) {
8181
}
8282
s.AdditionalProperties = nil
8383
if s.Extensions == nil {
84-
s.Extensions = map[string]any{}
84+
s.Extensions = spec.Extensions{}
8585
}
8686
s.Extensions["x-kubernetes-preserve-unknown-fields"] = true
8787
}
@@ -384,7 +384,7 @@ func sanitizeForV2(s *spec.Schema) {
384384
if hasIntAndStringAnyOf(s.AnyOf) {
385385
s.Type = spec.StringOrArray{"string"}
386386
if s.Extensions == nil {
387-
s.Extensions = map[string]any{}
387+
s.Extensions = spec.Extensions{}
388388
}
389389
s.Extensions["x-kubernetes-int-or-string"] = true
390390
}

0 commit comments

Comments
 (0)