0.0.7 • Published 2 years ago

@itrabbit/payload-swagger-plugin v0.0.7

Weekly downloads
-
License
Unlicense
Repository
github
Last release
2 years ago

@itrabbit/payload-swagger-plugin

Payload CMS plugin for generate swagger documentation.

The plugin is under development!

  • Collection fields
    • text, textarea, email, code, number, date
    • radio, select, checkbox
    • relationship, upload
    • relationship with many relationTo
    • row, collapsible
    • richText
    • blocks
    • point
    • group
    • array
    • json
    • tabs
    • ui
  • Collection timestamp
  • CRUD for collections
  • CRUD for version collections
  • Auth Operations
    • login
    • logout
    • reset password
    • forgot password
    • verify email
    • unlock
    • refresh token
    • me
  • Custom Endpoints (use collection.endpoints[n].custom.swagger append path information, use collection.custom.swagger for append other info to swagger)
  • Preferences
  • Global

Getting started

  1. Install the package with npm i @itrabbit/payload-swagger-plugin or yarn add @itrabbit/payload-swagger-plugin.
  2. Add the plugin to your payload.config.ts:
import swagger from '@itrabbit/payload-swagger-plugin';

export default buildConfig({
    /* ... */
    plugins: [
        swagger(),
    ],
});

Open in browser https://localhost:3000/api/swagger

Plugin options

Optionally, you can pass the following options to tweak the behavior of the plugin:

export interface SwaggerPluginOptions {
    /**
     * Array of collection slugs that the plugin should apply to.
     * If empty use all collection
     *
     * Default: []
     */
    collections?: CollectionConfig['slug'][];
    /**
     * Path for serve documentation
     *
     * Default: /api/swagger
     */
    path?: string;

    /**
     * Locale for documentation
     *
     * Default: en
     */
    locale?: string;
}
0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago