Skip to content

Commit ec620ed

Browse files
authored
Merge pull request OAI#1210 from OAI/issue-1121
clarified wording
2 parents d5db302 + 870405f commit ec620ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

versions/3.0.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2759,8 +2759,8 @@ components:
27592759
"Pet": {
27602760
"type": "object",
27612761
"discriminator": {
2762-
"propertyName": "petType"
2763-
},
2762+
"propertyName": "petType"
2763+
},
27642764
"properties": {
27652765
"name": {
27662766
"type": "string"
@@ -2940,7 +2940,7 @@ MyResponseType:
29402940
monster: 'https://gigantic-server.com/schemas/Monster/schema.json'
29412941
```
29422942

2943-
Here the discriminator _value_ of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `Dog`. If the discriminator _value_ does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail. Mapping keys MUST be string values, but tooling MAY map response values to strings for comparison.
2943+
Here the discriminator _value_ of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `Dog`. If the discriminator _value_ does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail. Mapping keys MUST be string values, but tooling MAY convert response values to strings for comparison.
29442944

29452945
When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity where multiple schemas may satisfy a single payload.
29462946

0 commit comments

Comments
 (0)