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

Render api specs #163

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from
Draft

Render api specs #163

wants to merge 37 commits into from

Conversation

fabianrbz
Copy link
Collaborator

@fabianrbz fabianrbz commented Nov 28, 2024

How it works

  • Similar to how they work in the docs, there’s an app/_api/ folder containing markdown files, each one of those is mapped to an API product in Konnect, and for each of them the platform generates a page (+ versions).
  • We use the new spec-renderer component pulling the specs from Konnect
  • api-specs folder containing API Specs for creating Run on Insomnia , error pages and and source of truth for Gateway EE and OSS Admin API specs.
  • The url structure is /api/<path-to-file>/<version>/ , so e.g. for app/_api/konnect/api-products/_index.md the url will be /api/konnect/api-products/ , /api/konnect/api-products/v2/ etc. ⚠️ Different to what we do in the docs., here everything is nested under the /api/.
  • No /latest/ for canonical urls
  • Gateway:
    • oss: drop patch from url, i.e /api/gateway/admin-oss/3.8/
    • ee: drop last digit from url, i.e. /api/gateway/admin-ee/3.8.0/
  • The Page title and description come from Konnect (same thing we render for the cards in /api/, we can overwrite these by setting them in the frontmatter)
  • Error pages (for specs that have x-errors) are generated too, although their urls are don’t have the version at the end /api/konnect/dev-portal/errors/ , /api/konnect/dev-portal/v2/errors/ - thoughts?

Notes

  • Styles need a ton of work, we haven’t really done any work on this, the plan is to ship it and work on that later - it actually looks better in light mode 🤷
  • Run on insomnia I need to refactor this at some point, so that we don’t have ugly urls everywhere. Need to talk to @Guaris about this
  • I haven’t set any metadata other than the content_type: reference , we can revisit this when we work on the search.
  • the layout is slightly wider (we can even go full-width) so that the spec is rendered in a two-column layout

Checklist

  • Every page is page one
  • Tested how-to docs. If not, note why here.
  • All pages contain metadata
  • Updated sources.yaml. For more info review track docs changes
  • Any new docs link to existing docs.

Copy link

netlify bot commented Nov 28, 2024

Deploy Preview for kongdeveloper ready!

Name Link
🔨 Latest commit ddc50a4
🔍 Latest deploy log https://app.netlify.com/sites/kongdeveloper/deploys/67504ba75a64ec000847db90
😎 Deploy Preview https://deploy-preview-163--kongdeveloper.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@fabianrbz fabianrbz added the ci:manual-approve:linting Mark link checking as successful label Nov 28, 2024
The entity_schema still references the api by url, the platform will
fetch the corresponding konnect_product_id for that url and render the
corresponding schema.
Major versions don't change much (once per year max) and this also
provides consistent url structure with subpages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:manual-approve:linting Mark link checking as successful
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant