rapi-doc / RapiDoc

RapiDoc -WebComponent for OpenAPI Spec
https://rapidocweb.com
MIT License
1.71k stars 285 forks source link

Increasing json responses panel max size #110

Closed dagnelies closed 4 years ago

dagnelies commented 4 years ago

The code panel containing the json responses is rather small.

I suggest replacing the

.multiline {
    max-height: 200px;
}

https://github.com/mrin9/RapiDoc/blob/021dfc1bb520fb689bfa4cc7adb4c7210dc0bc0c/src/styles/font-styles.js#L27

by 2/3 of the viewport height:

.multiline {
    max-height: 66vh;
}
mrin9 commented 4 years ago

good suggestion, but you need to take into account that RapiDoc is a custom element and people can specify its width and height, therefore assuming that the entire viewport is used is little incorrect.

I am willing to work to make it little more user-friendly, one way I can think of is to expose the max-height as an attribute. Do you have any other suggestions?

dagnelies commented 4 years ago

Hi, sorry for the delay. Maybe some people do not show such doc/specs on the whole page ...maybe. But it is probably more the exception than the rule. ;)

In any case, 200px is a really low default. This is how my specs looks like: ;)

2020-01-23 14_06_32-srvtdev-elo12-1_9090_rest_doc

Alternatively, a great way of how specs could be customized is to simply allow adding a custom CSS stylesheet.

mrin9 commented 4 years ago

the screenshot you provided above, I can feel your pain. and yes, we must do something to address this.

RapiDoc isnt a website so we cannot provide a CSS Stylesheets that user can update or tweak. It is just like any other HTML element. and elements dont come with there own stylesheet.

The way we style it is with css vars I will address this issue in our next release

PS: Thanks for bringing it up

mrin9 commented 4 years ago

addressed it in release 7.1.1 set the default height to 300px added a new prop response-area-height refer https://mrin9.github.io/RapiDoc/api.html for more details