API Documentation - Swagger
m
mayank lavania
I tried integrating stoplight elements into my docusaurus and faced a lot of issues ( mainly react router issues) to the point i eventually decided to build proper plugin to integrate the same so that it can help others also but as i was exploring i stumbled on https://github.com/scalar/scalar.
Its beautiful and works absolutely fine along with Test request feature also. Thanks to team Scalar.
You can reference some links to get an idea from their github repo here
https://github.com/scalar/scalar/tree/main/integrations/docusaurus
https://github.com/scalar/scalar/blob/main/documentation/integrations/docusaurus.md
H
Heitor José Tessaro
Stoplight Elements (https://docs.stoplight.io/docs/elements/d6a8ba3f3c186-stoplight-elements) is an option to integrate API documentation into a Docusaurus project.
Sheldon Reddy
Heitor José Tessaro: Do you have any documentation on hand to show how this is done?
H
Heitor José Tessaro
Sheldon Reddy: I know that Codat uses it (https://github.com/codatio/codat-docs). However, I discovered this option recently, and I still need to test it.
H
Heitor José Tessaro
This repository (https://github.com/yhuard/docusaurus-stoplight-elements/tree/main) presents a demo of how to use Elements with Docusaurus.
Kennammp
Please make this happen, it's a big gap in what your otherwise excellent product can do. Redoc doesn't let you make requests to the API. Once Docusaurus can provide a functioning API portal this will open up a whole new revenue stream for you guys, as it will truly be a fully functioning developer portal as opposed to just the docs.
Jeff
Just want to add that previous commenters mentions of using Redoc are great except Redoc cannot make actual requests to your API (unless you are on some kind of paid version). This is IMO a bit useless, as it is otherwise just documentation for you to "read along with".
J
Javier Rubio
Redocusaurus really helped me to do this, you might want to check it out: https://github.com/rohit-gohri/redocusaurus
F
Fokke Dekker
Old thread but commenting for support adding native support for some API spec page would be awesome.
Mike Howes
The ability to import swaggers and provide interactive API docs would be great! We could get rid of SwaggerHub.
Sébastien Lorber
Merged in a post:
openapi3 rendering support
Zbyszek Tenerowicz
built-in ReDoc or similar would make it for a complete documentation solution where API specifications are used
Andreas Taube
Johannes Ferner how did you manage to isolate the classic-theme stylings to not interfere with the redoc styles?
Johannes Ferner
Andreas Taube: some manual quick&dirty overrides - it wasn't too much.
Andreas Taube
Johannes Ferner: I see, thanks for the feedback, I finally created 2 sides behind an nginx to solve this for now. The only annoying thing is the react router intercepting relative paths. I solved this with the target attribute.
Johannes Ferner
We have actually integrated redoc on https://developer.fiskaly.com/api/kassensichv
Should be possible with Swagger as well (if there is a react component of it)
<RedocStandalone
specUrl='https://kassensichv.io/api/spec'
options={{
requiredPropsFirst: true,
noAutoAuth: true,
hideDownloadButton: true,
onlyRequiredInSamples: true,
nativeScrollbars: true,
scrollYOffset: 60,
theme: { colors: { primary: { main: '#2da8d3' } } },
} }
/>
We're still working on rendering it statically soon.
Until then it spawns a reDoc standalone
Load More
→