coupon-admin/vendor/zircote/swagger-php/Examples
wangxinglong 82f5a8f3f5 初始化 2021-11-18 17:57:04 +08:00
..
example-object 初始化 2021-11-18 17:57:04 +08:00
misc 初始化 2021-11-18 17:57:04 +08:00
openapi-spec 初始化 2021-11-18 17:57:04 +08:00
petstore-3.0 初始化 2021-11-18 17:57:04 +08:00
petstore.swagger.io 初始化 2021-11-18 17:57:04 +08:00
processors 初始化 2021-11-18 17:57:04 +08:00
swagger-spec 初始化 2021-11-18 17:57:04 +08:00
using-interfaces 初始化 2021-11-18 17:57:04 +08:00
using-refs 初始化 2021-11-18 17:57:04 +08:00
using-traits 初始化 2021-11-18 17:57:04 +08:00
Readme.md 初始化 2021-11-18 17:57:04 +08:00

Readme.md

Code/Annotation examples

Collection of code/annotation examples and their corresponding OpenAPI specs generated using swagger-php.

Custom processors

Processors implement the various steps involved in converting annotations into an OpenAPI spec.

Writing a custom processor is the recommended way to extend swagger-php in a clean way.

Processors are expected to implement the __invoke() method expecting the current Analysis object as single parameter:

<?php
...
use OpenApi\Analysis;
...

class MyCustomProcessor
{
    public function __invoke(Analysis $analysis)
    {
        // custom processing    
    }
}
  • schema-query-parameter processor

    A processor that takes a vendor tag (expecting a schema #ref) and injects all properties of that given schema as query parameter to the request definition.

    source

  • sort-components processor

    A processor that sorts components so they appear in alphabetical order.

    source