Skip to content

Commit

Permalink
support multiple gvks in custom openapi schema
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Sep 2, 2021
1 parent f122fb1 commit 19f8189
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions kyaml/openapi/openapi.go
Expand Up @@ -207,15 +207,17 @@ func AddDefinitions(definitions spec.Definitions) {
}
// cast the extension to a []map[string]string
exts, ok := gvk.([]interface{})
if !ok || len(exts) != 1 {
if !ok {
continue
}

typeMeta, ok := toTypeMeta(exts[0])
if !ok {
continue
for i := range exts {
typeMeta, ok := toTypeMeta(exts[i])
if !ok {
continue
}
globalSchema.schemaByResourceType[typeMeta] = &d
}
globalSchema.schemaByResourceType[typeMeta] = &d
}
}

Expand Down

0 comments on commit 19f8189

Please sign in to comment.