Skip to content

Commit

Permalink
add temporary local spec
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikB2014 committed Aug 23, 2024
1 parent 9c71c6f commit cc7b1b9
Show file tree
Hide file tree
Showing 2 changed files with 56,073 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/api-docs/apiDocs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {Fragment, useEffect, useState} from 'react';
import {LoadingArticle} from 'apps/changelog/src/client/components/article';
import {OpenAPIV3_1} from 'openapi-types';
import {API, APICategory} from 'src/build/resolveOpenAPI';
import {resolveRemoteApiSpec} from 'src/build/shared';
// import {resolveRemoteApiSpec} from 'src/build/shared';
import SwaggerUI, {SwaggerUIProps} from 'swagger-ui-react';

import {HTTPSnippetGenerators} from './plugins';
import {getSnippetConfig} from './settings';
import {LOCAL_API_SPEC} from './localApiSpec';

type OpenApiSpec = OpenAPIV3_1.Document;

Expand Down Expand Up @@ -77,9 +78,11 @@ export function ApiDocs({api}: Props) {
const [apiSpec, setApiSpec] = useState<OpenApiSpec | null>(null);

useEffect(() => {
const fetchApiSpec = async () => {
const remoteSpec = (await resolveRemoteApiSpec()) as any as OpenApiSpec;
setApiSpec(remoteSpec);
const fetchApiSpec = () => {
// this is temporary, for demo purposed
const spec = LOCAL_API_SPEC as any as OpenApiSpec;
// const spec = (await resolveRemoteApiSpec()) as any as OpenApiSpec;
setApiSpec(spec);
};

fetchApiSpec();
Expand Down
Loading

0 comments on commit cc7b1b9

Please sign in to comment.