Skip to content
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

feat: add OpenAPI v3 visualisation to docs #17

Merged
merged 8 commits into from
Jul 29, 2024

Conversation

ndom91
Copy link
Contributor

@ndom91 ndom91 commented Jul 27, 2024

☕️ Reasoning

  • Add visualisation for our OpenAPI docs

🧢 Changes

  • Add scripts/generate-docs.mjs script to fetch our swagger definition JSON and convert it from v2 to v3, using Swagger's first party conversion web service. Then, write that v3 swagger json to disk and pass it as input to the fumadocs fn which generates the mdx files that get displayed in the end.
    • This explicitly adds a dependency on the OpenAPI Convertor web service being up for our docs to be built properly.. Some ideas to make us more resilient to this:
      • Commit a copy of the built api reference mdx files now, and the script just overwrites those on build with newer versions, so that there's always at least something to fall back to; Comes with the risk of potentially shipping out-of-date/broken reference though :/
      • Do the conversion ourselves in a GHA via the container image they offer
  • Point the "Releases" menu item to github.com/gitbutlerapp/gitbutler/releases instead of attempting to maintain two separate lists.
    • Remove all releases.mdx related code

📸 Screenshots

First Load:

image

OpenAPI Section:

image

Copy link

vercel bot commented Jul 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitbutler-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 29, 2024 0:55am

@ndom91 ndom91 changed the title feat: add script to generate gitbutler v3 openapi docs feat: add OpenAPI v3 visualisation to docs Jul 27, 2024
@ndom91 ndom91 marked this pull request as draft July 27, 2024 12:10
Copy link

Broken Link Checker

1 broken links found. Links organised below by source page, or page where they were found.

1) /api-reference

Target Link Link Text Reason
https://github.com/gitbutlerapp/gitbutler-docs/blob/main/content/docs/api-reference/index.mdx "Edit on GitHub" HTTP_404

@ndom91
Copy link
Contributor Author

ndom91 commented Jul 27, 2024

Can ignore the broken link checker for now, that file is newly added in this PR, therefore the autogenerated link to "edit this page on origin/main" obviously 404's until this PR is merged.

@ndom91 ndom91 marked this pull request as ready for review July 27, 2024 12:56
@ndom91 ndom91 merged commit 2220885 into main Jul 29, 2024
2 of 3 checks passed
@ndom91 ndom91 deleted the ndom91/add-gitbutler-openapi-visualisation branch July 29, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant