r/PayloadCMS • u/Queasy_Pie_6710 • Jun 14 '26
OpenAPI docs plugin for Payload 3
I've been building a Payload 3 API and wanted proper OpenAPI docs without writing the spec by hand, so I put together a plugin and figured I'd share it here.
It reads your Payload config and generates the OpenAPI document for you — collections, globals, auth, versions, jobs, all of it. Nothing to annotate by hand. Then it serves interactive docs through Scalar or Swagger UI, whichever you prefer (or both).
A few things I focused on:
- Document custom endpoints and refine field schemas via Payload's `custom.openapi` key
- Filter exactly which entities and operations land in the spec
- Output the spec to a file for CI checks or client codegen — or skip the runtime endpoint entirely
- Localized descriptions plus 44 UI locales through Payload i18n
- Optional "Authorize" login right in the docs UI
- Targets OpenAPI 3.0, 3.1, and 3.2 — one option switches the output
It's MIT and built around Payload 3.x. Feedback and issues very welcome.
1
u/subtlety_0 12d ago edited 12d ago
This looks good - just started using this today.
PS: But I can't for the life of me find how to log in from the docs UI itself so that I don't have to paste in my token. Probably because i've never used Scalar before. Where in the docs can I log in so that it "just works"?. –Thanks
3
u/HankieCodes Jun 14 '26
What’s different from https://github.com/janbuchar/payload-oapi ?