Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

response multi data model #1406

Closed
JinSung-Hwang opened this issue Nov 10, 2017 · 6 comments
Closed

response multi data model #1406

JinSung-Hwang opened this issue Nov 10, 2017 · 6 comments

Comments

@JinSung-Hwang
Copy link

JinSung-Hwang commented Nov 10, 2017

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

@MikeRalphson
Copy link
Member

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.

@vickysg0210
Copy link

Facing the same issue as well

@MikeRalphson
Copy link
Member

MikeRalphson commented Jan 24, 2018

@vickysg0210 with which tool(s)? I see you have already commented on swagger-api/swagger-ui#3803

@JinSung-Hwang
Copy link
Author

im using online swagger-editor

@shockey
Copy link

shockey commented Feb 13, 2018

@MikeRalphson, I think this can be closed, sounds like it's on us over at Swagger-UI 😄

@MikeRalphson
Copy link
Member

Thanks @shockey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants