mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
docs: add API page to docs using Swagger UI (#11154)
* docs: add API page to docs using Swagger UI * silence fossa
This commit is contained in:
committed by
GitHub
parent
5e0603f957
commit
6358a7f1b5
@@ -141,8 +141,9 @@ const LayoutFooter = () => (
|
||||
rel="noreferrer"
|
||||
>
|
||||
Apache Software Foundation
|
||||
</a>resources
|
||||
<br/>
|
||||
</a>
|
||||
resources
|
||||
<br />
|
||||
<a
|
||||
href="https://www.apache.org/security/"
|
||||
target="_blank"
|
||||
|
||||
@@ -34,6 +34,14 @@ interface Props {
|
||||
const docLayout = css`
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.doc-content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// Hacks to disable Swagger UI's "try it out" interactive mode
|
||||
.try-out, .auth-wrapper, .information-container {
|
||||
display: none;
|
||||
}
|
||||
`;
|
||||
|
||||
const Theme = ({ children }: Props) => {
|
||||
@@ -43,7 +51,9 @@ const Theme = ({ children }: Props) => {
|
||||
<Layout>
|
||||
<SEO title="Documentation" />
|
||||
<div css={docLayout}>
|
||||
<div>{children}</div>
|
||||
<div className="doc-content">
|
||||
{children}
|
||||
</div>
|
||||
<AnchorNavigator />
|
||||
</div>
|
||||
<div>
|
||||
|
||||
34
docs/src/pages/docs/api.mdx
Normal file
34
docs/src/pages/docs/api.mdx
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: API
|
||||
title: API
|
||||
route: /docs/api
|
||||
---
|
||||
## API
|
||||
|
||||
import SwaggerUI from 'swagger-ui-react';
|
||||
import openapi from 'src/resources/openapi.json';
|
||||
import 'swagger-ui-react/swagger-ui.css';
|
||||
import { Alert } from 'antd';
|
||||
|
||||
|
||||
Superset's public **REST API** follows the
|
||||
[OpenAPI specification](https://swagger.io/specification/), and is
|
||||
documented here. The docs bellow are generated using
|
||||
[Swagger React UI](https://www.npmjs.com/package/swagger-ui-react).
|
||||
|
||||
<Alert
|
||||
message={
|
||||
<div>
|
||||
<strong>NOTE! </strong>
|
||||
You can find an interactive version of this documentation
|
||||
on your local Superset instance
|
||||
at <strong>/swagger/v1</strong> (if enabled)
|
||||
</div>
|
||||
}
|
||||
type="info"
|
||||
/>
|
||||
|
||||
<br /><br /><hr />
|
||||
<div className="swagger-container">
|
||||
<SwaggerUI spec={openapi} />
|
||||
</div>
|
||||
8926
docs/src/resources/openapi.json
Normal file
8926
docs/src/resources/openapi.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user