Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions components/swagger.tsx
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'}
/>)
}
8 changes: 8 additions & 0 deletions globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ body {
top: 0;
left: 0;
}

.swagger-ui .information-container {
display: none;
}

.swagger-ui .scheme-container {
display: none;
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"react-dom": "^18.3.1",
"react-youtube": "^10.1.0",
"sharp": "^0.34.0",
"swagger-ui-react": "^5.22.0",
"tailwind-merge": "^2.4.0"
},
"devDependencies": {
Expand All @@ -54,5 +55,6 @@
"tailwindcss": "^3.4.4",
"typescript": "^4.9.5",
"yaml-loader": "^0.8.1"
}
},
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
}
4 changes: 1 addition & 3 deletions pages/authzed/api/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

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:

  • SpiceDB gRPC API Reference
  • SpiceDB HTTP API Reference
  • Authzed Cloud HTTP API Reference

},
"cloud-api": {
Copy link
Contributor

Choose a reason for hiding this comment

The 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",
Expand Down
5 changes: 5 additions & 0 deletions pages/authzed/api/http-api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {Swagger} from "../../../components/swagger";

# HTTP API Documentation

<Swagger />
5 changes: 4 additions & 1 deletion pages/spicedb/api/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Expand Down
5 changes: 5 additions & 0 deletions pages/spicedb/api/http-api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {Swagger} from "../../../components/swagger";

# HTTP API Documentation

<Swagger />
1,373 changes: 1,373 additions & 0 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Loading