Swagger

Swagger plugin for Payload CMS that generates OpenAPI documentation.

Community 140 2.1k/wk MIT v1.4.0

Installation

pnpm add payload-swagger

About

Payload-swagger generates OpenAPI 3 documentation from your Payload configuration. It adds routes for serving the OpenAPI document and the Swagger UI interface, enabling users to explore API endpoints easily. The plugin leverages the payload-openapi package to document all available endpoints, including collection, global, custom, and authentication endpoints, while providing fully typed schema definitions for requests and responses. Users can extend the generated OpenAPI document with information from the package.json file or optionally from a .openapi config file. The plugin provides flexible configuration options to customize the Swagger UI routes, access level analysis on collections, and define custom endpoints. Users can also exclude certain parts of the configuration from being documented. Examples for custom endpoints can be incorporated directly into the Payload configuration, and documentation for custom routes can be added as well. This integration allows seamless documentation of complex Payload APIs alongside the core features of the CMS.

Package info

Package name
payload-swagger
Latest version
1.4.0
Unpacked size
24 kB
License
MIT
Weekly downloads
2.1k
Last publish
Jul 15, 2023

More from teunmooij

View profile

Similar plugins

More in Devtools