From 45971dfe66be360b731cc4456b1839644b16b6ee Mon Sep 17 00:00:00 2001 From: Ron Date: Thu, 13 Jul 2017 18:05:26 -0600 Subject: [PATCH 01/31] Initial schema commit --- schemas/v3.0/schema.yaml | 1400 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 1400 insertions(+) create mode 100644 schemas/v3.0/schema.yaml diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml new file mode 100644 index 0000000000..1b098199d1 --- /dev/null +++ b/schemas/v3.0/schema.yaml @@ -0,0 +1,1400 @@ +type: object +required: + - openapi + - info + - paths +properties: + openapi: + type: string + enum: + - 3.0.0 + info: + $ref: '#/definitions/Info' + externalDocs: + $ref: '#/definitions/ExternalDocumentation' + servers: + type: array + items: + $ref: '#/definitions/Server' + security: + type: array + items: + $ref: '#/definitions/SecurityRequirement' + tags: + type: array + items: + $ref: '#/definitions/Tag' + paths: + $ref: '#/definitions/Paths' + components: + $ref: '#/definitions/Components' +patternProperties: + '^x-': {} +additionalProperties: false +definitions: + Reference: + type: object + properties: + $ref: + type: string + format: uri-ref + Info: + type: object + required: + - title + - version + properties: + title: + type: string + description: + type: string + termsOfService: + type: string + format: uri-ref + contact: + $ref: '#/definitions/Contact' + license: + $ref: '#/definitions/License' + version: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + + Contact: + type: object + properties: + name: + type: string + url: + type: string + format: uri-ref + email: + type: string + format: email + patternProperties: + '^x-': {} + additionalProperties: false + + License: + type: object + required: + - name + properties: + name: + type: string + url: + type: string + format: uri-ref + patternProperties: + '^x-': {} + additionalProperties: false + + Server: + type: object + required: + - url + properties: + url: + type: string + format: uri-ref + description: + type: string + variables: + type: object + additionalProperties: + $ref: '#/definitions/ServerVariable' + patternProperties: + '^x-': {} + additionalProperties: false + + ServerVariable: + type: object + required: + - default + properties: + enum: + type: string + default: + type: string + description: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + Components: + type: object + properties: + schemas: + type: object + patternProperties: + '^[a-zA-Z0-9\.\-_]+$': + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Schema' + responses: + type: object + patternProperties: + '^[a-zA-Z0-9\.\-_]+$': + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Response' + parameters: + type: object + patternProperties: + '^[a-zA-Z0-9\.\-_]+$': + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Parameter' + examples: + type: object + patternProperties: + '^[a-zA-Z0-9\.\-_]+$': + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Example' + requestBodies: + type: object + patternProperties: + '^[a-zA-Z0-9\.\-_]+$': + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/RequestBody' + headers: + type: object + patternProperties: + '^[a-zA-Z0-9\.\-_]+$': + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Header' + securitySchemes: + type: object + patternProperties: + '^[a-zA-Z0-9\.\-_]+$': + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/SecurityScheme' + links: + type: object + patternProperties: + '^[a-zA-Z0-9\.\-_]+$': + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Link' + callbacks: + type: object + patternProperties: + '^[a-zA-Z0-9\.\-_]+$': + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Callback' + patternProperties: + '^x-': {} + additionalProperties: false + + Schema: + type: object + properties: + title: + type: string + multipleOf: + type: number + minimum: 0 + exclusiveMinimum: true + maximum: + type: number + exclusiveMaximum: + type: boolean + default: false + minimum: + type: number + exclusiveMinimum: + type: boolean + default: false + maxLength: + type: integer + minimum: 0 + minLength: + type: integer + minimum: 0 + default: 0 + pattern: + type: string + format: regex + maxItems: + type: integer + minimum: 0 + minItems: + type: integer + minimum: 0 + default: 0 + uniqueItems: + type: boolean + default: false + maxProperties: + type: integer + minimum: 0 + minProperties: + type: integer + minimum: 0 + default: 0 + required: + type: array + items: + type: string + minItems: 1 + uniqueItems: true + enum: + type: array + items: {} + minItems: 1 + uniqueItems: true + type: + type: string + enum: + - array + - boolean + - integer + - number + - object + - string + not: + $ref: '#/definitions/Schema' + properties: + type: object + additionalProperties: + $ref: '#/definitions/Schema' + additionalProperties: + oneOf: + - $ref: '#/definitions/Schema' + - type: boolean + default: true + description: + type: string + format: + type: string + default: {} + $ref: + type: string + format: uri-ref + nullable: + type: boolean + default: false + discriminator: + $ref: '#/definitions/Discriminator' + readOnly: + type: boolean + default: false + writeOnly: + type: boolean + default: false + example: {} + externalDocs: + $ref: '#/definitions/ExternalDocumentation' + deprecated: + type: boolean + default: false + xml: + $ref: '#/definitions/XML' + patternProperties: + '^x-': {} + additionalProperties: false + + Discriminator: + type: object + required: + - propertyName + properties: + propertyName: + type: string + mapping: + type: object + additionalProperties: + type: string + + XML: + type: object + properties: + name: + type: string + namespace: + type: string + format: url + prefix: + type: string + attribute: + type: boolean + default: false + wrapperd: + type: boolean + default: false + patternProperties: + '^x-': {} + additionalProperties: false + + Response: + type: object + required: + - description + properties: + description: + type: string + headers: + additionalProperties: + oneOf: + - $ref: '#/definitions/Header' + - $ref: '#/definitions/Reference' + content: + type: object + additionalProperties: + $ref: '#/definitions/MediaType' + links: + type: object + additionalProperties: + oneOf: + - $ref: '#/definitions/Link' + - $ref: '#/definitions/Reference' + patternProperties: + '^x-': {} + additionalProperties: false + + MediaType: + oneOf: + - $ref: '#/definitions/MediaTypeWithExample' + - $ref: '#/definitions/MediaTypeWithExamples' + + MediaTypeWithExample: + type: object + properties: + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + example: {} + encoding: + type: object + additionalProperties: + $ref: '#/definitions/Encoding' + patternProperties: + '^x-': {} + additionalProperties: false + + MediaTypeWithExamples: + type: object + properties: + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + examples: + type: object + additionalProperties: + oneOf: + - $ref: '#/definitions/Example' + - $ref: '#/definitions/Reference' + encoding: + type: object + additionalProperties: + $ref: '#/definitions/Encoding' + patternProperties: + '^x-': {} + additionalProperties: false + + Example: + type: object + properties: + summary: + type: string + description: + type: string + value: + type: string + externalValue: + type: string + format: uri-ref + patternProperties: + '^x-': {} + additionalProperties: false + + Header: + type: object + properties: + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string + enum: + - simple + default: simple + explode: + type: boolean + enum: + - false + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + examples: + type: array + items: + oneOf: + - $ref: '#/definitions/Example' + - $ref: '#/definitions/Reference' + example: {} + content: + type: object + additionalProperties: + $ref: '#/definitions/MediaType' + patternProperties: + '^x-': {} + additionalProperties: false + + Paths: + type: object + patternProperties: + '^\/': + $ref: '#/definitions/PathItem' + '^x-': {} + additionalProperties: false + + PathItem: + type: object + properties: + $ref: + type: string + summary: + type: string + description: + type: string + get: + $ref: '#/definitions/Operation' + put: + $ref: '#/definitions/Operation' + post: + $ref: '#/definitions/Operation' + delete: + $ref: '#/definitions/Operation' + options: + $ref: '#/definitions/Operation' + head: + $ref: '#/definitions/Operation' + patch: + $ref: '#/definitions/Operation' + trace: + $ref: '#/definitions/Operation' + servers: + type: array + items: + $ref: '#/definitions/Server' + parameters: + type: array + items: + oneOf: + - $ref: '#/definitions/Parameter' + - $ref: '#/definitions/Reference' + patternProperties: + '^x-': {} + additionalProperties: false + + Operation: + type: object + required: + - responses + properties: + tags: + type: array + items: + type: string + summary: + type: string + description: + type: string + externalDocs: + $ref: '#/definitions/ExternalDocumentation' + operationId: + type: string + parameters: + type: array + items: + oneOf: + - $ref: '#/definitions/Parameter' + - $ref: '#/definitions/Reference' + requestBody: + oneOf: + - $ref: '#/definitions/RequestBody' + - $ref: '#/definitions/Reference' + responses: + $ref: '#/definitions/Responses' + callbacks: + type: object + additionalProperties: + $ref: '#/definitions/Callback' + deprecated: + type: boolean + default: false + security: + type: array + items: + $ref: '#/definitions/SecurityRequirement' + servers: + type: array + items: + $ref: '#/definitions/Server' + patternProperties: + '^x-': {} + additionalProperties: false + + Responses: + allOf: + - $ref: '#/definitions/Extensions' + type: object + properties: + default: + oneOf: + - $ref: '#/definitions/Response' + - $ref: '#/definitions/Reference' + patternProperties: + '[1-5](?:\d{2}|XX)': + oneOf: + - $ref: '#/definitions/Response' + - $ref: '#/definitions/Reference' + '^x-': {} + minProperties: 1 + additionalProperties: false + not: + type: object + patternProperties: + '^x-': {} + + + SecurityRequirement: + type: object + additionalProperties: + type: array + items: + type: string + + Tag: + type: object + required: + - name + properties: + name: + type: string + description: + type: string + externalDocs: + $ref: '#/definitions/ExternalDocumentation' + patternProperties: + '^x-': {} + additionalProperties: false + + ExternalDocumentation: + type: object + required: + - url + properties: + description: + type: string + url: + type: string + format: uri-ref + patternProperties: + '^x-': {} + additionalProperties: false + + Parameter: + oneOf: + - $ref: '#/definitions/ParameterWithSchema' + - $ref: '#/definitions/ParameterWithContent' + + ParameterWithSchema: + oneOf: + - $ref: '#/definitions/ParameterWithSchemaWithExample' + - $ref: '#/definitions/ParameterWithSchemaWithExamples' + + ParameterWithSchemaWithExample: + oneOf: + - $ref: '#/definitions/ParameterWithSchemaWithExampleInPath' + - $ref: '#/definitions/ParameterWithSchemaWithExampleInQuery' + - $ref: '#/definitions/ParameterWithSchemaWithExampleInHeader' + - $ref: '#/definitions/ParameterWithSchemaWithExampleInCookie' + + ParameterWithSchemaWithExampleInPath: + type: object + required: + - name + - in + - schema + - required + properties: + name: + type: string + in: + type: string + enum: + - path + description: + type: string + required: + type: boolean + enum: + - true + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string + enum: + - matrix + - label + - simple + default: simple + explode: + type: boolean + allowReserved: + type: boolean + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + example: {} + patternProperties: + '^x-': {} + additionalProperties: false + + ParameterWithSchemaWithExampleInQuery: + type: object + required: + - name + - in + - schema + properties: + name: + type: string + in: + type: string + enum: + - query + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string + enum: + - form + - spaceDelimited + - pipeDelimited + - deepObject + default: form + explode: + type: boolean + allowReserved: + type: boolean + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + example: {} + patternProperties: + '^x-': {} + additionalProperties: false + + ParameterWithSchemaWithExampleInHeader: + type: object + required: + - name + - in + - schema + properties: + name: + type: string + in: + type: string + enum: + - header + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string + enum: + - simple + default: simple + explode: + type: boolean + allowReserved: + type: boolean + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + example: {} + patternProperties: + '^x-': {} + additionalProperties: false + + ParameterWithSchemaWithExampleInCookie: + type: object + required: + - name + - in + - schema + properties: + name: + type: string + in: + type: string + enum: + - cookie + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string + enum: + - form + default: form + explode: + type: boolean + allowReserved: + type: boolean + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + example: {} + patternProperties: + '^x-': {} + additionalProperties: false + + ParameterWithSchemaWithExamples: + oneOf: + - $ref: '#/definitions/ParameterWithSchemaWithExamplesInPath' + - $ref: '#/definitions/ParameterWithSchemaWithExamplesInQuery' + - $ref: '#/definitions/ParameterWithSchemaWithExamplesInHeader' + - $ref: '#/definitions/ParameterWithSchemaWithExamplesInCookie' + + ParameterWithSchemaWithExamplesInPath: + type: object + required: + - name + - in + - schema + - required + properties: + name: + type: string + in: + type: string + enum: + - path + description: + type: string + required: + type: boolean + enum: + - true + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string + enum: + - matrix + - label + - simple + default: simple + explode: + type: boolean + allowReserved: + type: boolean + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + examples: + type: object + additionalProperties: + oneOf: + - $ref: '#/definitions/Example' + - $ref: '#/definitions/Reference' + patternProperties: + '^x-': {} + additionalProperties: false + + ParameterWithSchemaWithExamplesInQuery: + type: object + required: + - name + - in + - schema + properties: + name: + type: string + in: + type: string + enum: + - query + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string + enum: + - form + - spaceDelimited + - pipeDelimited + - deepObject + default: form + explode: + type: boolean + allowReserved: + type: boolean + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + examples: + type: object + additionalProperties: + oneOf: + - $ref: '#/definitions/Example' + - $ref: '#/definitions/Reference' + patternProperties: + '^x-': {} + additionalProperties: false + + ParameterWithSchemaWithExamplesInHeader: + type: object + required: + - name + - in + - schema + properties: + name: + type: string + in: + type: string + enum: + - header + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string + enum: + - simple + default: simple + explode: + type: boolean + allowReserved: + type: boolean + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + examples: + type: object + additionalProperties: + oneOf: + - $ref: '#/definitions/Example' + - $ref: '#/definitions/Reference' + patternProperties: + '^x-': {} + additionalProperties: false + + ParameterWithSchemaWithExamplesInCookie: + type: object + required: + - name + - in + - schema + properties: + name: + type: string + in: + type: string + enum: + - cookie + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string + enum: + - form + default: form + explode: + type: boolean + allowReserved: + type: boolean + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + examples: + type: object + additionalProperties: + oneOf: + - $ref: '#/definitions/Example' + - $ref: '#/definitions/Reference' + patternProperties: + '^x-': {} + additionalProperties: false + + ParameterWithContent: + oneOf: + - $ref: '#/definitions/ParameterWithContentInPath' + - $ref: '#/definitions/ParameterWithContentNotInPath' + + ParameterWithContentInPath: + type: object + required: + - name + - in + - content + properties: + name: + type: string + in: + type: string + enum: + - path + description: + type: string + required: + type: boolean + enum: + - true + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + content: + type: object + additionalProperties: + $ref: '#/definitions/MediaType' + minProperties: 1 + maxProperties: 1 + patternProperties: + '^x-': {} + additionalProperties: false + + ParameterWithContentNotInPath: + type: object + required: + - name + - in + - content + properties: + name: + type: string + in: + type: string + enum: + - query + - header + - cookie + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + content: + type: object + additionalProperties: + $ref: '#/definitions/MediaType' + minProperties: 1 + maxProperties: 1 + patternProperties: + '^x-': {} + additionalProperties: false + + RequestBody: + type: object + required: + - content + properties: + description: + type: string + content: + type: object + additionalProperties: + $ref: '#/definitions/MediaType' + required: + type: boolean + default: false + patternProperties: + '^x-': {} + additionalProperties: false + + SecurityScheme: + oneOf: + - $ref: '#/definitions/APIKeySecurityScheme' + - $ref: '#/definitions/HTTPSecurityScheme' + - $ref: '#/definitions/OAuth2SecurityScheme' + - $ref: '#/definitions/OpenIdConnectSecurityScheme' + + APIKeySecurityScheme: + type: object + required: + - type + - name + - in + properties: + type: + type: string + enum: + - apiKey + name: + type: string + in: + type: string + enum: + - header + - query + - cookie + description: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + HTTPSecurityScheme: + oneOf: + - $ref: '#/definitions/NonBearerHTTPSecurityScheme' + - $ref: '#/definitions/BearerHTTPSecurityScheme' + + NonBearerHTTPSecurityScheme: + not: + type: object + properties: + scheme: + type: string + enum: + - bearer + type: object + required: + - scheme + - type + properties: + scheme: + type: string + description: + type: string + type: + type: string + enum: + - http + patternProperties: + '^x-': {} + additionalProperties: false + + BearerHTTPSecurityScheme: + type: object + required: + - type + - scheme + properties: + scheme: + type: string + enum: + - bearer + bearerFormat: + type: string + type: + type: string + enum: + - http + description: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + OAuth2SecurityScheme: + type: object + required: + - type + - flows + properties: + type: + type: string + enum: + - oauth2 + flows: + $ref: '#/definitions/OAuthFlows' + description: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + OpenIdConnectSecurityScheme: + type: object + required: + - type + - openIdConnect + properties: + type: + type: string + enum: + - openIdConnect + openIdConnectUrl: + type: string + format: url + description: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + OAuthFlows: + type: object + properties: + implicit: + $ref: '#/definitions/ImplicitOAuthFlow' + password: + $ref: '#/definitions/PasswordOAuthFlow' + clientCredentials: + $ref: '#/definitions/ClientCredentialsFlow' + authorizationCode: + $ref: '#/definitions/AuthorizationCodeOAuthFlow' + patternProperties: + '^x-': {} + additionalProperties: false + + ImplicitOAuthFlow: + type: object + required: + - authorizationUrl + - scopes + properties: + authorizationUrl: + type: string + format: uri-ref + refreshUrl: + type: string + format: uri-ref + scopes: + type: object + additionalProperties: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + PasswordOAuthFlow: + type: object + required: + - tokenUrl + properties: + tokenUrl: + type: string + format: uri-ref + refreshUrl: + type: string + format: uri-ref + scopes: + type: object + additionalProperties: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + ClientCredentialsFlow: + type: object + required: + - tokenUrl + properties: + tokenUrl: + type: string + format: uri-ref + refreshUrl: + type: string + format: uri-ref + scopes: + type: object + additionalProperties: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + AuthorizationCodeOAuthFlow: + type: object + required: + - authorizationUrl + - tokenUrl + properties: + authorizationUrl: + type: string + format: uri-ref + tokenUrl: + type: string + format: uri-ref + refreshUrl: + type: string + format: uri-ref + scopes: + type: object + additionalProperties: + type: string + patternProperties: + '^x-': {} + additionalProperties: false + + Link: + oneOf: + - $ref: '#/definitions/LinkWithOperationRef' + - $ref: '#/definitions/LinkWithOperationId' + + LinkWithOperationRef: + type: object + properties: + operationRef: + type: string + format: uri-ref + parameters: + type: object + additionalProperties: {} + requestBody: {} + description: + type: string + server: + $ref: '#/definitions/Server' + patternProperties: + '^x-': {} + additionalProperties: false + + LinkWithOperationId: + type: object + properties: + operationId: + type: string + parameters: + type: object + additionalProperties: {} + requestBody: {} + description: + type: string + server: + $ref: '#/definitions/Server' + patternProperties: + '^x-': {} + additionalProperties: false + + Callback: + type: object + additionalProperties: + $ref: '#/definitions/PathItem' + patternProperties: + '^x-': {} + additionalProperties: false + + Encoding: + type: object + properties: + contentType: + type: string + headers: + type: object + additionalProperties: + $ref: '#/definitions/Header' + style: + type: string + enum: + - form + - spaceDelimited + - pipeDelimited + - deepObject + explode: + type: boolean + allowReserved: + type: boolean + default: false + additionalProperties: false \ No newline at end of file From bda42189ad7f69cda8bf4761e9acb2c1775d3dc0 Mon Sep 17 00:00:00 2001 From: Ron Date: Mon, 17 Jul 2017 17:31:40 -0700 Subject: [PATCH 02/31] so many fixes --- schemas/v3.0/schema.yaml | 182 ++++++++++++++++++++++++++++++--------- 1 file changed, 141 insertions(+), 41 deletions(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 1b098199d1..96ac602acc 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -6,8 +6,7 @@ required: properties: openapi: type: string - enum: - - 3.0.0 + pattern: ^3\.0\.\d(-.+)?$ info: $ref: '#/definitions/Info' externalDocs: @@ -34,10 +33,12 @@ additionalProperties: false definitions: Reference: type: object + required: + - $ref properties: $ref: type: string - format: uri-ref + format: uriref Info: type: object required: @@ -50,7 +51,7 @@ definitions: type: string termsOfService: type: string - format: uri-ref + format: uriref contact: $ref: '#/definitions/Contact' license: @@ -69,7 +70,7 @@ definitions: type: string url: type: string - format: uri-ref + format: uriref email: type: string format: email @@ -86,7 +87,7 @@ definitions: type: string url: type: string - format: uri-ref + format: uriref patternProperties: '^x-': {} additionalProperties: false @@ -98,7 +99,7 @@ definitions: properties: url: type: string - format: uri-ref + format: uriref description: type: string variables: @@ -254,21 +255,50 @@ definitions: type: type: string enum: - - array - - boolean - - integer - - number - - object - - string + - array + - boolean + - integer + - number + - object + - string not: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + allOf: + type: array + items: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + oneOf: + type: array + items: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + anyOf: + type: array + items: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + items: + type: array + items: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' properties: type: object additionalProperties: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' additionalProperties: oneOf: - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' - type: boolean default: true description: @@ -276,9 +306,6 @@ definitions: format: type: string default: {} - $ref: - type: string - format: uri-ref nullable: type: boolean default: false @@ -327,7 +354,7 @@ definitions: attribute: type: boolean default: false - wrapperd: + wrapped: type: boolean default: false patternProperties: @@ -383,6 +410,8 @@ definitions: MediaTypeWithExamples: type: object + required: + - examples properties: schema: oneOf: @@ -409,17 +438,28 @@ definitions: type: string description: type: string - value: - type: string + value: {} externalValue: type: string - format: uri-ref + format: uriref patternProperties: '^x-': {} additionalProperties: false Header: + oneOf: + - $ref: '#/definitions/HeaderWithSchema' + - $ref: '#/definitions/HeaderWithContent' + + HeaderWithSchema: + oneOf: + - $ref: '#/definitions/HeaderWithSchemaWithExample' + - $ref: '#/definitions/HeaderWithSchemaWithExamples' + + HeaderWithSchemaWithExample: type: object + required: + - schema properties: description: type: string @@ -439,24 +479,81 @@ definitions: default: simple explode: type: boolean + allowReserved: + type: boolean + default: false + schema: + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' + example: {} + patternProperties: + '^x-': {} + additionalProperties: false + + HeaderWithSchemaWithExamples: + type: object + required: + - schema + - examples + properties: + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false + style: + type: string enum: - - false + - simple + default: simple + explode: + type: boolean + allowReserved: + type: boolean default: false schema: oneOf: - $ref: '#/definitions/Schema' - $ref: '#/definitions/Reference' examples: - type: array - items: + type: object + additionalProperties: oneOf: - $ref: '#/definitions/Example' - $ref: '#/definitions/Reference' - example: {} + patternProperties: + '^x-': {} + additionalProperties: false + + HeaderWithContent: + type: object + required: + - content + properties: + description: + type: string + required: + type: boolean + default: false + deprecated: + type: boolean + default: false + allowEmptyValue: + type: boolean + default: false content: type: object additionalProperties: $ref: '#/definitions/MediaType' + minProperties: 1 + maxProperties: 1 patternProperties: '^x-': {} additionalProperties: false @@ -557,8 +654,6 @@ definitions: additionalProperties: false Responses: - allOf: - - $ref: '#/definitions/Extensions' type: object properties: default: @@ -577,6 +672,7 @@ definitions: type: object patternProperties: '^x-': {} + additionalProperties: false SecurityRequirement: @@ -610,7 +706,7 @@ definitions: type: string url: type: string - format: uri-ref + format: uriref patternProperties: '^x-': {} additionalProperties: false @@ -825,6 +921,7 @@ definitions: - in - schema - required + - examples properties: name: type: string @@ -876,6 +973,7 @@ definitions: - name - in - schema + - examples properties: name: type: string @@ -927,6 +1025,7 @@ definitions: - name - in - schema + - examples properties: name: type: string @@ -975,6 +1074,7 @@ definitions: - name - in - schema + - examples properties: name: type: string @@ -1187,8 +1287,8 @@ definitions: type: string type: type: string - enum: - - http + enum: + - http description: type: string patternProperties: @@ -1255,10 +1355,10 @@ definitions: properties: authorizationUrl: type: string - format: uri-ref + format: uriref refreshUrl: type: string - format: uri-ref + format: uriref scopes: type: object additionalProperties: @@ -1274,10 +1374,10 @@ definitions: properties: tokenUrl: type: string - format: uri-ref + format: uriref refreshUrl: type: string - format: uri-ref + format: uriref scopes: type: object additionalProperties: @@ -1293,10 +1393,10 @@ definitions: properties: tokenUrl: type: string - format: uri-ref + format: uriref refreshUrl: type: string - format: uri-ref + format: uriref scopes: type: object additionalProperties: @@ -1313,13 +1413,13 @@ definitions: properties: authorizationUrl: type: string - format: uri-ref + format: uriref tokenUrl: type: string - format: uri-ref + format: uriref refreshUrl: type: string - format: uri-ref + format: uriref scopes: type: object additionalProperties: @@ -1338,7 +1438,7 @@ definitions: properties: operationRef: type: string - format: uri-ref + format: uriref parameters: type: object additionalProperties: {} From 1eb22f0b6536a85001e18e09690e2e74a0c64a79 Mon Sep 17 00:00:00 2001 From: Ron Date: Mon, 17 Jul 2017 22:32:06 -0700 Subject: [PATCH 03/31] items array -> object --- schemas/v3.0/schema.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 96ac602acc..b57f79112c 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -284,11 +284,9 @@ definitions: - $ref: '#/definitions/Schema' - $ref: '#/definitions/Reference' items: - type: array - items: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' properties: type: object additionalProperties: From bd277c66fe002a35bbbd1ac2594ae2a246e305cf Mon Sep 17 00:00:00 2001 From: Ron Date: Tue, 18 Jul 2017 08:13:08 -0700 Subject: [PATCH 04/31] A couple more fixes --- schemas/v3.0/schema.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index b57f79112c..098eee0631 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -1315,7 +1315,7 @@ definitions: type: object required: - type - - openIdConnect + - openIdConnectUrl properties: type: type: string @@ -1472,7 +1472,6 @@ definitions: $ref: '#/definitions/PathItem' patternProperties: '^x-': {} - additionalProperties: false Encoding: type: object From 069367f4d7535736fd261b6e590a8b209314b00a Mon Sep 17 00:00:00 2001 From: Ron Date: Tue, 18 Jul 2017 10:28:37 -0700 Subject: [PATCH 05/31] Fixed restriction on Server's url --- schemas/v3.0/schema.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 098eee0631..a8bbde31df 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -99,7 +99,6 @@ definitions: properties: url: type: string - format: uriref description: type: string variables: From 629cd7c3e821d09dd63c6442f02bae15b97b4207 Mon Sep 17 00:00:00 2001 From: Ron Date: Tue, 18 Jul 2017 15:28:23 -0700 Subject: [PATCH 06/31] make callbacks great again! --- schemas/v3.0/schema.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index a8bbde31df..16658eb0b0 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -634,7 +634,9 @@ definitions: callbacks: type: object additionalProperties: - $ref: '#/definitions/Callback' + oneOf: + - $ref: '#/definitions/Callback' + - $ref: '#/definitions/Reference' deprecated: type: boolean default: false From 49e784d7b7800da8732103aa3ac56bc7ccde5cfb Mon Sep 17 00:00:00 2001 From: Ron Date: Mon, 24 Jul 2017 15:33:13 -0700 Subject: [PATCH 07/31] fixed servervariable.enum --- schemas/v3.0/schema.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 16658eb0b0..67bd3750d0 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -115,7 +115,9 @@ definitions: - default properties: enum: - type: string + type: array + items: + type: string default: type: string description: From 1087db47f1afbdcef97c4c0847e6c971718af23b Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Thu, 8 Nov 2018 11:18:15 -0800 Subject: [PATCH 08/31] Use "uri-reference", not "url" or "uriref" There is no way to tell a validator that a schema is using draft-wright-json-schema-validation-00, which is the only draft with a "uriref" format. Validators either interpret schemas as the previous draft (fge-04), which does not have this concept at all, or the following draft (wright-01) which has "uri-reference". Since there are no options that will automatically work correctly, using the later form seems to be the best. Many validators allow registering extensions, and we can just document that we are using the wright-01+ syntax. You often need to register format handlers to get *any* format validation with many validators anyway, so this does not seem overly burdensome. --- schemas/v3.0/schema.yaml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 67bd3750d0..d8c3de8790 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -38,7 +38,7 @@ definitions: properties: $ref: type: string - format: uriref + format: uri-reference Info: type: object required: @@ -51,7 +51,7 @@ definitions: type: string termsOfService: type: string - format: uriref + format: uri-reference contact: $ref: '#/definitions/Contact' license: @@ -70,7 +70,7 @@ definitions: type: string url: type: string - format: uriref + format: uri-reference email: type: string format: email @@ -87,7 +87,7 @@ definitions: type: string url: type: string - format: uriref + format: uri-reference patternProperties: '^x-': {} additionalProperties: false @@ -347,7 +347,7 @@ definitions: type: string namespace: type: string - format: url + format: uri-reference prefix: type: string attribute: @@ -440,7 +440,7 @@ definitions: value: {} externalValue: type: string - format: uriref + format: uri-reference patternProperties: '^x-': {} additionalProperties: false @@ -707,7 +707,7 @@ definitions: type: string url: type: string - format: uriref + format: uri-reference patternProperties: '^x-': {} additionalProperties: false @@ -1326,7 +1326,7 @@ definitions: - openIdConnect openIdConnectUrl: type: string - format: url + format: uri-reference description: type: string patternProperties: @@ -1356,10 +1356,10 @@ definitions: properties: authorizationUrl: type: string - format: uriref + format: uri-reference refreshUrl: type: string - format: uriref + format: uri-reference scopes: type: object additionalProperties: @@ -1375,10 +1375,10 @@ definitions: properties: tokenUrl: type: string - format: uriref + format: uri-reference refreshUrl: type: string - format: uriref + format: uri-reference scopes: type: object additionalProperties: @@ -1394,10 +1394,10 @@ definitions: properties: tokenUrl: type: string - format: uriref + format: uri-reference refreshUrl: type: string - format: uriref + format: uri-reference scopes: type: object additionalProperties: @@ -1414,13 +1414,13 @@ definitions: properties: authorizationUrl: type: string - format: uriref + format: uri-reference tokenUrl: type: string - format: uriref + format: uri-reference refreshUrl: type: string - format: uriref + format: uri-reference scopes: type: object additionalProperties: @@ -1439,7 +1439,7 @@ definitions: properties: operationRef: type: string - format: uriref + format: uri-reference parameters: type: object additionalProperties: {} @@ -1497,4 +1497,4 @@ definitions: allowReserved: type: boolean default: false - additionalProperties: false \ No newline at end of file + additionalProperties: false From 13a4fd24971deee4024b5c4afd262473c0c9d43e Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Thu, 8 Nov 2018 11:26:05 -0800 Subject: [PATCH 09/31] Fix usage of "not" Constructs such as: type: object not: type: object will always fail, so remove the type inside the not. The "not" usage around "^x-" patterns for responses is unnecessary, as the existing patternProperties: "[1-5]..." additionalProperties: false prevents all property that do not start with 1, 2, 3, 4, or 5 from being allowed already. --- schemas/v3.0/schema.yaml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index d8c3de8790..10ad5176a2 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -666,14 +666,8 @@ definitions: oneOf: - $ref: '#/definitions/Response' - $ref: '#/definitions/Reference' - '^x-': {} minProperties: 1 additionalProperties: false - not: - type: object - patternProperties: - '^x-': {} - additionalProperties: false SecurityRequirement: @@ -1250,13 +1244,6 @@ definitions: - $ref: '#/definitions/BearerHTTPSecurityScheme' NonBearerHTTPSecurityScheme: - not: - type: object - properties: - scheme: - type: string - enum: - - bearer type: object required: - scheme @@ -1264,6 +1251,9 @@ definitions: properties: scheme: type: string + not: + enum: + - bearer description: type: string type: From 5529143ef0144235f2341303e5f853ed5c7ac9db Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Thu, 8 Nov 2018 11:35:44 -0800 Subject: [PATCH 10/31] Use patternProperties for $ref While draft-wright-json-schema-00 forbids JSON References except where a schema is expected, no validators implement this until draft-writght-json-schema-01. wright-00 schemas are in practice processed as draft-04 schemas, meaning that "$ref" is always considered a JSON Reference. Or, at least, some validators do that. We can work around this by using a pattern that only matches "$ref". There is no problem with the $ref in the "required" keyword, as only "$ref" as a property name is recognized as a reference. --- schemas/v3.0/schema.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 10ad5176a2..5963c2ca4b 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -35,8 +35,8 @@ definitions: type: object required: - $ref - properties: - $ref: + patternProperties: + '^\$ref$': type: string format: uri-reference Info: From 82ef49c0690770e36f8ceaed75b6ee73535b1bbc Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Thu, 15 Nov 2018 09:41:43 -0800 Subject: [PATCH 11/31] XML namespace must be an absolute URI --- schemas/v3.0/schema.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 5963c2ca4b..afe45452e3 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -347,7 +347,7 @@ definitions: type: string namespace: type: string - format: uri-reference + format: uri prefix: type: string attribute: From f71d7f825c6b50a0fc5ce2c4ba50e9673f0b8a61 Mon Sep 17 00:00:00 2001 From: Mike Ralphson Date: Tue, 20 Nov 2018 03:28:20 +0000 Subject: [PATCH 12/31] In Daft 5, schema.enum only SHOULD be unique, not MUST --- schemas/v3.0/schema.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index afe45452e3..5fc07f584f 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -252,7 +252,7 @@ definitions: type: array items: {} minItems: 1 - uniqueItems: true + uniqueItems: false type: type: string enum: From e6192597fbd72190742bc536196a437649f8d326 Mon Sep 17 00:00:00 2001 From: Mike Ralphson Date: Tue, 20 Nov 2018 03:29:54 +0000 Subject: [PATCH 13/31] parameters arrays MUST be unique on name & in, therefore MUST be unique across all properties --- schemas/v3.0/schema.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 5fc07f584f..52eb1a137b 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -600,6 +600,7 @@ definitions: oneOf: - $ref: '#/definitions/Parameter' - $ref: '#/definitions/Reference' + uniqueItems: true patternProperties: '^x-': {} additionalProperties: false @@ -627,6 +628,7 @@ definitions: oneOf: - $ref: '#/definitions/Parameter' - $ref: '#/definitions/Reference' + uniqueItems: true requestBody: oneOf: - $ref: '#/definitions/RequestBody' From e9de80fc38277f6710b9aa28e92f4b018bfd504e Mon Sep 17 00:00:00 2001 From: Mike Ralphson Date: Tue, 20 Nov 2018 03:31:01 +0000 Subject: [PATCH 14/31] tags array MUST be unique by name, therefore MUST be unique across all properties --- schemas/v3.0/schema.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 52eb1a137b..bd54d6f773 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -23,6 +23,7 @@ properties: type: array items: $ref: '#/definitions/Tag' + uniqueItems: true paths: $ref: '#/definitions/Paths' components: From 99226cf609a3663ded8b85f3cc3e1d0ce24306b8 Mon Sep 17 00:00:00 2001 From: Mike Ralphson Date: Tue, 20 Nov 2018 03:45:04 +0000 Subject: [PATCH 15/31] responses object keys pattern must be anchored --- schemas/v3.0/schema.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index bd54d6f773..b691d9c131 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -665,7 +665,7 @@ definitions: - $ref: '#/definitions/Response' - $ref: '#/definitions/Reference' patternProperties: - '[1-5](?:\d{2}|XX)': + '^[1-5](?:\d{2}|XX)$': oneOf: - $ref: '#/definitions/Response' - $ref: '#/definitions/Reference' From 6fbc9269b75f20ecdf723b7c264e6d9178b2fbad Mon Sep 17 00:00:00 2001 From: Mike Ralphson Date: Tue, 20 Nov 2018 03:47:41 +0000 Subject: [PATCH 16/31] responses object map MAY be extended with specification extensions --- schemas/v3.0/schema.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index b691d9c131..51b02f2cde 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -669,6 +669,7 @@ definitions: oneOf: - $ref: '#/definitions/Response' - $ref: '#/definitions/Reference' + '^x-': {} minProperties: 1 additionalProperties: false From 0684d656a7de8ec1e727e31fa268b7213351e090 Mon Sep 17 00:00:00 2001 From: Mike Ralphson Date: Tue, 20 Nov 2018 03:53:29 +0000 Subject: [PATCH 17/31] Response.headers map missing type:object --- schemas/v3.0/schema.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 51b02f2cde..90c72683d9 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -369,6 +369,7 @@ definitions: description: type: string headers: + type: object additionalProperties: oneOf: - $ref: '#/definitions/Header' From 88dd4301d137a656aca2f20a25cd1b54032b5f05 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 8 Jan 2019 10:30:23 +0100 Subject: [PATCH 18/31] Pre-format schema to improve changes relevancy --- schemas/v3.0/schema.yaml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 90c72683d9..280b88e177 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -77,7 +77,7 @@ definitions: format: email patternProperties: '^x-': {} - additionalProperties: false + additionalProperties: false License: type: object @@ -327,8 +327,8 @@ definitions: $ref: '#/definitions/XML' patternProperties: '^x-': {} - additionalProperties: false - + additionalProperties: false + Discriminator: type: object required: @@ -407,7 +407,7 @@ definitions: $ref: '#/definitions/Encoding' patternProperties: '^x-': {} - additionalProperties: false + additionalProperties: false MediaTypeWithExamples: type: object @@ -430,7 +430,7 @@ definitions: $ref: '#/definitions/Encoding' patternProperties: '^x-': {} - additionalProperties: false + additionalProperties: false Example: type: object @@ -490,7 +490,7 @@ definitions: example: {} patternProperties: '^x-': {} - additionalProperties: false + additionalProperties: false HeaderWithSchemaWithExamples: type: object @@ -562,7 +562,7 @@ definitions: Paths: type: object patternProperties: - '^\/': + '^\/': $ref: '#/definitions/PathItem' '^x-': {} additionalProperties: false @@ -673,7 +673,7 @@ definitions: '^x-': {} minProperties: 1 additionalProperties: false - + SecurityRequirement: type: object @@ -715,7 +715,7 @@ definitions: oneOf: - $ref: '#/definitions/ParameterWithSchema' - $ref: '#/definitions/ParameterWithContent' - + ParameterWithSchema: oneOf: - $ref: '#/definitions/ParameterWithSchemaWithExample' @@ -819,7 +819,7 @@ definitions: example: {} patternProperties: '^x-': {} - additionalProperties: false + additionalProperties: false ParameterWithSchemaWithExampleInHeader: type: object @@ -862,7 +862,7 @@ definitions: example: {} patternProperties: '^x-': {} - additionalProperties: false + additionalProperties: false ParameterWithSchemaWithExampleInCookie: type: object @@ -905,7 +905,7 @@ definitions: example: {} patternProperties: '^x-': {} - additionalProperties: false + additionalProperties: false ParameterWithSchemaWithExamples: oneOf: @@ -1017,7 +1017,7 @@ definitions: - $ref: '#/definitions/Reference' patternProperties: '^x-': {} - additionalProperties: false + additionalProperties: false ParameterWithSchemaWithExamplesInHeader: type: object @@ -1066,7 +1066,7 @@ definitions: - $ref: '#/definitions/Reference' patternProperties: '^x-': {} - additionalProperties: false + additionalProperties: false ParameterWithSchemaWithExamplesInCookie: type: object @@ -1217,7 +1217,7 @@ definitions: - $ref: '#/definitions/HTTPSecurityScheme' - $ref: '#/definitions/OAuth2SecurityScheme' - $ref: '#/definitions/OpenIdConnectSecurityScheme' - + APIKeySecurityScheme: type: object required: @@ -1228,7 +1228,7 @@ definitions: type: type: string enum: - - apiKey + - apiKey name: type: string in: @@ -1242,7 +1242,7 @@ definitions: patternProperties: '^x-': {} additionalProperties: false - + HTTPSecurityScheme: oneOf: - $ref: '#/definitions/NonBearerHTTPSecurityScheme' @@ -1318,7 +1318,7 @@ definitions: type: type: string enum: - - openIdConnect + - openIdConnect openIdConnectUrl: type: string format: uri-reference From 26cf125ad3f25a1d983c7094299c91948502acd6 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 8 Jan 2019 11:02:46 +0100 Subject: [PATCH 19/31] Simplify Schema or Reference --- schemas/v3.0/README.md | 24 ++++++++++++ schemas/v3.0/schema.yaml | 80 +++++++++++----------------------------- 2 files changed, 46 insertions(+), 58 deletions(-) create mode 100644 schemas/v3.0/README.md diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md new file mode 100644 index 0000000000..e38570a4c6 --- /dev/null +++ b/schemas/v3.0/README.md @@ -0,0 +1,24 @@ +# Minimizing schema + +## Schema or Reference + +All references to `#/definitions/Schema` are happening in such form: + +```yaml +oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Schema' +``` + +Therefore `#/definitions/Reference` can be merged into `#/definitions/Schema` to simplify usages: + +```yaml +$ref: '#/definitions/Schema' +``` + +Validation difference after this change is that additional unknown properties are no longer accepted for References. +Such data would become invalid: + +```json +{"$ref": "#", "unknown": 1} +``` diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 280b88e177..2fd59e2a97 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -134,9 +134,7 @@ definitions: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - oneOf: - - $ref: '#/definitions/Reference' - - $ref: '#/definitions/Schema' + $ref: '#/definitions/Schema' responses: type: object patternProperties: @@ -264,41 +262,28 @@ definitions: - object - string not: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' allOf: type: array items: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' oneOf: type: array items: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' anyOf: type: array items: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' items: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' properties: type: object additionalProperties: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' additionalProperties: oneOf: - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' - type: boolean default: true description: @@ -326,6 +311,9 @@ definitions: xml: $ref: '#/definitions/XML' patternProperties: + '^\$ref$': + type: string + format: uri-reference '^x-': {} additionalProperties: false @@ -397,9 +385,7 @@ definitions: type: object properties: schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' example: {} encoding: type: object @@ -415,9 +401,7 @@ definitions: - examples properties: schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' examples: type: object additionalProperties: @@ -484,9 +468,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' example: {} patternProperties: '^x-': {} @@ -520,9 +502,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' examples: type: object additionalProperties: @@ -767,9 +747,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' example: {} patternProperties: '^x-': {} @@ -813,9 +791,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' example: {} patternProperties: '^x-': {} @@ -856,9 +832,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' example: {} patternProperties: '^x-': {} @@ -899,9 +873,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' example: {} patternProperties: '^x-': {} @@ -954,9 +926,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' examples: type: object additionalProperties: @@ -1006,9 +976,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' examples: type: object additionalProperties: @@ -1055,9 +1023,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' examples: type: object additionalProperties: @@ -1104,9 +1070,7 @@ definitions: type: boolean default: false schema: - oneOf: - - $ref: '#/definitions/Schema' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Schema' examples: type: object additionalProperties: From bedcc1790b2838d8e23f035c25bba6e088dbdb59 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 8 Jan 2019 11:23:51 +0100 Subject: [PATCH 20/31] Combine HTTP Methods in `patternProperties` --- schemas/v3.0/README.md | 7 +++++++ schemas/v3.0/schema.yaml | 18 ++---------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md index e38570a4c6..14c97d0ab1 100644 --- a/schemas/v3.0/README.md +++ b/schemas/v3.0/README.md @@ -22,3 +22,10 @@ Such data would become invalid: ```json {"$ref": "#", "unknown": 1} ``` + +## Combine HTTP Methods in `patternProperties` + +```yaml +patternProperties: + '^(get|put|post|delete|options|head|patch|trace)$': $ref: '#/definitions/Operation' +``` diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 2fd59e2a97..f0be4d9d1c 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -556,22 +556,6 @@ definitions: type: string description: type: string - get: - $ref: '#/definitions/Operation' - put: - $ref: '#/definitions/Operation' - post: - $ref: '#/definitions/Operation' - delete: - $ref: '#/definitions/Operation' - options: - $ref: '#/definitions/Operation' - head: - $ref: '#/definitions/Operation' - patch: - $ref: '#/definitions/Operation' - trace: - $ref: '#/definitions/Operation' servers: type: array items: @@ -584,6 +568,8 @@ definitions: - $ref: '#/definitions/Reference' uniqueItems: true patternProperties: + '^(get|put|post|delete|options|head|patch|trace)$': + $ref: '#/definitions/Operation' '^x-': {} additionalProperties: false From 9592b1f9bd36bfbf3a6e85db6810db17913115d1 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 8 Jan 2019 12:20:05 +0100 Subject: [PATCH 21/31] Define Parameter as a filtered superset --- schemas/v3.0/README.md | 14 ++ schemas/v3.0/schema.yaml | 503 +++++++-------------------------------- 2 files changed, 97 insertions(+), 420 deletions(-) diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md index 14c97d0ab1..7742c760c4 100644 --- a/schemas/v3.0/README.md +++ b/schemas/v3.0/README.md @@ -29,3 +29,17 @@ Such data would become invalid: patternProperties: '^(get|put|post|delete|options|head|patch|trace)$': $ref: '#/definitions/Operation' ``` + +## Define Parameter as a filtered superset + +In order to avoid massive duplication all possible properties can be defined in a superset. +Custom rules of exclusiveness can be further defined as a list of traits in `allOf`. + +For example such structure does not allow having `example` and `examples` in same object: +```yaml +not: + required: + - example + - examples +``` + diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index f0be4d9d1c..2387f52475 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -678,165 +678,12 @@ definitions: additionalProperties: false Parameter: - oneOf: - - $ref: '#/definitions/ParameterWithSchema' - - $ref: '#/definitions/ParameterWithContent' - - ParameterWithSchema: - oneOf: - - $ref: '#/definitions/ParameterWithSchemaWithExample' - - $ref: '#/definitions/ParameterWithSchemaWithExamples' - - ParameterWithSchemaWithExample: - oneOf: - - $ref: '#/definitions/ParameterWithSchemaWithExampleInPath' - - $ref: '#/definitions/ParameterWithSchemaWithExampleInQuery' - - $ref: '#/definitions/ParameterWithSchemaWithExampleInHeader' - - $ref: '#/definitions/ParameterWithSchemaWithExampleInCookie' - - ParameterWithSchemaWithExampleInPath: - type: object - required: - - name - - in - - schema - - required - properties: - name: - type: string - in: - type: string - enum: - - path - description: - type: string - required: - type: boolean - enum: - - true - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - style: - type: string - enum: - - matrix - - label - - simple - default: simple - explode: - type: boolean - allowReserved: - type: boolean - default: false - schema: - $ref: '#/definitions/Schema' - example: {} - patternProperties: - '^x-': {} - additionalProperties: false - - ParameterWithSchemaWithExampleInQuery: - type: object - required: - - name - - in - - schema - properties: - name: - type: string - in: - type: string - enum: - - query - description: - type: string - required: - type: boolean - default: false - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - style: - type: string - enum: - - form - - spaceDelimited - - pipeDelimited - - deepObject - default: form - explode: - type: boolean - allowReserved: - type: boolean - default: false - schema: - $ref: '#/definitions/Schema' - example: {} - patternProperties: - '^x-': {} - additionalProperties: false - - ParameterWithSchemaWithExampleInHeader: - type: object - required: - - name - - in - - schema - properties: - name: - type: string - in: - type: string - enum: - - header - description: - type: string - required: - type: boolean - default: false - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - style: - type: string - enum: - - simple - default: simple - explode: - type: boolean - allowReserved: - type: boolean - default: false - schema: - $ref: '#/definitions/Schema' - example: {} - patternProperties: - '^x-': {} - additionalProperties: false - - ParameterWithSchemaWithExampleInCookie: type: object - required: - - name - - in - - schema properties: name: type: string in: type: string - enum: - - cookie description: type: string required: @@ -850,62 +697,6 @@ definitions: default: false style: type: string - enum: - - form - default: form - explode: - type: boolean - allowReserved: - type: boolean - default: false - schema: - $ref: '#/definitions/Schema' - example: {} - patternProperties: - '^x-': {} - additionalProperties: false - - ParameterWithSchemaWithExamples: - oneOf: - - $ref: '#/definitions/ParameterWithSchemaWithExamplesInPath' - - $ref: '#/definitions/ParameterWithSchemaWithExamplesInQuery' - - $ref: '#/definitions/ParameterWithSchemaWithExamplesInHeader' - - $ref: '#/definitions/ParameterWithSchemaWithExamplesInCookie' - - ParameterWithSchemaWithExamplesInPath: - type: object - required: - - name - - in - - schema - - required - - examples - properties: - name: - type: string - in: - type: string - enum: - - path - description: - type: string - required: - type: boolean - enum: - - true - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - style: - type: string - enum: - - matrix - - label - - simple - default: simple explode: type: boolean allowReserved: @@ -913,56 +704,13 @@ definitions: default: false schema: $ref: '#/definitions/Schema' - examples: + content: type: object additionalProperties: - oneOf: - - $ref: '#/definitions/Example' - - $ref: '#/definitions/Reference' - patternProperties: - '^x-': {} - additionalProperties: false - - ParameterWithSchemaWithExamplesInQuery: - type: object - required: - - name - - in - - schema - - examples - properties: - name: - type: string - in: - type: string - enum: - - query - description: - type: string - required: - type: boolean - default: false - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - style: - type: string - enum: - - form - - spaceDelimited - - pipeDelimited - - deepObject - default: form - explode: - type: boolean - allowReserved: - type: boolean - default: false - schema: - $ref: '#/definitions/Schema' + $ref: '#/definitions/MediaType' + minProperties: 1 + maxProperties: 1 + example: {} examples: type: object additionalProperties: @@ -972,176 +720,91 @@ definitions: patternProperties: '^x-': {} additionalProperties: false - - ParameterWithSchemaWithExamplesInHeader: - type: object required: - name - in - - schema - - examples - properties: - name: - type: string - in: - type: string - enum: - - header - description: - type: string - required: - type: boolean - default: false - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - style: - type: string - enum: - - simple - default: simple - explode: - type: boolean - allowReserved: - type: boolean - default: false - schema: - $ref: '#/definitions/Schema' - examples: - type: object - additionalProperties: - oneOf: - - $ref: '#/definitions/Example' - - $ref: '#/definitions/Reference' - patternProperties: - '^x-': {} - additionalProperties: false + allOf: + - description: Example and examples are mutually exclusive + not: + required: + - example + - examples - ParameterWithSchemaWithExamplesInCookie: - type: object - required: - - name - - in - - schema - - examples - properties: - name: - type: string - in: - type: string - enum: - - cookie - description: - type: string - required: - type: boolean - default: false - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - style: - type: string - enum: - - form - default: form - explode: - type: boolean - allowReserved: - type: boolean - default: false - schema: - $ref: '#/definitions/Schema' - examples: - type: object - additionalProperties: - oneOf: - - $ref: '#/definitions/Example' - - $ref: '#/definitions/Reference' - patternProperties: - '^x-': {} - additionalProperties: false + - description: Schema and content are mutually exclusive, at least one is required + not: + required: [schema, content] + oneOf: + - required: [schema] + - required: [content] + description: Some properties are not allowed if content is present + allOf: + - not: + required: [style] + - not: + required: [explode] + - not: + required: [allowReserved] + - not: + required: [example] + - not: + required: [examples] - ParameterWithContent: - oneOf: - - $ref: '#/definitions/ParameterWithContentInPath' - - $ref: '#/definitions/ParameterWithContentNotInPath' - ParameterWithContentInPath: - type: object - required: - - name - - in - - content - properties: - name: - type: string - in: - type: string - enum: - - path - description: - type: string - required: - type: boolean - enum: - - true - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - content: - type: object - additionalProperties: - $ref: '#/definitions/MediaType' - minProperties: 1 - maxProperties: 1 - patternProperties: - '^x-': {} - additionalProperties: false + - description: Parameter location + oneOf: + - description: Parameter in path + required: + - required + properties: + in: + enum: + - path + style: + enum: + - matrix + - label + - simple + default: simple + required: + enum: + - true - ParameterWithContentNotInPath: - type: object - required: - - name - - in - - content - properties: - name: - type: string - in: - type: string - enum: - - query - - header - - cookie - description: - type: string - required: - type: boolean - default: false - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - content: - type: object - additionalProperties: - $ref: '#/definitions/MediaType' - minProperties: 1 - maxProperties: 1 - patternProperties: - '^x-': {} - additionalProperties: false + + - description: Parameter in query + properties: + in: + enum: + - query + style: + enum: + - form + - spaceDelimited + - pipeDelimited + - deepObject + default: form + + + - description: Parameter in header + properties: + in: + enum: + - header + style: + enum: + - simple + default: simple + + + + - description: Parameter in cookie + properties: + in: + enum: + - header + style: + enum: + - form + default: form RequestBody: type: object From 81e3dd5a5de42aacbb8f7506068173d412b6a910 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 8 Jan 2019 13:08:19 +0100 Subject: [PATCH 22/31] Combine some definitions as filtered supersets --- schemas/v3.0/README.md | 3 + schemas/v3.0/schema.yaml | 180 ++++++++++++++------------------------- 2 files changed, 69 insertions(+), 114 deletions(-) diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md index 7742c760c4..50201fbaf6 100644 --- a/schemas/v3.0/README.md +++ b/schemas/v3.0/README.md @@ -43,3 +43,6 @@ not: - examples ``` +## Combine some definitions as filtered supersets + +With same pattern as for Parameter. \ No newline at end of file diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 2387f52475..06670ff1e9 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -377,31 +377,11 @@ definitions: additionalProperties: false MediaType: - oneOf: - - $ref: '#/definitions/MediaTypeWithExample' - - $ref: '#/definitions/MediaTypeWithExamples' - - MediaTypeWithExample: type: object properties: schema: $ref: '#/definitions/Schema' example: {} - encoding: - type: object - additionalProperties: - $ref: '#/definitions/Encoding' - patternProperties: - '^x-': {} - additionalProperties: false - - MediaTypeWithExamples: - type: object - required: - - examples - properties: - schema: - $ref: '#/definitions/Schema' examples: type: object additionalProperties: @@ -415,6 +395,9 @@ definitions: patternProperties: '^x-': {} additionalProperties: false + not: + description: Example and examples are mutually exclusive + required: [example, examples] Example: type: object @@ -432,19 +415,7 @@ definitions: additionalProperties: false Header: - oneOf: - - $ref: '#/definitions/HeaderWithSchema' - - $ref: '#/definitions/HeaderWithContent' - - HeaderWithSchema: - oneOf: - - $ref: '#/definitions/HeaderWithSchemaWithExample' - - $ref: '#/definitions/HeaderWithSchemaWithExamples' - - HeaderWithSchemaWithExample: type: object - required: - - schema properties: description: type: string @@ -469,40 +440,13 @@ definitions: default: false schema: $ref: '#/definitions/Schema' + content: + type: object + additionalProperties: + $ref: '#/definitions/MediaType' + minProperties: 1 + maxProperties: 1 example: {} - patternProperties: - '^x-': {} - additionalProperties: false - - HeaderWithSchemaWithExamples: - type: object - required: - - schema - - examples - properties: - description: - type: string - required: - type: boolean - default: false - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - style: - type: string - enum: - - simple - default: simple - explode: - type: boolean - allowReserved: - type: boolean - default: false - schema: - $ref: '#/definitions/Schema' examples: type: object additionalProperties: @@ -512,32 +456,29 @@ definitions: patternProperties: '^x-': {} additionalProperties: false + allOf: + - description: Example and examples are mutually exclusive + not: + required: [example, examples] - HeaderWithContent: - type: object - required: - - content - properties: - description: - type: string - required: - type: boolean - default: false - deprecated: - type: boolean - default: false - allowEmptyValue: - type: boolean - default: false - content: - type: object - additionalProperties: - $ref: '#/definitions/MediaType' - minProperties: 1 - maxProperties: 1 - patternProperties: - '^x-': {} - additionalProperties: false + - description: Schema and content are mutually exclusive, at least one is required + not: + required: [schema, content] + oneOf: + - required: [schema] + - description: Content does not allow some properties + required: [content] + allOf: + - not: + required: [style] + - not: + required: [explode] + - not: + required: [allowReserved] + - not: + required: [example] + - not: + required: [examples] Paths: type: object @@ -857,9 +798,37 @@ definitions: additionalProperties: false HTTPSecurityScheme: + type: object + required: + - scheme + - type + properties: + scheme: + type: string + bearerFormat: + type: string + description: + type: string + type: + type: string + enum: + - http + patternProperties: + '^x-': {} + additionalProperties: false oneOf: - - $ref: '#/definitions/NonBearerHTTPSecurityScheme' - - $ref: '#/definitions/BearerHTTPSecurityScheme' + - description: Bearer + properties: + scheme: + enum: [bearer] + + - description: Non Bearer + not: + required: [bearerFormat] + properties: + scheme: + not: + enum: [bearer] NonBearerHTTPSecurityScheme: type: object @@ -1038,13 +1007,10 @@ definitions: additionalProperties: false Link: - oneOf: - - $ref: '#/definitions/LinkWithOperationRef' - - $ref: '#/definitions/LinkWithOperationId' - - LinkWithOperationRef: type: object properties: + operationId: + type: string operationRef: type: string format: uri-reference @@ -1059,23 +1025,9 @@ definitions: patternProperties: '^x-': {} additionalProperties: false - - LinkWithOperationId: - type: object - properties: - operationId: - type: string - parameters: - type: object - additionalProperties: {} - requestBody: {} - description: - type: string - server: - $ref: '#/definitions/Server' - patternProperties: - '^x-': {} - additionalProperties: false + not: + description: Operation Id and Operation Ref are mutually exclusive + required: [operationId, operationRef] Callback: type: object From cdd7816035a32c7ca9066fcdede2a247979062c1 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 8 Jan 2019 15:43:58 +0100 Subject: [PATCH 23/31] Move XOR logic to definitions, remove unused definition NonBearerHTTPSecurityScheme --- schemas/v3.0/schema.yaml | 212 +++++++++++++-------------------------- 1 file changed, 67 insertions(+), 145 deletions(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 06670ff1e9..3fa69f705c 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -395,9 +395,8 @@ definitions: patternProperties: '^x-': {} additionalProperties: false - not: - description: Example and examples are mutually exclusive - required: [example, examples] + allOf: + - $ref: '#/definitions/ExampleXORExamples' Example: type: object @@ -457,28 +456,8 @@ definitions: '^x-': {} additionalProperties: false allOf: - - description: Example and examples are mutually exclusive - not: - required: [example, examples] - - - description: Schema and content are mutually exclusive, at least one is required - not: - required: [schema, content] - oneOf: - - required: [schema] - - description: Content does not allow some properties - required: [content] - allOf: - - not: - required: [style] - - not: - required: [explode] - - not: - required: [allowReserved] - - not: - required: [example] - - not: - required: [examples] + - $ref: '#/definitions/ExampleXORExamples' + - $ref: '#/definitions/SchemaXORContent' Paths: type: object @@ -618,6 +597,31 @@ definitions: '^x-': {} additionalProperties: false + ExampleXORExamples: + description: Example and examples are mutually exclusive + not: + required: [example, examples] + + SchemaXORContent: + description: Schema and content are mutually exclusive, at least one is required + not: + required: [schema, content] + oneOf: + - required: [schema] + - required: [content] + description: Some properties are not allowed if content is present + allOf: + - not: + required: [style] + - not: + required: [explode] + - not: + required: [allowReserved] + - not: + required: [example] + - not: + required: [examples] + Parameter: type: object properties: @@ -665,87 +669,48 @@ definitions: - name - in allOf: - - description: Example and examples are mutually exclusive - not: - required: - - example - - examples - - - description: Schema and content are mutually exclusive, at least one is required - not: - required: [schema, content] - oneOf: - - required: [schema] - - required: [content] - description: Some properties are not allowed if content is present - allOf: - - not: - required: [style] - - not: - required: [explode] - - not: - required: [allowReserved] - - not: - required: [example] - - not: - required: [examples] - - - - description: Parameter location - oneOf: - - description: Parameter in path - required: - - required - properties: - in: - enum: - - path - style: - enum: - - matrix - - label - - simple - default: simple - required: - enum: - - true - + - $ref: '#/definitions/ExampleXORExamples' + - $ref: '#/definitions/SchemaXORContent' + - $ref: '#/definitions/ParameterLocation' - - description: Parameter in query - properties: - in: - enum: - - query - style: - enum: - - form - - spaceDelimited - - pipeDelimited - - deepObject - default: form - - - - description: Parameter in header - properties: - in: - enum: - - header - style: - enum: - - simple - default: simple + ParameterLocation: + description: Parameter location + oneOf: + - description: Parameter in path + required: + - required + properties: + in: + enum: [path] + style: + enum: [matrix, label, simple] + default: simple + required: + enum: [true] + - description: Parameter in query + properties: + in: + enum: [query] + style: + enum: [form, spaceDelimited, pipeDelimited, deepObject] + default: form + - description: Parameter in header + properties: + in: + enum: [header] + style: + enum: [simple] + default: simple - - description: Parameter in cookie - properties: - in: - enum: - - header - style: - enum: - - form - default: form + - description: Parameter in cookie + properties: + in: + enum: [cookie] + style: + enum: [form] + default: form RequestBody: type: object @@ -830,49 +795,6 @@ definitions: not: enum: [bearer] - NonBearerHTTPSecurityScheme: - type: object - required: - - scheme - - type - properties: - scheme: - type: string - not: - enum: - - bearer - description: - type: string - type: - type: string - enum: - - http - patternProperties: - '^x-': {} - additionalProperties: false - - BearerHTTPSecurityScheme: - type: object - required: - - type - - scheme - properties: - scheme: - type: string - enum: - - bearer - bearerFormat: - type: string - type: - type: string - enum: - - http - description: - type: string - patternProperties: - '^x-': {} - additionalProperties: false - OAuth2SecurityScheme: type: object required: From 2208e0876716e12483aebc2c5b8c3348f6613d0a Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 8 Jan 2019 13:28:27 +0100 Subject: [PATCH 24/31] Embed references --- schemas/v3.0/README.md | 7 ++- schemas/v3.0/schema.yaml | 105 ++++++++++++++++----------------------- 2 files changed, 50 insertions(+), 62 deletions(-) diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md index 50201fbaf6..81a5d0abab 100644 --- a/schemas/v3.0/README.md +++ b/schemas/v3.0/README.md @@ -45,4 +45,9 @@ not: ## Combine some definitions as filtered supersets -With same pattern as for Parameter. \ No newline at end of file +With same pattern as for Parameter. + +## Embed references + +In order to simplify `oneOf` logic, many references can be embedded in respective definitions +(with same pattern as for Schema or Reference). \ No newline at end of file diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 3fa69f705c..63c101f2bf 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -32,14 +32,18 @@ patternProperties: '^x-': {} additionalProperties: false definitions: + RefProperty: + type: string + format: uri-reference + Reference: type: object required: - $ref patternProperties: '^\$ref$': - type: string - format: uri-reference + $ref: '#/definitions/RefProperty' + Info: type: object required: @@ -139,37 +143,27 @@ definitions: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - oneOf: - - $ref: '#/definitions/Reference' - - $ref: '#/definitions/Response' + $ref: '#/definitions/Response' parameters: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - oneOf: - - $ref: '#/definitions/Reference' - - $ref: '#/definitions/Parameter' + $ref: '#/definitions/Parameter' examples: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - oneOf: - - $ref: '#/definitions/Reference' - - $ref: '#/definitions/Example' + $ref: '#/definitions/Example' requestBodies: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - oneOf: - - $ref: '#/definitions/Reference' - - $ref: '#/definitions/RequestBody' + $ref: '#/definitions/RequestBody' headers: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - oneOf: - - $ref: '#/definitions/Reference' - - $ref: '#/definitions/Header' + $ref: '#/definitions/Header' securitySchemes: type: object patternProperties: @@ -181,16 +175,12 @@ definitions: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - oneOf: - - $ref: '#/definitions/Reference' - - $ref: '#/definitions/Link' + $ref: '#/definitions/Link' callbacks: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - oneOf: - - $ref: '#/definitions/Reference' - - $ref: '#/definitions/Callback' + $ref: '#/definitions/Callback' patternProperties: '^x-': {} additionalProperties: false @@ -359,9 +349,7 @@ definitions: headers: type: object additionalProperties: - oneOf: - - $ref: '#/definitions/Header' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Header' content: type: object additionalProperties: @@ -369,10 +357,10 @@ definitions: links: type: object additionalProperties: - oneOf: - - $ref: '#/definitions/Link' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Link' patternProperties: + '^\$ref$': + $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false @@ -385,9 +373,7 @@ definitions: examples: type: object additionalProperties: - oneOf: - - $ref: '#/definitions/Example' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Example' encoding: type: object additionalProperties: @@ -410,6 +396,8 @@ definitions: type: string format: uri-reference patternProperties: + '^\$ref$': + $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false @@ -449,10 +437,10 @@ definitions: examples: type: object additionalProperties: - oneOf: - - $ref: '#/definitions/Example' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Example' patternProperties: + '^\$ref$': + $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false allOf: @@ -483,9 +471,7 @@ definitions: parameters: type: array items: - oneOf: - - $ref: '#/definitions/Parameter' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Parameter' uniqueItems: true patternProperties: '^(get|put|post|delete|options|head|patch|trace)$': @@ -513,22 +499,16 @@ definitions: parameters: type: array items: - oneOf: - - $ref: '#/definitions/Parameter' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Parameter' uniqueItems: true requestBody: - oneOf: - - $ref: '#/definitions/RequestBody' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/RequestBody' responses: $ref: '#/definitions/Responses' callbacks: type: object additionalProperties: - oneOf: - - $ref: '#/definitions/Callback' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Callback' deprecated: type: boolean default: false @@ -548,14 +528,10 @@ definitions: type: object properties: default: - oneOf: - - $ref: '#/definitions/Response' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Response' patternProperties: '^[1-5](?:\d{2}|XX)$': - oneOf: - - $ref: '#/definitions/Response' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Response' '^x-': {} minProperties: 1 additionalProperties: false @@ -659,15 +635,15 @@ definitions: examples: type: object additionalProperties: - oneOf: - - $ref: '#/definitions/Example' - - $ref: '#/definitions/Reference' + $ref: '#/definitions/Example' patternProperties: + '^\$ref$': + $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false - required: - - name - - in + oneOf: + - required: [$ref] + - required: [name, in] allOf: - $ref: '#/definitions/ExampleXORExamples' - $ref: '#/definitions/SchemaXORContent' @@ -714,8 +690,6 @@ definitions: RequestBody: type: object - required: - - content properties: description: type: string @@ -727,8 +701,13 @@ definitions: type: boolean default: false patternProperties: + '^\$ref$': + $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false + oneOf: + - required: ["content"] + - required: ["$ref"] SecurityScheme: oneOf: @@ -945,6 +924,8 @@ definitions: server: $ref: '#/definitions/Server' patternProperties: + '^\$ref$': + $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false not: @@ -956,6 +937,8 @@ definitions: additionalProperties: $ref: '#/definitions/PathItem' patternProperties: + '^\$ref$': + $ref: '#/definitions/RefProperty' '^x-': {} Encoding: From 3f09f4663d5e69bbe3b256667d9f245bf3a146c8 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Fri, 8 Mar 2019 12:53:56 +0100 Subject: [PATCH 25/31] Revert embed references as it flattens definition scopes and therefore affects `*Of`, `required` behavior --- schemas/v3.0/README.md | 7 +-- schemas/v3.0/schema.yaml | 105 +++++++++++++++++++++++---------------- 2 files changed, 62 insertions(+), 50 deletions(-) diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md index 81a5d0abab..50201fbaf6 100644 --- a/schemas/v3.0/README.md +++ b/schemas/v3.0/README.md @@ -45,9 +45,4 @@ not: ## Combine some definitions as filtered supersets -With same pattern as for Parameter. - -## Embed references - -In order to simplify `oneOf` logic, many references can be embedded in respective definitions -(with same pattern as for Schema or Reference). \ No newline at end of file +With same pattern as for Parameter. \ No newline at end of file diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 63c101f2bf..3fa69f705c 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -32,18 +32,14 @@ patternProperties: '^x-': {} additionalProperties: false definitions: - RefProperty: - type: string - format: uri-reference - Reference: type: object required: - $ref patternProperties: '^\$ref$': - $ref: '#/definitions/RefProperty' - + type: string + format: uri-reference Info: type: object required: @@ -143,27 +139,37 @@ definitions: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - $ref: '#/definitions/Response' + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Response' parameters: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - $ref: '#/definitions/Parameter' + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Parameter' examples: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - $ref: '#/definitions/Example' + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Example' requestBodies: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - $ref: '#/definitions/RequestBody' + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/RequestBody' headers: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - $ref: '#/definitions/Header' + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Header' securitySchemes: type: object patternProperties: @@ -175,12 +181,16 @@ definitions: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - $ref: '#/definitions/Link' + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Link' callbacks: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - $ref: '#/definitions/Callback' + oneOf: + - $ref: '#/definitions/Reference' + - $ref: '#/definitions/Callback' patternProperties: '^x-': {} additionalProperties: false @@ -349,7 +359,9 @@ definitions: headers: type: object additionalProperties: - $ref: '#/definitions/Header' + oneOf: + - $ref: '#/definitions/Header' + - $ref: '#/definitions/Reference' content: type: object additionalProperties: @@ -357,10 +369,10 @@ definitions: links: type: object additionalProperties: - $ref: '#/definitions/Link' + oneOf: + - $ref: '#/definitions/Link' + - $ref: '#/definitions/Reference' patternProperties: - '^\$ref$': - $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false @@ -373,7 +385,9 @@ definitions: examples: type: object additionalProperties: - $ref: '#/definitions/Example' + oneOf: + - $ref: '#/definitions/Example' + - $ref: '#/definitions/Reference' encoding: type: object additionalProperties: @@ -396,8 +410,6 @@ definitions: type: string format: uri-reference patternProperties: - '^\$ref$': - $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false @@ -437,10 +449,10 @@ definitions: examples: type: object additionalProperties: - $ref: '#/definitions/Example' + oneOf: + - $ref: '#/definitions/Example' + - $ref: '#/definitions/Reference' patternProperties: - '^\$ref$': - $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false allOf: @@ -471,7 +483,9 @@ definitions: parameters: type: array items: - $ref: '#/definitions/Parameter' + oneOf: + - $ref: '#/definitions/Parameter' + - $ref: '#/definitions/Reference' uniqueItems: true patternProperties: '^(get|put|post|delete|options|head|patch|trace)$': @@ -499,16 +513,22 @@ definitions: parameters: type: array items: - $ref: '#/definitions/Parameter' + oneOf: + - $ref: '#/definitions/Parameter' + - $ref: '#/definitions/Reference' uniqueItems: true requestBody: - $ref: '#/definitions/RequestBody' + oneOf: + - $ref: '#/definitions/RequestBody' + - $ref: '#/definitions/Reference' responses: $ref: '#/definitions/Responses' callbacks: type: object additionalProperties: - $ref: '#/definitions/Callback' + oneOf: + - $ref: '#/definitions/Callback' + - $ref: '#/definitions/Reference' deprecated: type: boolean default: false @@ -528,10 +548,14 @@ definitions: type: object properties: default: - $ref: '#/definitions/Response' + oneOf: + - $ref: '#/definitions/Response' + - $ref: '#/definitions/Reference' patternProperties: '^[1-5](?:\d{2}|XX)$': - $ref: '#/definitions/Response' + oneOf: + - $ref: '#/definitions/Response' + - $ref: '#/definitions/Reference' '^x-': {} minProperties: 1 additionalProperties: false @@ -635,15 +659,15 @@ definitions: examples: type: object additionalProperties: - $ref: '#/definitions/Example' + oneOf: + - $ref: '#/definitions/Example' + - $ref: '#/definitions/Reference' patternProperties: - '^\$ref$': - $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false - oneOf: - - required: [$ref] - - required: [name, in] + required: + - name + - in allOf: - $ref: '#/definitions/ExampleXORExamples' - $ref: '#/definitions/SchemaXORContent' @@ -690,6 +714,8 @@ definitions: RequestBody: type: object + required: + - content properties: description: type: string @@ -701,13 +727,8 @@ definitions: type: boolean default: false patternProperties: - '^\$ref$': - $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false - oneOf: - - required: ["content"] - - required: ["$ref"] SecurityScheme: oneOf: @@ -924,8 +945,6 @@ definitions: server: $ref: '#/definitions/Server' patternProperties: - '^\$ref$': - $ref: '#/definitions/RefProperty' '^x-': {} additionalProperties: false not: @@ -937,8 +956,6 @@ definitions: additionalProperties: $ref: '#/definitions/PathItem' patternProperties: - '^\$ref$': - $ref: '#/definitions/RefProperty' '^x-': {} Encoding: From 66659e4961ddf64323ec4350f286bf81bf7b544d Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Fri, 8 Mar 2019 12:54:19 +0100 Subject: [PATCH 26/31] Remove temporary README --- schemas/v3.0/README.md | 48 ------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 schemas/v3.0/README.md diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md deleted file mode 100644 index 50201fbaf6..0000000000 --- a/schemas/v3.0/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Minimizing schema - -## Schema or Reference - -All references to `#/definitions/Schema` are happening in such form: - -```yaml -oneOf: - - $ref: '#/definitions/Reference' - - $ref: '#/definitions/Schema' -``` - -Therefore `#/definitions/Reference` can be merged into `#/definitions/Schema` to simplify usages: - -```yaml -$ref: '#/definitions/Schema' -``` - -Validation difference after this change is that additional unknown properties are no longer accepted for References. -Such data would become invalid: - -```json -{"$ref": "#", "unknown": 1} -``` - -## Combine HTTP Methods in `patternProperties` - -```yaml -patternProperties: - '^(get|put|post|delete|options|head|patch|trace)$': $ref: '#/definitions/Operation' -``` - -## Define Parameter as a filtered superset - -In order to avoid massive duplication all possible properties can be defined in a superset. -Custom rules of exclusiveness can be further defined as a list of traits in `allOf`. - -For example such structure does not allow having `example` and `examples` in same object: -```yaml -not: - required: - - example - - examples -``` - -## Combine some definitions as filtered supersets - -With same pattern as for Parameter. \ No newline at end of file From bbd49b68bc3950a6864195dc1664816efa0d4250 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Fri, 22 Mar 2019 08:40:18 +0100 Subject: [PATCH 27/31] Revert embedding $ref in Schema --- schemas/v3.0/schema.yaml | 44 ++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 3fa69f705c..1d6f8d20e1 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -134,7 +134,9 @@ definitions: type: object patternProperties: '^[a-zA-Z0-9\.\-_]+$': - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' responses: type: object patternProperties: @@ -262,28 +264,41 @@ definitions: - object - string not: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' allOf: type: array items: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' oneOf: type: array items: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' anyOf: type: array items: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' items: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' properties: type: object additionalProperties: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' additionalProperties: oneOf: - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' - type: boolean default: true description: @@ -311,9 +326,6 @@ definitions: xml: $ref: '#/definitions/XML' patternProperties: - '^\$ref$': - type: string - format: uri-reference '^x-': {} additionalProperties: false @@ -380,7 +392,9 @@ definitions: type: object properties: schema: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' example: {} examples: type: object @@ -438,7 +452,9 @@ definitions: type: boolean default: false schema: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' content: type: object additionalProperties: @@ -648,7 +664,9 @@ definitions: type: boolean default: false schema: - $ref: '#/definitions/Schema' + oneOf: + - $ref: '#/definitions/Schema' + - $ref: '#/definitions/Reference' content: type: object additionalProperties: From 92e15eba1d4591ebfe8c11898c48241e72854381 Mon Sep 17 00:00:00 2001 From: Ron Date: Tue, 2 Apr 2019 13:53:10 -0600 Subject: [PATCH 28/31] Add schema metadata Added `id`, `$schema`, `description` --- schemas/v3.0/schema.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/schemas/v3.0/schema.yaml b/schemas/v3.0/schema.yaml index 1d6f8d20e1..13e47ff08d 100644 --- a/schemas/v3.0/schema.yaml +++ b/schemas/v3.0/schema.yaml @@ -1,3 +1,6 @@ +id: https://spec.openapis.org/oas/3.0/schema/2019-04-02 +$schema: http://json-schema.org/draft-04/schema# +description: Validation schema for OpenAPI Specification 3.0.X. type: object required: - openapi From 6d17b631fff35186c495b9e7d340222e19d60a71 Mon Sep 17 00:00:00 2001 From: Ron Date: Thu, 18 Apr 2019 17:34:51 +0300 Subject: [PATCH 29/31] JSON version of the schema --- schemas/v3.0/schema.json | 1654 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 1654 insertions(+) create mode 100644 schemas/v3.0/schema.json diff --git a/schemas/v3.0/schema.json b/schemas/v3.0/schema.json new file mode 100644 index 0000000000..71808402f6 --- /dev/null +++ b/schemas/v3.0/schema.json @@ -0,0 +1,1654 @@ +{ + "id": "https://spec.openapis.org/oas/3.0/schema/2019-04-02", + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Validation schema for OpenAPI Specification 3.0.X.", + "type": "object", + "required": [ + "openapi", + "info", + "paths" + ], + "properties": { + "openapi": { + "type": "string", + "pattern": "^3\\.0\\.\\d(-.+)?$" + }, + "info": { + "$ref": "#/definitions/Info" + }, + "externalDocs": { + "$ref": "#/definitions/ExternalDocumentation" + }, + "servers": { + "type": "array", + "items": { + "$ref": "#/definitions/Server" + } + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + }, + "uniqueItems": true + }, + "paths": { + "$ref": "#/definitions/Paths" + }, + "components": { + "$ref": "#/definitions/Components" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "definitions": { + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "Info": { + "type": "object", + "required": [ + "title", + "version" + ], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "termsOfService": { + "type": "string", + "format": "uri-reference" + }, + "contact": { + "$ref": "#/definitions/Contact" + }, + "license": { + "$ref": "#/definitions/License" + }, + "version": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Contact": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + }, + "email": { + "type": "string", + "format": "email" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "License": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Server": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ServerVariable" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ServerVariable": { + "type": "object", + "required": [ + "default" + ], + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Components": { + "type": "object", + "properties": { + "schemas": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + } + }, + "responses": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Response" + } + ] + } + } + }, + "parameters": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Parameter" + } + ] + } + } + }, + "examples": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Example" + } + ] + } + } + }, + "requestBodies": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/RequestBody" + } + ] + } + } + }, + "headers": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Header" + } + ] + } + } + }, + "securitySchemes": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "links": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Link" + } + ] + } + } + }, + "callbacks": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Callback" + } + ] + } + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": { + }, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": { + }, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": { + }, + "externalDocs": { + "$ref": "#/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/XML" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Response": { + "type": "object", + "required": [ + "description" + ], + "properties": { + "description": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Header" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "content": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MediaType" + } + }, + "links": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Link" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "MediaType": { + "type": "object", + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "example": { + }, + "examples": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Example" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "encoding": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Encoding" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "allOf": [ + { + "$ref": "#/definitions/ExampleXORExamples" + } + ] + }, + "Example": { + "type": "object", + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "value": { + }, + "externalValue": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Header": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "required": { + "type": "boolean", + "default": false + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "allowEmptyValue": { + "type": "boolean", + "default": false + }, + "style": { + "type": "string", + "enum": [ + "simple" + ], + "default": "simple" + }, + "explode": { + "type": "boolean" + }, + "allowReserved": { + "type": "boolean", + "default": false + }, + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "content": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MediaType" + }, + "minProperties": 1, + "maxProperties": 1 + }, + "example": { + }, + "examples": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Example" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "allOf": [ + { + "$ref": "#/definitions/ExampleXORExamples" + }, + { + "$ref": "#/definitions/SchemaXORContent" + } + ] + }, + "Paths": { + "type": "object", + "patternProperties": { + "^\\/": { + "$ref": "#/definitions/PathItem" + }, + "^x-": { + } + }, + "additionalProperties": false + }, + "PathItem": { + "type": "object", + "properties": { + "$ref": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "servers": { + "type": "array", + "items": { + "$ref": "#/definitions/Server" + } + }, + "parameters": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Parameter" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "uniqueItems": true + } + }, + "patternProperties": { + "^(get|put|post|delete|options|head|patch|trace)$": { + "$ref": "#/definitions/Operation" + }, + "^x-": { + } + }, + "additionalProperties": false + }, + "Operation": { + "type": "object", + "required": [ + "responses" + ], + "properties": { + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/ExternalDocumentation" + }, + "operationId": { + "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Parameter" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "uniqueItems": true + }, + "requestBody": { + "oneOf": [ + { + "$ref": "#/definitions/RequestBody" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "responses": { + "$ref": "#/definitions/Responses" + }, + "callbacks": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Callback" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "servers": { + "type": "array", + "items": { + "$ref": "#/definitions/Server" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Responses": { + "type": "object", + "properties": { + "default": { + "oneOf": [ + { + "$ref": "#/definitions/Response" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "patternProperties": { + "^[1-5](?:\\d{2}|XX)$": { + "oneOf": [ + { + "$ref": "#/definitions/Response" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "^x-": { + } + }, + "minProperties": 1, + "additionalProperties": false + }, + "SecurityRequirement": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/ExternalDocumentation" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ExampleXORExamples": { + "description": "Example and examples are mutually exclusive", + "not": { + "required": [ + "example", + "examples" + ] + } + }, + "SchemaXORContent": { + "description": "Schema and content are mutually exclusive, at least one is required", + "not": { + "required": [ + "schema", + "content" + ] + }, + "oneOf": [ + { + "required": [ + "schema" + ] + }, + { + "required": [ + "content" + ], + "description": "Some properties are not allowed if content is present", + "allOf": [ + { + "not": { + "required": [ + "style" + ] + } + }, + { + "not": { + "required": [ + "explode" + ] + } + }, + { + "not": { + "required": [ + "allowReserved" + ] + } + }, + { + "not": { + "required": [ + "example" + ] + } + }, + { + "not": { + "required": [ + "examples" + ] + } + } + ] + } + ] + }, + "Parameter": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "in": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "boolean", + "default": false + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "allowEmptyValue": { + "type": "boolean", + "default": false + }, + "style": { + "type": "string" + }, + "explode": { + "type": "boolean" + }, + "allowReserved": { + "type": "boolean", + "default": false + }, + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "content": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MediaType" + }, + "minProperties": 1, + "maxProperties": 1 + }, + "example": { + }, + "examples": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Example" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "required": [ + "name", + "in" + ], + "allOf": [ + { + "$ref": "#/definitions/ExampleXORExamples" + }, + { + "$ref": "#/definitions/SchemaXORContent" + }, + { + "$ref": "#/definitions/ParameterLocation" + } + ] + }, + "ParameterLocation": { + "description": "Parameter location", + "oneOf": [ + { + "description": "Parameter in path", + "required": [ + "required" + ], + "properties": { + "in": { + "enum": [ + "path" + ] + }, + "style": { + "enum": [ + "matrix", + "label", + "simple" + ], + "default": "simple" + }, + "required": { + "enum": [ + true + ] + } + } + }, + { + "description": "Parameter in query", + "properties": { + "in": { + "enum": [ + "query" + ] + }, + "style": { + "enum": [ + "form", + "spaceDelimited", + "pipeDelimited", + "deepObject" + ], + "default": "form" + } + } + }, + { + "description": "Parameter in header", + "properties": { + "in": { + "enum": [ + "header" + ] + }, + "style": { + "enum": [ + "simple" + ], + "default": "simple" + } + } + }, + { + "description": "Parameter in cookie", + "properties": { + "in": { + "enum": [ + "cookie" + ] + }, + "style": { + "enum": [ + "form" + ], + "default": "form" + } + } + } + ] + }, + "RequestBody": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "description": { + "type": "string" + }, + "content": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MediaType" + } + }, + "required": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "SecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/APIKeySecurityScheme" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/OAuth2SecurityScheme" + }, + { + "$ref": "#/definitions/OpenIdConnectSecurityScheme" + } + ] + }, + "APIKeySecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ] + }, + "name": { + "type": "string" + }, + "in": { + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string" + }, + "bearerFormat": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "oneOf": [ + { + "description": "Bearer", + "properties": { + "scheme": { + "enum": [ + "bearer" + ] + } + } + }, + { + "description": "Non Bearer", + "not": { + "required": [ + "bearerFormat" + ] + }, + "properties": { + "scheme": { + "not": { + "enum": [ + "bearer" + ] + } + } + } + } + ] + }, + "OAuth2SecurityScheme": { + "type": "object", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth2" + ] + }, + "flows": { + "$ref": "#/definitions/OAuthFlows" + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "OpenIdConnectSecurityScheme": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri-reference" + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "OAuthFlows": { + "type": "object", + "properties": { + "implicit": { + "$ref": "#/definitions/ImplicitOAuthFlow" + }, + "password": { + "$ref": "#/definitions/PasswordOAuthFlow" + }, + "clientCredentials": { + "$ref": "#/definitions/ClientCredentialsFlow" + }, + "authorizationCode": { + "$ref": "#/definitions/AuthorizationCodeOAuthFlow" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ImplicitOAuthFlow": { + "type": "object", + "required": [ + "authorizationUrl", + "scopes" + ], + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri-reference" + }, + "refreshUrl": { + "type": "string", + "format": "uri-reference" + }, + "scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "PasswordOAuthFlow": { + "type": "object", + "required": [ + "tokenUrl" + ], + "properties": { + "tokenUrl": { + "type": "string", + "format": "uri-reference" + }, + "refreshUrl": { + "type": "string", + "format": "uri-reference" + }, + "scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ClientCredentialsFlow": { + "type": "object", + "required": [ + "tokenUrl" + ], + "properties": { + "tokenUrl": { + "type": "string", + "format": "uri-reference" + }, + "refreshUrl": { + "type": "string", + "format": "uri-reference" + }, + "scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "AuthorizationCodeOAuthFlow": { + "type": "object", + "required": [ + "authorizationUrl", + "tokenUrl" + ], + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri-reference" + }, + "tokenUrl": { + "type": "string", + "format": "uri-reference" + }, + "refreshUrl": { + "type": "string", + "format": "uri-reference" + }, + "scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Link": { + "type": "object", + "properties": { + "operationId": { + "type": "string" + }, + "operationRef": { + "type": "string", + "format": "uri-reference" + }, + "parameters": { + "type": "object", + "additionalProperties": { + } + }, + "requestBody": { + }, + "description": { + "type": "string" + }, + "server": { + "$ref": "#/definitions/Server" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "not": { + "description": "Operation Id and Operation Ref are mutually exclusive", + "required": [ + "operationId", + "operationRef" + ] + } + }, + "Callback": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/PathItem" + }, + "patternProperties": { + "^x-": { + } + } + }, + "Encoding": { + "type": "object", + "properties": { + "contentType": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Header" + } + }, + "style": { + "type": "string", + "enum": [ + "form", + "spaceDelimited", + "pipeDelimited", + "deepObject" + ] + }, + "explode": { + "type": "boolean" + }, + "allowReserved": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + } +} \ No newline at end of file From 3dcfee14286cfd0c6eb81f9a59b423c945e2cb7d Mon Sep 17 00:00:00 2001 From: Ron Date: Thu, 18 Apr 2019 17:35:12 +0300 Subject: [PATCH 30/31] Added README with basic information --- schemas/v3.0/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 schemas/v3.0/README.md diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md new file mode 100644 index 0000000000..9b52d5070a --- /dev/null +++ b/schemas/v3.0/README.md @@ -0,0 +1,16 @@ +OpenAPI 3.0.X JSON Schema +--- + +Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.0.X. + +As a reminder, the JSON Schema is not the source of truth for the Specification. In cases of conflicts between the Specification itself and the JSON Schema, the Specification wins. Also, some Specification constraints cannot be represented with the JSON Schema so it's highly recommended to employ other methods to ensure compliance. + +The iteration version of the JSON Schema can be found in the `id` field. For example, the value of `id: https://spec.openapis.org/oas/3.0/schema/2019-04-02` means this iteration was created on April 2nd, 2019. + +To submit improvements to the schema, modify the schema.yaml file only. + +The TSC will then: +- Run tests on the updates schema +- Update the iteration version +- Convert the schema.yaml to schema.json +- Publish the new version \ No newline at end of file From 35ab0143411930567c4effffbcc0625e7d125d68 Mon Sep 17 00:00:00 2001 From: Ron Date: Thu, 18 Apr 2019 17:37:16 +0300 Subject: [PATCH 31/31] Update README.md --- schemas/v3.0/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md index 9b52d5070a..84956279da 100644 --- a/schemas/v3.0/README.md +++ b/schemas/v3.0/README.md @@ -10,7 +10,7 @@ The iteration version of the JSON Schema can be found in the `id` field. For exa To submit improvements to the schema, modify the schema.yaml file only. The TSC will then: -- Run tests on the updates schema +- Run tests on the updated schema - Update the iteration version - Convert the schema.yaml to schema.json -- Publish the new version \ No newline at end of file +- Publish the new version