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

Start with response list expanded #165

Closed
agallou opened this issue Dec 14, 2016 · 3 comments
Closed

Start with response list expanded #165

agallou opened this issue Dec 14, 2016 · 3 comments

Comments

@agallou
Copy link
Contributor

agallou commented Dec 14, 2016

First, thanks for Redoc, your project is very usefull to us.

When I give our client the link to our API doc, I always say something like "You must click on '200 Products Response' to display the response content". So it could be usefull to have those expanded by default.

I'm not used to developp with angular, but if it's a feature that you are ready to have on the projet, i'll try to make a PR.

So, how could such a functionnality be implemented functionnaly ?

  • an attribute when including readoc like "responses-expanded" (that expands all responses or all 2xx responses)
  • a boolean x-expanded key on the swagger spec on each response (that allows users to choose witch responses must be expanded

after that, did you have any hints on to implement that technically ? (espacilly with the lazy json-schema) (I will probably be something around here : https://github.com/Rebilly/ReDoc/blob/5bd0ac2d11d01c91fb75c8b98418b35c29e65f22/lib/components/ResponsesList/responses-list.html#L23)

@RomanHotsiy
Copy link
Member

@agallou thanks for using ReDoc and even reading its code :)

I should explain why I have hidden all the responses under the zippy. This was done due to performance limitations. For specs with huge number of endpoints response schemas generation took lot of time so I hidden it under the zippy and made lazy-rendered.

I'm OK with adding such option to ReDoc though. I vote for having ReDoc attribute against x-expanded in the spec.

I was going to provide you with a hints of how to implement this but while checking code implemented it itself: commit. It appeared to be an easy change :)

Closing this issue.
The new functionality will be available in the next release till the end of the week

@agallou
Copy link
Contributor Author

agallou commented Dec 15, 2016

👍 that's awesome. thanks for the feature.

@RomanHotsiy
Copy link
Member

new version 1.6.3 with the feature is available

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

2 participants