docs: add open api docs fetching to website#531
docs: add open api docs fetching to website#531tobySolutions wants to merge 2 commits intodevelopfrom
Conversation
|
| return <BadMagic basename="/api" workspaces={workspaces} />; | ||
| } | ||
|
|
||
| export default BadMagicClient; |
There was a problem hiding this comment.
| export default BadMagicClient; |
| tags?: { name: string; description?: string }[]; | ||
| }; | ||
|
|
||
| export function BadMagicClient() { |
There was a problem hiding this comment.
| export function BadMagicClient() { | |
| export const BadMagicClient = () => { |
|
|
||
| const fetchAndTransformSpec = async () => { | ||
| try { | ||
| const response = await fetch('https://api.fleek.xyz/api/openapi.json'); |
There was a problem hiding this comment.
Should be based on environment.
| const response = await fetch('https://api.fleek.xyz/api/openapi.json'); | |
| const response = await fetch(openApiUrl); |
Find the environment variable correct name or name it correctly.
const openApiUrl = import.meta.env.PUBLIC_OPEN_API_URL;There was a problem hiding this comment.
We might want to keep it simple and use /src/layouts/BaseHtml.astro.
| const routesByTag = new Map<string, BadMagicRoute[]>(); | ||
|
|
||
| // Process each path and its methods | ||
| Object.entries(data.paths).forEach(([path, pathItem]) => { |
There was a problem hiding this comment.
It's not very clear what you're trying to achieve here.
The API response is not a valid expected schema for this package badmagicclient, is this correct?
Would the following parser work for you? https://github.com/scalar/scalar/blob/main/packages/openapi-parser/README.md
The current API dashboard we have is open source but I believe that'd be a bit tricky for you to handle, e.g. https://github.com/scalar/scalar
Why?
This pull request is here to handle the work being done to auto-populate the website with the API docs from the open API docs we currently manage.
How?
Tickets?
Contribution checklist?
buildcommand runs locallySecurity checklist?