i want to use to multi data model in response
according to spec
'OpenAPI 3.0 provides several keywords which you can use to combine schemas'
oneOf that is keyword is used to combine schemas
but OpenAPI doesn`t recognized multi data model
my openAPI code --
paths:
/pets:
patch:
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
responses:
'404':
description: not found
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
components:
schemas:
Dog:
type: object
properties:
bark:
type: boolean
breed:
type: string
enum: [Dingo, Husky, Retriever, Shepherd]
Cat:
type: object
properties:
hunts:
type: boolean
age:
type: integer
Your definition appears to be valid (excepting the missing openapi and info properties, and the lost indentation). When you say
but OpenAPI doesn`t recognized multi data model
are you referring to a particular tool? If so, you should raise the issue on the appropriate repository, this repository is for the OpenAPI specification itself only.
Facing the same issue as well
@vickysg0210 with which tool(s)? I see you have already commented on https://github.com/swagger-api/swagger-ui/issues/3803
im using online swagger-editor
@MikeRalphson, I think this can be closed, sounds like it's on us over at Swagger-UI 馃槃
Thanks @shockey