| 1 |
//go:build !ignore_autogenerated |
| 2 |
// +build !ignore_autogenerated |
| 3 |
|
| 4 |
/* |
| 5 |
Copyright The Kubernetes Authors. |
| 6 |
|
| 7 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 |
you may not use this file except in compliance with the License. |
| 9 |
You may obtain a copy of the License at |
| 10 |
|
| 11 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
|
| 13 |
Unless required by applicable law or agreed to in writing, software |
| 14 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 15 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 |
See the License for the specific language governing permissions and |
| 17 |
limitations under the License. |
| 18 |
*/ |
| 19 |
|
| 20 |
// Code generated by openapi-gen. DO NOT EDIT. |
| 21 |
|
| 22 |
package namedmodels |
| 23 |
|
| 24 |
import ( |
| 25 |
common "k8s.io/kube-openapi/pkg/common" |
| 26 |
spec "k8s.io/kube-openapi/pkg/validation/spec" |
| 27 |
testdatanamedmodels "k8s.io/kube-openapi/test/integration/testdata/namedmodels" |
| 28 |
) |
| 29 |
|
| 30 |
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { |
| 31 |
return map[string]common.OpenAPIDefinition{ |
| 32 |
testdatanamedmodels.AtomicStruct{}.OpenAPIModelName(): schema_test_integration_testdata_namedmodels_AtomicStruct(ref), |
| 33 |
"k8s.io/kube-openapi/test/integration/testdata/namedmodels.ContainedStruct": schema_test_integration_testdata_namedmodels_ContainedStruct(ref), |
| 34 |
testdatanamedmodels.Struct{}.OpenAPIModelName(): schema_test_integration_testdata_namedmodels_Struct(ref), |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
func schema_test_integration_testdata_namedmodels_AtomicStruct(ref common.ReferenceCallback) common.OpenAPIDefinition { |
| 39 |
return common.OpenAPIDefinition{ |
| 40 |
Schema: spec.Schema{ |
| 41 |
SchemaProps: spec.SchemaProps{ |
| 42 |
Type: []string{"object"}, |
| 43 |
Properties: map[string]spec.Schema{ |
| 44 |
"Field": { |
| 45 |
SchemaProps: spec.SchemaProps{ |
| 46 |
Description: "The generator should respect a manually declared OpenAPIModelName.", |
| 47 |
Default: 0, |
| 48 |
Type: []string{"integer"}, |
| 49 |
Format: "int32", |
| 50 |
}, |
| 51 |
}, |
| 52 |
}, |
| 53 |
Required: []string{"Field"}, |
| 54 |
}, |
| 55 |
}, |
| 56 |
} |
| 57 |
} |
| 58 |
|
| 59 |
func schema_test_integration_testdata_namedmodels_ContainedStruct(ref common.ReferenceCallback) common.OpenAPIDefinition { |
| 60 |
return common.OpenAPIDefinition{ |
| 61 |
Schema: spec.Schema{ |
| 62 |
SchemaProps: spec.SchemaProps{ |
| 63 |
Type: []string{"object"}, |
| 64 |
}, |
| 65 |
}, |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
func schema_test_integration_testdata_namedmodels_Struct(ref common.ReferenceCallback) common.OpenAPIDefinition { |
| 70 |
return common.OpenAPIDefinition{ |
| 71 |
Schema: spec.Schema{ |
| 72 |
SchemaProps: spec.SchemaProps{ |
| 73 |
Type: []string{"object"}, |
| 74 |
Properties: map[string]spec.Schema{ |
| 75 |
"Field": { |
| 76 |
SchemaProps: spec.SchemaProps{ |
| 77 |
Description: "The generator should see the +k8s:openapi-model-package and assume that a OpenAPIModelName is (or will be) generated.", |
| 78 |
Default: map[string]interface{}{}, |
| 79 |
Ref: ref("k8s.io/kube-openapi/test/integration/testdata/namedmodels.ContainedStruct"), |
| 80 |
}, |
| 81 |
}, |
| 82 |
"OtherField": { |
| 83 |
SchemaProps: spec.SchemaProps{ |
| 84 |
Default: 0, |
| 85 |
Type: []string{"integer"}, |
| 86 |
Format: "int32", |
| 87 |
}, |
| 88 |
}, |
| 89 |
}, |
| 90 |
Required: []string{"Field", "OtherField"}, |
| 91 |
}, |
| 92 |
}, |
| 93 |
Dependencies: []string{ |
| 94 |
"k8s.io/kube-openapi/test/integration/testdata/namedmodels.ContainedStruct"}, |
| 95 |
} |
| 96 |
} |