From c5f9ab8988a2ea6cb99a3a181c8105b1640fd2c6 Mon Sep 17 00:00:00 2001 From: Marco Holz <marco.holz@fitko.de> Date: Tue, 14 Sep 2021 18:33:25 +0000 Subject: [PATCH] Add routing api spec --- docs/apis/delivery-service.mdx | 2 +- docs/apis/routing-api.mdx | 8 ++++++++ src/components/ApiSpec.js | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 docs/apis/routing-api.mdx diff --git a/docs/apis/delivery-service.mdx b/docs/apis/delivery-service.mdx index f98419c6e..f14358922 100644 --- a/docs/apis/delivery-service.mdx +++ b/docs/apis/delivery-service.mdx @@ -5,4 +5,4 @@ hide_table_of_contents: true import ApiSpec from '@site/src/components/ApiSpec' -<ApiSpec artifact={"zustelldienst.yml"} /> +<ApiSpec path={"openapi"} artifact={"zustelldienst.yml"} /> diff --git a/docs/apis/routing-api.mdx b/docs/apis/routing-api.mdx new file mode 100644 index 000000000..3775ee4c0 --- /dev/null +++ b/docs/apis/routing-api.mdx @@ -0,0 +1,8 @@ +--- +title: Routing API +hide_table_of_contents: true +--- + +import ApiSpec from '@site/src/components/ApiSpec' + +<ApiSpec path={"routing-api"} artifact={"routing-api.yaml"} /> diff --git a/src/components/ApiSpec.js b/src/components/ApiSpec.js index a6f1946c6..9df7278dc 100644 --- a/src/components/ApiSpec.js +++ b/src/components/ApiSpec.js @@ -7,7 +7,7 @@ import useAsync from '@site/src/hooks/useAsync' import getLatestVersion from "@site/src/utils/getLatestVersion"; import DownloadLabel from "./DownloadLabel"; -const SCHEMA_BASE_URL = 'https://schema.fitko.de/fit-connect/openapi' +const SCHEMA_BASE_URL = 'https://schema.fitko.de/fit-connect' const GITLAB_PROJECT_ID = 1 export default function ApiSpec(props) { @@ -34,14 +34,14 @@ export default function ApiSpec(props) { <div> <p>Die aktuell angezeigte Version der API ist {status === 'success' && <code>{latestVersion}</code>} {status === 'success' && - <DownloadLabel baseURL={SCHEMA_BASE_URL} version={latestVersion} artifact={props.artifact}/>}. + <DownloadLabel baseURL={SCHEMA_BASE_URL} version={latestVersion} path={props.path} artifact={props.artifact}/>}. Alle vorherigen Versionen <a href={SCHEMA_BASE_URL}>finden sich hier.</a> </p> {status === 'success' && latestVersion && <rapi-doc render-style="view" layout="column" - spec-url={`${SCHEMA_BASE_URL}/${latestVersion}/${props.artifact}`} + spec-url={`${SCHEMA_BASE_URL}/${props.path}/${latestVersion}/${props.artifact}`} theme="light" show-info="false" show-header="false" -- GitLab