Skip to content
Snippets Groups Projects
Commit 80cc8be8 authored by David Schwarzmann's avatar David Schwarzmann
Browse files

Merge branch 'mr-add-routing-api' into 'main'

Add routing api spec

See merge request !35
parents 92b1ae65 9b9aa011
No related branches found
No related tags found
1 merge request!35Add routing api spec
......@@ -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"} />
---
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"} />
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment