mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
apiextension: fix structural additionalProperties in ToOpenAPI()
This commit is contained in:
parent
a1f1f0b599
commit
b91640816d
@ -114,7 +114,7 @@ func newGenerics(s *apiextensions.JSONSchemaProps) (*Generic, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
g.AdditionalProperties = &StructuralOrBool{Structural: ss}
|
||||
g.AdditionalProperties = &StructuralOrBool{Structural: ss, Bool: true}
|
||||
} else {
|
||||
g.AdditionalProperties = &StructuralOrBool{Bool: s.AdditionalProperties.Allows}
|
||||
}
|
||||
|
@ -492,7 +492,7 @@ func Test_ConvertJSONSchemaPropsToOpenAPIv2SchemaByType(t *testing.T) {
|
||||
expected: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
AdditionalProperties: &spec.SchemaOrBool{
|
||||
Allows: false,
|
||||
Allows: true,
|
||||
Schema: spec.BooleanProperty(),
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user