Skip to content

Commit b1770ad

Browse files
"The discriminator object is legal only when using one of the composite keywords oneOf, anyOf, allOf."
https://spec.openapis.org/oas/v3.1.0#fixed-fields-20
1 parent 4c7d88c commit b1770ad

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

schemas/v3.1/meta/base.schema.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"mapping": {
2323
"type": "object",
2424
"additionalProperties": {
25-
"type": "string"
25+
"type": "string",
26+
"format": "uri-reference"
2627
}
2728
}
2829
},
@@ -68,6 +69,15 @@
6869
"unevaluatedProperties": false
6970
}
7071
},
72+
"dependentSchemas": {
73+
"discriminator": {
74+
"anyOf": [
75+
{ "required": [ "oneOf" ] },
76+
{ "required": [ "anyOf" ] },
77+
{ "required": [ "allOf" ] }
78+
]
79+
}
80+
},
7181
"$defs": {
7282
"extensible": {
7383
"patternProperties": {

schemas/v3.1/meta/base.schema.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ properties:
1010
mapping:
1111
additionalProperties:
1212
type: string
13+
format: uri-reference
1314
type: object
1415
propertyName:
1516
type: string
@@ -47,6 +48,12 @@ properties:
4748
type: boolean
4849
type: object
4950
unevaluatedProperties: false
51+
dependentSchemas:
52+
discriminator:
53+
anyOf:
54+
- required: [ oneOf ]
55+
- required: [ anyOf ]
56+
- required: [ allOf ]
5057
$dynamicAnchor: meta
5158
$id: https://spec.openapis.org/oas/3.1/meta/base
5259
$schema: https://json-schema.org/draft/2020-12/schema

0 commit comments

Comments
 (0)