diff --git a/docs/apis/delivery-service.mdx b/docs/apis/delivery-service.mdx index f98419c6e0eb12e3e25aac65e1d43827cc477b32..5335ab2d6c4b760d0d6da21c8b56b8eba6e551b3 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 gitlabProjectId={"1"} path={"openapi"} artifact={"zustelldienst.yml"} /> diff --git a/docs/apis/routing-api.mdx b/docs/apis/routing-api.mdx new file mode 100644 index 0000000000000000000000000000000000000000..c41155d5d39869b260f6f1f327c1ed591ce94b23 --- /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 gitlabProjectId={"44"} path={"routing-api"} artifact={"routing-api.yaml"} /> diff --git a/src/components/ApiSpec.js b/src/components/ApiSpec.js index a6f1946c627559909545983f0ae333f745eaa2d2..b0a0a87c3d60fad79e7bc8c44ed05cc48e83593a 100644 --- a/src/components/ApiSpec.js +++ b/src/components/ApiSpec.js @@ -7,8 +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 GITLAB_PROJECT_ID = 1 +const SCHEMA_BASE_URL = 'https://schema.fitko.de/fit-connect' export default function ApiSpec(props) { const isInBrowser = ExecutionEnvironment.canUseDOM @@ -16,7 +15,7 @@ export default function ApiSpec(props) { const {execute, status, error, value: latestVersion} = useAsync(getLatestVersion, { siteVersion, - projectId: GITLAB_PROJECT_ID + projectId: props.gitlabProjectId }, false) if (isInBrowser) { @@ -34,14 +33,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}/>}. - Alle vorherigen Versionen <a href={SCHEMA_BASE_URL}>finden sich hier.</a> + <DownloadLabel baseURL={`${SCHEMA_BASE_URL}/${props.path}`} version={latestVersion} artifact={props.artifact}/>}. + Alle vorherigen Versionen <a href={`${SCHEMA_BASE_URL}/${props.path}`}>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"