Move XOR logic to definitions, remove unused definition NonBearerHTTPSecurityScheme
MODIFY
schemas/v3.0/schema.yaml
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,86 +669,47 @@ definitions:
- name
- in
allOf:
- - description: Example and examples are mutually exclusive
- not:
- required:
- - example
- - examples
+ - $ref: '#/definitions/ExampleXORExamples'
+ - $ref: '#/definitions/SchemaXORContent'
+ - $ref: '#/definitions/ParameterLocation'
- - 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
+ ParameterLocation:
+ description: Parameter location
oneOf:
- description: Parameter in path
required:
- required
properties:
in:
- enum:
- - path
+ enum: [path]
style:
- enum:
- - matrix
- - label
- - simple
+ enum: [matrix, label, simple]
default: simple
required:
- enum:
- - true
-
+ enum: [true]
- description: Parameter in query
properties:
in:
- enum:
- - query
+ enum: [query]
style:
- enum:
- - form
- - spaceDelimited
- - pipeDelimited
- - deepObject
+ enum: [form, spaceDelimited, pipeDelimited, deepObject]
default: form
-
- description: Parameter in header
properties:
in:
- enum:
- - header
+ enum: [header]
style:
- enum:
- - simple
+ enum: [simple]
default: simple
-
-
- description: Parameter in cookie
properties:
in:
- enum:
- - header
+ enum: [cookie]
style:
- enum:
- - form
+ enum: [form]
default: form
RequestBody:
@@ -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:

Move XOR logic to definitions, remove unused definition NonBearerHTTPSecurityScheme