-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
anyOf could be encoded via tupling options
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
hunts:
type: boolean
required:
- pet_typecould be encoded like
type PetByAge =
{ age: int
nickname: string }
type PetByType =
{ pet_type: string
hunts: bool }
type ``PetByAge or PetByType`` =
{ PetByAge: PetByAge option
PetByType: PetByType option }Metadata
Metadata
Assignees
Labels
No labels