pezzolabs / pezzo

🕹️ Open-source, developer-first LLMOps platform designed to streamline prompt design, version management, instant delivery, collaboration, troubleshooting, observability and more.
https://pezzo.ai
Apache License 2.0
2.55k stars 211 forks source link

Use OpenAPI json #230

Closed SniperBuddy101 closed 1 year ago

SniperBuddy101 commented 1 year ago

Resolves #191

Screenshot

image

Process:

  1. Download the OpenAPI json file through this URL - https://api.staging.pezzo.ai/api/spec-json (Subject to change)
  2. Save the JSON file with the name open-api.json in the docs directory (Mintlify).
  3. Generate MDX files for the endpoints using the following command in the docs directory: npx @mintlify/scraping@latest openapi-file open-api.json -o api-reference
  4. Copy the generated output in the navigation section of mint.json file.
  5. The MDX files contain just the open api endpoints.
  6. The navigation section can be customised.

Have already auto generated the MDX files for the current API spec.

arielweinberger commented 1 year ago

Thanks @SniperBuddy101 looks excellent overall. Could you please:

I guess its best to automate this btw, so to auto generate the OpenAPI spec whenever we build the server. If you want to take it as well, let me know (should be a separate PR though).

I imagine the steps are:

  1. Auto generate the OpenAPI spec whenever we build the server (I believe the @nestjs/swagger library we use supports it)
  2. This spec file will be included in PRs/commits and will automatically trigger a redeployment of the docs whenever we push to main (nothing to be done here, this mechanism already works).
SniperBuddy101 commented 1 year ago

@arielweinberger Will make those changes.

Yes, I also think that it'll be better if we auto generate the MDX files at build time. I'd like to take that as well.

arielweinberger commented 1 year ago

@SniperBuddy101 yup just updated my comment!

SniperBuddy101 commented 1 year ago

Updated tabs:

image image

arielweinberger commented 1 year ago

Amazing work!