mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
g.AdditionalProperties = &StructuralOrBool{Structural: ss}
|
g.AdditionalProperties = &StructuralOrBool{Structural: ss, Bool: true}
|
||||||
} else {
|
} else {
|
||||||
g.AdditionalProperties = &StructuralOrBool{Bool: s.AdditionalProperties.Allows}
|
g.AdditionalProperties = &StructuralOrBool{Bool: s.AdditionalProperties.Allows}
|
||||||
}
|
}
|
||||||
|
@ -492,7 +492,7 @@ func Test_ConvertJSONSchemaPropsToOpenAPIv2SchemaByType(t *testing.T) {
|
|||||||
expected: &spec.Schema{
|
expected: &spec.Schema{
|
||||||
SchemaProps: spec.SchemaProps{
|
SchemaProps: spec.SchemaProps{
|
||||||
AdditionalProperties: &spec.SchemaOrBool{
|
AdditionalProperties: &spec.SchemaOrBool{
|
||||||
Allows: false,
|
Allows: true,
|
||||||
Schema: spec.BooleanProperty(),
|
Schema: spec.BooleanProperty(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user