-
Notifications
You must be signed in to change notification settings - Fork 48
docs: add open api docs fetching to website #531
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
base: develop
Are you sure you want to change the base?
Conversation
|
| return <BadMagic basename="/api" workspaces={workspaces} />; | ||
| } | ||
|
|
||
| export default BadMagicClient; |
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.
| export default BadMagicClient; |
| tags?: { name: string; description?: string }[]; | ||
| }; | ||
|
|
||
| export function BadMagicClient() { |
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.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?