Skip to content

confirm response for operation is clear #325

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

Closed
fehguy opened this issue Mar 26, 2015 · 7 comments
Closed

confirm response for operation is clear #325

fehguy opened this issue Mar 26, 2015 · 7 comments

Comments

@fehguy
Copy link
Contributor

fehguy commented Mar 26, 2015

Need to make sure the response code/schema is clear for non-200 responses.

@whitlockjc
Copy link
Contributor

Here is the code that takes responses and handles them:

https://github.com/swagger-api/swagger-js/blob/develop_2.0/lib/types/operation.js#L117

It will only create a Model object, the thing that lets you call getMockSignature and createSampleJSON and other APIs that swagger-js uses, for the default success response and the others do not result in a Model object instance. We also will need to create an API for operations to allow you to iterate over all response models and to retrieve a response model by code/name.

@fehguy fehguy self-assigned this Mar 26, 2015
@fehguy
Copy link
Contributor Author

fehguy commented Mar 27, 2015

@whitlockjc this logic looks good to me. Do we need to change any code?

@whitlockjc
Copy link
Contributor

Code would change since we'd need to create a Model for all responses, not just the one we deem to be the default success response, and we'd need APIs added to the Operation object to give access to these response Model objects.

@fehguy fehguy modified the milestones: v2.1, v2.1-M2 Mar 27, 2015
@whitlockjc
Copy link
Contributor

This is not a regression. The feature/bug that led to this was that swagger-ui wants to render rich representations for the non-default response. To be able to do this, we would need to make Model objects for all responses, not just the default, and provide an API to get access to the responses models, not just the default.

This is a new feature, not a regression.

@fehguy
Copy link
Contributor Author

fehguy commented May 7, 2015

@whitlockjc my bad for taking a while to get back to this. I believe we actually used to return rendering operations for all models inside response codes.

@whitlockjc
Copy link
Contributor

I looked into this and the release prior to my involvement didn't have this. I'll have to look back further to see how it was done and we'll get it knocked out.

@fehguy fehguy added the P2 label Jun 5, 2015
@webron webron modified the milestones: v2.1, v2.1.1 Jun 8, 2015
@webron webron modified the milestones: v2.1.1, v2.1.2 Jun 24, 2015
@webron webron modified the milestones: v2.1.2, v2.1.3 Jul 31, 2015
@webron webron modified the milestones: v2.1.3, v2.1.4 Sep 2, 2015
@fehguy fehguy removed this from the v2.1.4 milestone Nov 5, 2015
@fehguy fehguy removed this from the v2.1.4 milestone Nov 5, 2015
@fehguy fehguy added this to the future milestone Dec 10, 2015
@fehguy
Copy link
Contributor Author

fehguy commented Jan 12, 2017

This has been implemented

@fehguy fehguy closed this as completed Jan 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants