-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
Based on the specs here:
https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/
Given
paths:
/pets:
patch:
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/PetByAge'
- $ref: '#/components/schemas/PetByType'
responses:
'200':
description: Updated
components:
schemas:
PetByAge:
type: object
properties:
age:
type: integer
nickname:
type: string
required:
- age
PetByType:
type: object
properties:
pet_type:
type: string
enum: [Cat, Dog]
hunts:
type: boolean
required:
- pet_typeThe following JSON response should be valid:
{
"pet_type": "Cat",
"hunts": true
}{
"nickname": "Fido",
"pet_type": "Dog",
"age": 4
}@Dorthu would this be hard to implement? I'm trying to dive in to the code base. What do I need to do to in order to make this work?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels