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

Document returned results #85

Closed
gcerquant opened this issue Nov 15, 2012 · 5 comments
Closed

Document returned results #85

gcerquant opened this issue Nov 15, 2012 · 5 comments

Comments

@gcerquant
Copy link

Using latest changes taken care by issue at #35, we can now see the models in Swagger-UI. That's great.

To be able to fully document an API only with swagger, it would be great to also allow to document the parameters of the JSON structure returned by the API to a specific call.

Similar to the input parameters, I'd like to document each returned element: Parameter name, Optional or Always there, Possible Values, Description of the Parameters, Data Type.

@fehguy
Copy link
Contributor

fehguy commented Nov 15, 2012

Take a look on the wiki, this should be covered by the spec.

https://github.com/wordnik/swagger-core/wiki/Datatypes

@gcerquant
Copy link
Author

Thanks for the link.

I guess all the information of the spec is presented in the response class.
On my installation of swagger (head of the repo), it's all on one line, with color alternated for each parameter.
There might be consideration that I have not thought about, but I find it much harder to read than the Parameters array, with one parameter per row.
Also, is there a reason that the Response Class is presented before the Input Parameters?

@gcerquant
Copy link
Author

Not sure if next comment would be an other issue or not. Might edit and open a new one after discussion.

I also would like to be able to document: In this case, the result will be this class, and in this case it will be an other class.

Doing this only show the response class names list, but not any details.
"responseClass": "WordList, WordList2"

@ayush
Copy link
Contributor

ayush commented Nov 16, 2012

@gcerquant its not clear to me what precisely is the issue here but here is a response to what your wrote: params are presented in one line to save on vertical space and alternated in color to make it easier on the eyeball. There is no particular reason for Response Class being before the input params, I guess we could change that. On your other question, each API can have only one response class. Swagger-ui lists all other classes referenced by the first listed class which is the primary return class.

@fehguy
Copy link
Contributor

fehguy commented Jul 7, 2013

Hi, this should be resolved in 1.3.0-RC1 of swagger-core. Please reopen if not

@fehguy fehguy closed this as completed Jul 7, 2013
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