apicurio-studio
apicurio-studio copied to clipboard
How to enable the "Try it" console in Redocly in Apicurio on OpenShift.
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.
Good question. It's nice to know if there is a way to enable "Try It" feature in APICurio studio.
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 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/
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:
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!
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.
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.
I may be interested in contributing, I will be in touch!