Skip to content

Collection of payload plugins and tools: payload-openapi, payload-swagger, create-payload-api-docs, payload-rbac

License

Notifications You must be signed in to change notification settings

Livit/Portal.Cms.Swagger

 
 

Repository files navigation

snyk

payload tools and plugins

This repository will contain multiple tools and plugins for payload cms:

npm version

Openapi tool for payload cms:

  • generate openAPI 3 documentation from your Payload config

npm version

Swagger plugin for payload cms:

  • exposes openapi document generated with payload-openapi
  • includes a swagger ui
  • easy setup as payload plugin

Specs filter - operations

=> operations: Refers to a combination of a OpenAPI method & path from the Path Object & Path item

This will remove specific path items that match the operation definition PUT::/pets. In the example below, this would mean that the item with the path '/pets' and method 'PUT' would be removed from the OpenAPI document.

For example:

openapi: 3.0.0
info:
    title: API
    version: 1.0.0
paths:
    /pets:
        get:
            summary: Finds Pets by status
        put:
            summary: Update an existing pet

An operationId is an optional property. To offer support for OpenAPI documents that don't have operationIds, we have added the operation definition which is the unique combination of the OpenAPI method & path, with a :: separator symbol.

This will allow filtering for very specific OpenAPI items, without the need of adding operationIds to the OpenAPI document.

To facilitate managing the filtering, we have included wildcard options for the operations option, supporting the methods & path definitions.

REMARK: Be sure to put quotes around the target definition.

Strict matching example: "GET::/pets" This will target only the "GET" method and the specific path "/pets"

Method wildcard matching example: "*::/pets" This will target all methods ('get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace') and the specific path "/pets"

Path wildcard matching example: "GET::/pets/*" This will target only the "GET" method and any path matching any folder behind the "/pets", like "/pets/123" and "/pets/123/buy".

Method & Path wildcard matching example: "*::/pets/*" A combination of wildcards for the method and path parts is even possible.

Example of usage:

http://payload-test/api/specs?filterOperations[]=*::/pets/*&filterOperations[]=GET::/ants

use comma separated the values

http://payload-test/api/specs?filterOperations=*::/pets/*,GET::/ants

npm version

CLI for generating openAPI 3 documentation for your Payload cms

npm version

Easy to use Role based access control for your Payload cms:

  • plugin to extend your auth collection(s) with a roles property
  • lots of predefined access control functions
  • tools to combine access control functions to support more complex situations
  • fully compatible with any custom access control functions you might already have

npm version

Query utility for your Payload cms:

  • create type safe queries
  • predefine queries to be constructed with data passed in later (e.g. request data)
  • select output fields on REST and Internal API.

About

Collection of payload plugins and tools: payload-openapi, payload-swagger, create-payload-api-docs, payload-rbac

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.3%
  • Other 0.7%