Nicer docusaurus openapi docs (#722)

- uses this plugin (https://github.com/cloud-annotations/docusaurus-openapi) to make a nice static site docusaurus based api section of docs site.
- adds some nicer postman code snippets etc too as part of api docs.
- makes api docs more "self hosted" as opposed to the dynamic swagger url approach.
This commit is contained in:
Andrew Maguire
2023-01-15 10:38:08 +01:00
committed by GitHub
parent 124994a04e
commit f45de9adbc
3 changed files with 980 additions and 44 deletions
+5 -6
View File
@@ -32,12 +32,15 @@ const config = {
presets: [
[
"classic",
"docusaurus-preset-openapi",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
},
api: {
path: "docs/api/openapi.json",
},
blog: false,
theme: {
customCss: require.resolve("./src/css/custom.css"),
@@ -62,11 +65,7 @@ const config = {
position: "left",
label: "Docs",
},
{
href: "https://editor.swagger.io/?url=https://raw.githubusercontent.com/LAION-AI/Open-Assistant/main/docs/docs/api/openapi.json",
label: "API",
position: "left",
},
{ to: "/api", label: "API", position: "left" },
{
href: "https://github.com/LAION-AI/Open-Assistant",
label: "GitHub",