-
Notifications
You must be signed in to change notification settings - Fork 44
add swagger doc #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add swagger doc #356
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import dynamic from 'next/dynamic' | ||
| import type { SwaggerUIProps } from 'swagger-ui-react' | ||
|
|
||
| const SwaggerUI = dynamic(() => import('swagger-ui-react') as Promise<{ default: React.ComponentType<SwaggerUIProps> }>, { ssr: false }) | ||
|
|
||
| import 'swagger-ui-react/swagger-ui.css' | ||
|
|
||
| export function Swagger(props: {}) { | ||
| return (<SwaggerUI | ||
| url="https://raw.githubusercontent.com/authzed/api/refs/heads/main/docs/apidocs.swagger.json" | ||
| deepLinking={true} | ||
| supportedSubmitMethods={[]} | ||
| tryItOutEnabled={false} | ||
| defaultModelsExpandDepth={-1} | ||
| defaultModelRendering={'model'} | ||
| />) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,9 +5,7 @@ | |
| "newWindow": true | ||
| }, | ||
| "http-api": { | ||
| "title": "HTTP API Reference", | ||
| "href": "https://www.postman.com/authzed/workspace/spicedb/overview", | ||
| "newWindow": true | ||
| "title": "HTTP API Reference" | ||
| }, | ||
| "cloud-api": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not a blocker / for a follow up: now that we embed the SpiceDB HTTP API using Swagger, we should probably do the same with the Authzed Cloud API |
||
| "title": "Cloud API Reference", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import {Swagger} from "../../../components/swagger"; | ||
|
|
||
| # HTTP API Documentation | ||
|
|
||
| <Swagger /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,10 @@ | |
| "newWindow": true | ||
| }, | ||
| "http-api": { | ||
| "title": "HTTP API Reference", | ||
| "title": "HTTP API Reference" | ||
| }, | ||
| "postman": { | ||
| "title": "Postman Collection", | ||
| "href": "https://www.postman.com/authzed/workspace/spicedb/overview", | ||
| "newWindow": true | ||
| } | ||
|
Comment on lines
+10
to
14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Postman collection only includes HTTP stuff; perhaps it could be a child of the HTTP API, but I'm also OK as it is |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import {Swagger} from "../../../components/swagger"; | ||
|
|
||
| # HTTP API Documentation | ||
|
|
||
| <Swagger /> |
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make it clear that this is the SpiceDB HTTP API? Now that we have Cloud API around, which is also HTTP, the titles seem confusing. Proposal: