feat: adds openapi documentation
This commit is contained in:
parent
5ee45209d8
commit
b066849d90
6 changed files with 4041 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
import {themes as prismThemes} from 'prism-react-renderer';
|
||||
import type {Config} from '@docusaurus/types';
|
||||
import type * as Preset from '@docusaurus/preset-classic';
|
||||
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
|
||||
|
||||
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
|
||||
|
||||
|
@ -29,6 +30,7 @@ const config: Config = {
|
|||
{
|
||||
docs: {
|
||||
sidebarPath: './sidebars.ts',
|
||||
docItemComponent: "@theme/ApiItem",
|
||||
},
|
||||
theme: {
|
||||
customCss: './src/css/custom.css',
|
||||
|
@ -37,6 +39,28 @@ const config: Config = {
|
|||
],
|
||||
],
|
||||
|
||||
plugins: [
|
||||
[
|
||||
'docusaurus-plugin-openapi-docs',
|
||||
{
|
||||
id: "api", // plugin id
|
||||
docsPluginId: "classic", // configured for preset-classic
|
||||
config: {
|
||||
api: {
|
||||
specPath: "static/openapi.json",
|
||||
outputDir: "docs/api/",
|
||||
downloadUrl: "/openapi.json",
|
||||
sidebarOptions: {
|
||||
groupPathsBy: "tag",
|
||||
categoryLinkSource: "tag",
|
||||
},
|
||||
} satisfies OpenApiPlugin.Options,
|
||||
}
|
||||
},
|
||||
]
|
||||
],
|
||||
themes: ["docusaurus-theme-openapi-docs"], // export theme components
|
||||
|
||||
themeConfig: {
|
||||
// Replace with your project's social card
|
||||
image: 'img/docusaurus-social-card.jpg',
|
||||
|
@ -53,6 +77,12 @@ const config: Config = {
|
|||
position: 'left',
|
||||
label: 'Docs',
|
||||
},
|
||||
{
|
||||
type: 'docSidebar',
|
||||
sidebarId: 'apisidebar',
|
||||
position: 'left',
|
||||
label: 'API',
|
||||
},
|
||||
{
|
||||
to: '/contact',
|
||||
position: 'left',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue