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

Represent Response with sideloading #696

Closed
frankietaylor opened this issue May 16, 2016 · 2 comments
Closed

Represent Response with sideloading #696

frankietaylor opened this issue May 16, 2016 · 2 comments

Comments

@frankietaylor
Copy link

We want to use swagger for documentation generation and also for the convenience that client code gets generated from swagger output.

We are adhering to JSON:API specification for the models. It has the concept of side-loading related models along with the main data. For example, when fetching articles models, we can ask to include corresponding authors' models for each article in a single api call.

How to represent this in Swagger?

@ePaul
Copy link
Contributor

ePaul commented May 17, 2016

Swagger/OpenAPI currently (in version 2.0) doesn't really support different result schemas depending on parameters (or on different criteria like content types or similar).

So the best you can do is to declare the model schema with the related objects included, set required: false for those properties, and explain the relation in plain text in the description (of model and/or operation).

For the next version, on which we are currently working, there are several related issues: #270, #164, #146.

@webron
Copy link
Member

webron commented May 19, 2016

Closing as replied and referenced to the relevant tickets.

@webron webron closed this as completed May 19, 2016
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

3 participants