Skip to content

Commit 84ba266

Browse files
committed
Consistent use of property name schema examples: petType vs pet_type
* Pet Schema in the MediaTypes Examples and Schema Object Examples uses the camelCase notation(petType), * While Pets from the Discriminator Object use snake_case (pet_type). It's inconsistent. I chose the camelCase notation because it's used for propertyNames by the OpenAPI specification itself.
1 parent ae0ce6b commit 84ba266

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
@@ -2707,15 +2707,15 @@ MyResponseType:
27072707
- $ref: '#/components/schemas/Dog'
27082708
- $ref: '#/components/schemas/Lizard'
27092709
discriminator:
2710-
propertyName: pet_type
2710+
propertyName: petType
27112711
```
27122712

2713-
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:
2713+
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:
27142714

27152715
```json
27162716
{
27172717
"id": 12345,
2718-
"pet_type": "Cat"
2718+
"petType": "Cat"
27192719
}
27202720
```
27212721

@@ -2731,7 +2731,7 @@ MyResponseType:
27312731
- $ref: '#/components/schemas/Lizard'
27322732
- $ref: 'https://gigantic-server.com/schemas/Monster/schema.json'
27332733
discriminator:
2734-
propertyName: pet_type
2734+
propertyName: petType
27352735
mapping:
27362736
dog: '#/components/schemas/Dog'
27372737
monster: 'https://gigantic-server.com/schemas/Monster/schema.json'
@@ -2751,12 +2751,12 @@ components:
27512751
Pet:
27522752
type: object
27532753
required:
2754-
- pet_type
2754+
- petType
27552755
properties:
2756-
pet_type:
2756+
petType:
27572757
type: string
27582758
discriminator:
2759-
propertyName: pet_type
2759+
propertyName: petType
27602760
mapping:
27612761
dog: Dog
27622762
Cat:
@@ -2789,7 +2789,7 @@ a payload like this:
27892789
27902790
```json
27912791
{
2792-
"pet_type": "Cat",
2792+
"petType": "Cat",
27932793
"name": "misty"
27942794
}
27952795
```
@@ -2798,7 +2798,7 @@ will indicate that the `Cat` schema be used. Likewise this schema:
27982798

27992799
```json
28002800
{
2801-
"pet_type": "dog",
2801+
"petType": "dog",
28022802
"bark": "soft"
28032803
}
28042804
```

0 commit comments

Comments
 (0)