2 Copyright 2017 The Kubernetes Authors.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
19 // JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).
20 type JSONSchemaProps struct {
44 Items *JSONSchemaPropsOrArray
45 AllOf []JSONSchemaProps
46 OneOf []JSONSchemaProps
47 AnyOf []JSONSchemaProps
49 Properties map[string]JSONSchemaProps
50 AdditionalProperties *JSONSchemaPropsOrBool
51 PatternProperties map[string]JSONSchemaProps
52 Dependencies JSONSchemaDependencies
53 AdditionalItems *JSONSchemaPropsOrBool
54 Definitions JSONSchemaDefinitions
55 ExternalDocs *ExternalDocumentation
59 // JSON represents any valid JSON value.
60 // These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil.
63 // JSONSchemaURL represents a schema url.
64 type JSONSchemaURL string
66 // JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps
67 // or an array of JSONSchemaProps. Mainly here for serialization purposes.
68 type JSONSchemaPropsOrArray struct {
69 Schema *JSONSchemaProps
70 JSONSchemas []JSONSchemaProps
73 // JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value.
74 // Defaults to true for the boolean property.
75 type JSONSchemaPropsOrBool struct {
77 Schema *JSONSchemaProps
80 // JSONSchemaDependencies represent a dependencies property.
81 type JSONSchemaDependencies map[string]JSONSchemaPropsOrStringArray
83 // JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array.
84 type JSONSchemaPropsOrStringArray struct {
85 Schema *JSONSchemaProps
89 // JSONSchemaDefinitions contains the models explicitly defined in this spec.
90 type JSONSchemaDefinitions map[string]JSONSchemaProps
92 // ExternalDocumentation allows referencing an external resource for extended documentation.
93 type ExternalDocumentation struct {