Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janbuchar/payload-oapi
A Payload CMS plugin for OpenAPI (3.0, 3.1) specification generation
https://github.com/janbuchar/payload-oapi
api-documentation openapi openapi3 openapi31 payload-plugin
Last synced: 18 days ago
JSON representation
A Payload CMS plugin for OpenAPI (3.0, 3.1) specification generation
- Host: GitHub
- URL: https://github.com/janbuchar/payload-oapi
- Owner: janbuchar
- License: mit
- Created: 2023-03-25T11:34:02.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-16T21:06:11.000Z (6 months ago)
- Last Synced: 2024-10-15T03:28:50.458Z (about 1 month ago)
- Topics: api-documentation, openapi, openapi3, openapi31, payload-plugin
- Language: TypeScript
- Homepage:
- Size: 400 KB
- Stars: 18
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Payload OpenAPI Plugin
[![npm version](https://badge.fury.io/js/payload-oapi.svg)](https://www.npmjs.com/package/payload-oapi)
Autogenerate an OpenAPI specification from your Payload CMS instance and use it for documentation or to generate client SDKs.
# Roadmap
- [x] Complete description of collection CRUD endpoints
- [x] Complete description of globals CRUD endpoints
- [x] Integrated Swagger UI and Rapidoc
- [ ] Custom endpoints
- [ ] Authentication endpoints and specification
- [ ] Preferences endpoints# Installation
Install the plugin from npm - `yarn add payload-oapi` or `npm i payload-oapi`.
# Setup
To add the OpenAPI specification endpoint to your Payload app, simply import the `openapi` plugin and add it to your payload configuration:
```typescript
import { openapi } from 'payload-oapi'buildConfig({
plugins: [
openapi({ openapiVersion: '3.0', metadata: { title: 'Dev API', version: '0.0.1' } }),
// ...
],
// ...
})
```To add a documentation UI, use the `swaggerUI`, `rapidoc` or `redoc` plugins, respectively:
```typescript
import { openapi, swaggerUI } from 'payload-oapi'buildConfig({
plugins: [
openapi(/* ... */),
swaggerUI({/* ... */})
],
// ...
})
```