Skip to content

Commit 1bdda2f

Browse files
author
Ron
authored
Merge pull request #1674 from RepreZen/v3.0.2-dev-discriminator-pet_type
Consistent use of property name in schema examples: `petType` vs `pet_type`
2 parents 43569f6 + 84ba266 commit 1bdda2f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

versions/3.0.2.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,15 +2708,15 @@ MyResponseType:
27082708
- $ref: '#/components/schemas/Dog'
27092709
- $ref: '#/components/schemas/Lizard'
27102710
discriminator:
2711-
propertyName: pet_type
2711+
propertyName: petType
27122712
```
27132713

2714-
The expectation now is that a property with name `pet_type` _MUST_ be present in the response payload, and the value will correspond to the name of a schema defined in the OAS document. Thus the response payload:
2714+
The expectation now is that a property with name `petType` _MUST_ be present in the response payload, and the value will correspond to the name of a schema defined in the OAS document. Thus the response payload:
27152715

27162716
```json
27172717
{
27182718
"id": 12345,
2719-
"pet_type": "Cat"
2719+
"petType": "Cat"
27202720
}
27212721
```
27222722

@@ -2732,7 +2732,7 @@ MyResponseType:
27322732
- $ref: '#/components/schemas/Lizard'
27332733
- $ref: 'https://gigantic-server.com/schemas/Monster/schema.json'
27342734
discriminator:
2735-
propertyName: pet_type
2735+
propertyName: petType
27362736
mapping:
27372737
dog: '#/components/schemas/Dog'
27382738
monster: 'https://gigantic-server.com/schemas/Monster/schema.json'
@@ -2752,12 +2752,12 @@ components:
27522752
Pet:
27532753
type: object
27542754
required:
2755-
- pet_type
2755+
- petType
27562756
properties:
2757-
pet_type:
2757+
petType:
27582758
type: string
27592759
discriminator:
2760-
propertyName: pet_type
2760+
propertyName: petType
27612761
mapping:
27622762
dog: Dog
27632763
Cat:
@@ -2790,7 +2790,7 @@ a payload like this:
27902790
27912791
```json
27922792
{
2793-
"pet_type": "Cat",
2793+
"petType": "Cat",
27942794
"name": "misty"
27952795
}
27962796
```
@@ -2799,7 +2799,7 @@ will indicate that the `Cat` schema be used. Likewise this schema:
27992799

28002800
```json
28012801
{
2802-
"pet_type": "dog",
2802+
"petType": "dog",
28032803
"bark": "soft"
28042804
}
28052805
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy