mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-27 03:44:04 +00:00
bump(k8s.io/kube-openapi): a07b7bbb58e7fdc5144f8d7046331d29fc9ad3b3
This commit is contained in:
14
vendor/k8s.io/kube-openapi/pkg/util/proto/document.go
generated
vendored
14
vendor/k8s.io/kube-openapi/pkg/util/proto/document.go
generated
vendored
@@ -210,11 +210,18 @@ func (d *Definitions) parseKind(s *openapi_v2.Schema, path *Path) (Schema, error
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (d *Definitions) parseArbitrary(s *openapi_v2.Schema, path *Path) (Schema, error) {
|
||||
return &Arbitrary{
|
||||
BaseSchema: d.parseBaseSchema(s, path),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ParseSchema creates a walkable Schema from an openapi schema. While
|
||||
// this function is public, it doesn't leak through the interface.
|
||||
func (d *Definitions) ParseSchema(s *openapi_v2.Schema, path *Path) (Schema, error) {
|
||||
if len(s.GetType().GetValue()) == 1 {
|
||||
t := s.GetType().GetValue()[0]
|
||||
objectTypes := s.GetType().GetValue()
|
||||
if len(objectTypes) == 1 {
|
||||
t := objectTypes[0]
|
||||
switch t {
|
||||
case object:
|
||||
return d.parseMap(s, path)
|
||||
@@ -229,6 +236,9 @@ func (d *Definitions) ParseSchema(s *openapi_v2.Schema, path *Path) (Schema, err
|
||||
if s.GetProperties() != nil {
|
||||
return d.parseKind(s, path)
|
||||
}
|
||||
if len(objectTypes) == 0 || (len(objectTypes) == 1 && objectTypes[0] == "") {
|
||||
return d.parseArbitrary(s, path)
|
||||
}
|
||||
return d.parsePrimitive(s, path)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user