apicurio-studio icon indicating copy to clipboard operation
apicurio-studio copied to clipboard

How to enable the "Try it" console in Redocly in Apicurio on OpenShift.

Open zigouras opened this issue 3 years ago • 7 comments

Hi guys, sorry for jumping in with a question, but I searched this project and Google and could not find out how to do this. The Redocly docs at this link describe how to do it in the Redocly yaml file https://redoc.ly/docs/api-reference-docs/console-overview/#enable-the-try-it-api-console but I am not sure how to do it in a Docker/k8s installation. I don't see any environmental variables that would apply. Thanks in advance for any help.

zigouras avatar May 26 '21 19:05 zigouras

Good question. It's nice to know if there is a way to enable "Try It" feature in APICurio studio.

os-learner avatar May 27 '21 15:05 os-learner

My understanding is that the Try It feature of ReDoc is not included in the open source offering. So I don't think there is a way to enable it in Studio. If I'm wrong I'll be very happy to know it. :)

EricWittmann avatar May 27 '21 15:05 EricWittmann

@EricWittmann RapiDoc and SwaggerUI have a try it feature, but Redoc does not. It would be nice to be able to switch between document UIs, are there any plans to do so?

RapiDoc https://mrin9.github.io/RapiDoc/index.html Swagger UI https://swagger.io/tools/swagger-ui/

Yuutakasan avatar May 31 '21 23:05 Yuutakasan

Interestingly we already have experimental support for rapidoc in the Preview feature. If you add &rid=rapidoc to the Preview URL you can see it. For example:

image

The relevant code is here:

https://github.com/Apicurio/apicurio-studio/blob/master/front-end/servlet/src/main/java/io/apicurio/studio/fe/servlet/servlets/PreviewServlet.java#L78-L82

Contributions for other renderers like Swagger UI wouldn't be hard!

EricWittmann avatar Jun 03 '21 01:06 EricWittmann

Cool, I like the look and feel of rapidoc, although the Try it out feature is disabled in Apicurio: https://github.com/Apicurio/apicurio-studio/blob/dfc277b03032562e4a3d37f16c851159340495b0/front-end/servlet/src/main/resources/io/apicurio/studio/fe/servlet/servlets/preview_rapidoc.template#L8

To enable it set allow-try=true or remove the attribute as true is the default.

zigouras avatar Jun 03 '21 20:06 zigouras

Ah yes - sorry about that, I forgot that I specifically disabled that feature. I don't recall the thought process, but probably none of my API descriptions had real services backing them.

I think there is some work that could be easily done here that would make these features easier to enable/disable. I'd be happy to guide anyone interested in making a contribution! We would need to think about how to allow users to choose between the renderers, set a default renderer, configure the renderer(s) either globally or perhaps per-design.

EricWittmann avatar Jun 07 '21 17:06 EricWittmann

I may be interested in contributing, I will be in touch!

zigouras avatar Jun 07 '21 20:06 zigouras