Skip to content

Commit

Permalink
"The discriminator object is legal only when using one of the composi…
Browse files Browse the repository at this point in the history
…te keywords oneOf, anyOf, allOf."

https://spec.openapis.org/oas/v3.1.0#fixed-fields-20
  • Loading branch information
karenetheridge committed Nov 26, 2021
1 parent bb2e816 commit 2172dcb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 11 additions & 1 deletion schemas/v3.1/meta/base.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"mapping": {
"type": "object",
"additionalProperties": {
"type": "string"
"type": "string",
"format": "uri-reference"
}
}
},
Expand Down Expand Up @@ -67,6 +68,15 @@
},
"unevaluatedProperties": false
},
"dependentSchemas": {
"discriminator": {
"anyOf": [
{ "required": [ "oneOf" ] },
{ "required": [ "anyOf" ] },
{ "required": [ "allOf" ] }
]
}
},
"$defs": {
"extensible": {
"patternProperties": {
Expand Down
7 changes: 7 additions & 0 deletions schemas/v3.1/meta/base.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ properties:
mapping:
additionalProperties:
type: string
format: uri-reference
type: object
propertyName:
type: string
Expand Down Expand Up @@ -47,6 +48,12 @@ properties:
type: boolean
type: object
unevaluatedProperties: false
dependentSchemas:
discriminator:
anyOf:
- required: [ oneOf ]
- required: [ anyOf ]
- required: [ allOf ]
$dynamicAnchor: meta
$id: https://spec.openapis.org/oas/3.1/meta/base
$schema: https://json-schema.org/draft/2020-12/schema
Expand Down

0 comments on commit 2172dcb

Please sign in to comment.