Generate interactive OpenAPI documentation for your RESTful API using doctrine annotations

Overview

Build Status Total Downloads License

swagger-php

Generate interactive OpenAPI documentation for your RESTful API using doctrine annotations.

For a full list of supported annotations, please have look at the OpenApi\Annotations namespace or the documentation website.

Features

  • Compatible with the OpenAPI 3.0 and 3.1 specification.
  • Extracts information from code & existing phpdoc annotations.
  • Command-line interface available.
  • Documentation site with a getting started guide.
  • Exceptional error reporting (with hints, context)
  • As of PHP 8.1 all annotations are also available as PHP attributes

OpenAPI version support

swagger-php allows to generate specs either for OpenAPI 3.0.0 or OpenAPI 3.1.0. By default the spec will be in version 3.0.0. The command line option --version may be used to change this to 3.1.0.

Programmatically, the method Generator::setVersion() can be used to change the version.

Installation (with Composer)

composer require zircote/swagger-php

For cli usage from anywhere install swagger-php globally and make sure to place the ~/.composer/vendor/bin directory in your PATH so the openapi executable can be located by your system.

composer global require zircote/swagger-php

Usage

Add annotations to your php files.

/**
 * @OA\Info(title="My First API", version="0.1")
 */

/**
 * @OA\Get(
 *     path="/api/resource.json",
 *     @OA\Response(response="200", description="An example resource")
 * )
 */

Visit the Documentation website for the Getting started guide or look at the Examples directory for more examples.

Usage from php

Generate always-up-to-date documentation.

toYaml();">

require("vendor/autoload.php");
$openapi = \OpenApi\Generator::scan(['/path/to/project']);
header('Content-Type: application/x-yaml');
echo $openapi->toYaml();

Documentation of how to use the Generator class can be found in the Generator Migration guide.

Usage from the Command Line Interface

The openapi command line interface can be used to generate the documentation to a static yaml/json file.

./vendor/bin/openapi --help

Starting with version 4 the default analyser used on the command line is the new ReflectionAnalyser.

Using the --legacy flag (-l) the legacy TokenAnalyser can still be used.

Usage from the Deserializer

Generate the OpenApi annotation object from a json string, which makes it easier to manipulate objects programmatically.



use OpenApi\Serializer;

$serializer = new Serializer();
$openapi = $serializer->deserialize($jsonString, 'OpenApi\Annotations\OpenApi');
echo $openapi->toJson();

Usage from docker

Generate the swagger documentation to a static json file.

docker run -v "$PWD":/app -it tico/swagger-php --help

More on OpenApi & Swagger

Contributing

Feel free to submit Github Issues or pull requests.

The documentation website is build from the docs folder with vuepress.

Make sure pull requests pass PHPUnit and PHP-CS-Fixer (PSR-2) tests.

To run both unit tests and linting execute:

composer test

Running unit tests only:

./bin/phpunit

Running linting only:

composer lint

To make php-cs-fixer fix linting errors:

composer cs
Comments
  • Groups support for different model views

    Groups support for different model views

    I'm currently working for a company that uses Symfony 2 for its API. They also use the JMSSerializerBundle to serialize the response, but to also support different views for an entity: http://jmsyst.com/libs/serializer/master/cookbook/exclusion_strategies#creating-different-views-of-your-objects

    Let me explain this better with the following example for Doctrine entities. A entity Car has a OneToMany association with the enity Part. With the API "/cars/1.json" I want to ->find() Car entity with ID one that also fetched al its childs like the Part entity. The Car entity can be put in the serializer and it will be returned. The controller for "/cars/1.json" will set the groups "Car" and "CarDetails". Because the Car entity has properties with @SER\Groups("Car") annotation and the Part entity has properties with the @SER\Groups("CarDetails") annotation, they will be returned both in the response.

    But lets say we want to show a list of cars with the API call "/cars.json". Then we only want to display the car name and some other fields, but not all parts. So the controller action that handles that call with set only the group "Car" on the serializer, so only the entities and their properties that have this group will be returned.

    At the moment the discoverer of swagger-php doesn't support this. It would be awesome if besides the responseClass attribute a responseGroups attribute could be added that can contain multiple values. A groups attribute could be added to a model property, to include this property of this model only if the API controller action has this Model ID as responseClass but also corresponding responseGroups.

    Because models are reused in Swagger UI over mulitple APIs and we want to use the same model with different views, I'm not sure yet about how to implement this.

    I hope you understand the issue and have some genius input on this :) Let me know what you think!

    enhancement 
    opened by pietervogelaar 33
  • allOf/anyOf/etc. in PHP Attributes

    allOf/anyOf/etc. in PHP Attributes

    Hey all! I've scoured the documentation and I really can't find out the recommended way of implementing something like this:

    <?php
    /**
     * @OA\Parameter(
     *     parameter="station_id_required",
     *     name="station_id",
     *     description="The station ID",
     *     example=1,
     *     in="path",
     *     required=true,
     *     @OA\Schema(
     *         anyOf={@OA\Schema(type="integer", format="int64"), @OA\Schema(type="string", format="string")}
     *     )
     * )
    

    into PHP attributes.

    The closest I've been able to come so far is:

    <?php
    #[OA\Parameter(
            name: "station_id_required",
            in: "path",
            required: true,
            schema: new OA\Schema(),
            // new OA\Schema(type: "integer", format: "int64"),
            // new OA\Schema(type: "string", format: "string"),
    ]
    

    But I'm not sure how to express the "anyOf" value for the parameter using the attributes. Nothing I'm trying is validating properly. Any ideas?

    bug 
    opened by BusterNeece 17
  • PHP 8.1 attributes

    PHP 8.1 attributes

    Sneak preview on attributes (requires PHP 8.1).

    In fact, this is now the branch for swagger-php v4!

    Feedback welcome!

    So far:

    • bumps major version to 4.x
    • moved/renamed TokenAnalyserand Analyser
    • introduced a new ReflectionAnalyser and AnnotationFactoryInterface
    • introduced new AnalyserInterface implemented by both TokenAnalyser and ReflectionAnalyser
    • new annotation factories added: DocBlockAnnotationFactory and AttributeAnnotationFactory; ReflectionAnalyser can use either (or possibly both at the same time...)
    • updated all examples to pass with both token analyser and reflection analyser (using DocBlockAnnotationFactory)
      • this required adding classes to lots of stand-alone docblocks....
    • Updated some annotation classes to also work as \Attribute
    • Attribute based fixture intests/Fixtured/Apis/Attributes - this is on parity with the corresponding DocBlock example
    • Allow to mix attributes and annotations
    • Add PHP 8.1 to build matrix (latest deps only)

    TODO:

    • add all supported properties as named ctor parameters to PHP 8.1 constructors
    • add more attribute based tests
    • things I've missed to far :)
    opened by DerManoMann 15
  • Multiple @OA\Response() with the same response=

    Multiple @OA\Response() with the same response="200"

    That issue occurs only on server side. local.ERROR: ErrorException: Multiple @OA\Response() with the same response="200": \App\Http\Controllers\Student\EventsController->update() in /var/www/html/app/Http/Controllers/Student/EventsController.php on line 136 \App\Http\Controllers\Student\EventsController->store() in /var/www/html/app/Http/Controllers/Student/EventsController.php on line 51 in /var/www/html/vendor/zircote/swagger-php/src/Logger.php:39 I tried api-docs generated on local in https://editor.swagger.io and that works very well. How that can be resolved?

    opened by DorelBesliu 15
  • Add support for OpenAPI 3.0

    Add support for OpenAPI 3.0

    Hey there,

    I'm not sure if this is in the works already but after reading this post: https://blog.readme.io/an-example-filled-guide-to-swagger-3-2/

    I wanted to add an issue regarding support for OpenAPI / Swagger 3.0.

    Specifically, the HATEOAS implementation would be very helpful for my team.

    Please let me know if any work has started on this already, otherwise I'd be happy to fork and start contributing.

    Thanks in advance

    opened by prodikl 15
  • Attribute class

    Attribute class "JetBrains\PhpStorm\ArrayShape" not found

    After updating to the new version when I try to generate the documentation I'm getting this:

    [2022-02-03 20:24:22] local.ERROR: Attribute class "JetBrains\PhpStorm\ArrayShape" not found {"exception":"[object] (Error(code: 0): Attribute class \"JetBrains\\PhpStorm\\ArrayShape\" not found at vendor/zircote/swagger-php/src/Analysers/AttributeAnnotationFactory.php:46)
    [stacktrace]
    #0 vendor/zircote/swagger-php/src/Analysers/AttributeAnnotationFactory.php(46): ReflectionAttribute->newInstance()
    #1 vendor/zircote/swagger-php/src/Analysers/ReflectionAnalyser.php(128): OpenApi\\Analysers\\AttributeAnnotationFactory->build(Object(ReflectionMethod), Object(OpenApi\\Context))
    #2 vendor/zircote/swagger-php/src/Analysers/ReflectionAnalyser.php(55): OpenApi\\Analysers\\ReflectionAnalyser->analyzeFqdn('App\\\\Classes\\\\Fin...', Object(OpenApi\\Analysis), Array)
    #3 vendor/zircote/swagger-php/src/Generator.php(378): OpenApi\\Analysers\\ReflectionAnalyser->fromFile('...', Object(OpenApi\\Context))
    #4 vendor/zircote/swagger-php/src/Generator.php(342): OpenApi\\Generator->scanSources(Object(Symfony\\Component\\Finder\\Finder), Object(OpenApi\\Analysis), Object(OpenApi\\Context))
    #5 vendor/darkaonline/l5-swagger/src/Generator.php(181): OpenApi\\Generator->generate(Object(Symfony\\Component\\Finder\\Finder), Object(OpenApi\\Analysis))
    #6 vendor/darkaonline/l5-swagger/src/Generator.php(122): L5Swagger\\Generator->scanFilesForDocumentation()
    #7 vendor/darkaonline/l5-swagger/src/Http/Controllers/SwaggerController.php(60): L5Swagger\\Generator->generateDocs()
    #8 vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): L5Swagger\\Http\\Controllers\\SwaggerController->docs(Object(Illuminate\\Http\\Request), 'api-docs.json')
    #9 vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('docs', Array)
    #10 vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(L5Swagger\\Http\\Controllers\\SwaggerController), 'docs')
    #11 vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
    #12 vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\\Routing\\Route->run()
    #13 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
    #14 vendor/darkaonline/l5-swagger/src/Http/Middleware/Config.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #15 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): L5Swagger\\Http\\Middleware\\Config->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #16 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #17 vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
    #18 vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
    #19 vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
    #20 vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
    #21 vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
    #22 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
    #23 app/Http/Middleware/CorsMiddleware.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #24 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\CorsMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #25 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #26 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #27 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #28 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #29 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #30 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #31 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #32 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #33 vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #34 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #35 vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #36 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #37 vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #38 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
    #39 vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
    #40 vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
    #41 vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
    #42 public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
    #43 server.php(21): require_once('...')
    #44 {main}
    "} 
    
    
    enhancement 
    opened by Messhias 14
  • Error generating JSON for optional security

    Error generating JSON for optional security

    I've an endpoint that has optional security. So I need to generate a JSON like

         *     security={
         *          { },
         *          {"api-key": []},
         *     },
    

    I put this annotation in my code

         *     security={
         *          { },
         *          {"api-key": {}},
         *     },
    

    but this JSON is generated

         *     security={
         *          [ ],
         *          {"api-key": [ ] },
         *     },
    

    instead of

         *     security={
         *          { },
         *          {"api-key": [ ] },
         *     },
    

    This is because PHP json-serialize this structure

        ["security"]=>
        array(2) {
          [0]=> array(0) {}
          [1]=> array(1) {
            ["api-key"]=> array(0) {}
          }
        }
    

    Any hint about where to start to fix it ?

    opened by hpatoio 14
  • swagger-php and doctrine annotation not playing nice.

    swagger-php and doctrine annotation not playing nice.

    Hi,

    I currently have swagger-php generating JSON formatted documentation through the commandline util swagger.phar.

    I am trying to do the same now for the models/OM but I am having issues with this. Our project currently uses Doctrine's @ ORM annotation for DB mapping and the two seem to be clashing.

    My main question is (as I am not experienced with this) is @ ORM and @ SWG model annotations compatible? And if they are, do you have an example of them working in harmony?

    If I include both in my annotation, the @ ORM annotation fails, causing my application to error. E.g:

    https://gist.github.com/scoch/fd3efc5bb1e11a2f7fb1

    I've tried swapping their order various other ways but to no avail, it usually results in a "message": "An exception was raised while creating "classnamehere"; no instance returned", error or the @ SWG model annotation above the class being ignored/ commandline error.

    Thanks for any assistance you can provide.

    Regards, Steven

    opened by scoch 14
  • CleanUnusedComponents processor does not filter out all unused components.

    CleanUnusedComponents processor does not filter out all unused components.

    While using the CleanUnusedComponents processor, I kept getting unused schema's in my final documentation. After looking into it a bit, it seems in most cases it includes components that are referencing each other, but that are not used anywhere else. Though some components also still showed up while not being referenced at all in the final documentation.

    I've fixed it for myself by filtering the components passed to the CleanUnusedComponents processor, but I think a better fix could be thought of.

    Filtering code example
    class CleanUnusedComponentsExtended
    {
        public function __invoke(Analysis $analysis)
        {
    	    if (Generator::isDefault($analysis->openapi->components)) {
    		    return;
    	    }
        
    	    $this->cleanup($analysis);
        }
        
        public function cleanup(Analysis $analysis): void
        {
    	    $filtered_annotations = new SplObjectStorage();
        
    	    /** @var AbstractAnnotation $annotation */
    	    foreach ($analysis->annotations as $annotation) {
    		    $this->filterAnnotations($annotation, $filtered_annotations);
    	    }
        
    	    $cleanup_unused_components = new CleanUnusedComponents();
    	    $analysis->annotations = $filtered_annotations;
    	    $cleanup_unused_components($analysis);
        }
        
        private function filterAnnotations(AbstractAnnotation $annotation, SplObjectStorage $storage): void
        {
    	    if (
    		    $annotation instanceof PathItem ||
    		    $annotation instanceof SecurityScheme ||
    		    $annotation instanceof Info ||
    		    $annotation instanceof Server ||
    		    $annotation instanceof Tag ||
    		    $annotation instanceof ExternalDocumentation
    	    ) {
    		    $storage->attach($annotation);
    		    $this->traverseAnnotation($annotation, $storage);
    	    }
        }
        
        private function traverseAnnotation(AbstractAnnotation $annotation, SplObjectStorage $storage): void
        {
    	    foreach (array_merge($annotation::$_nested, ['allOf', 'anyOf', 'oneOff']) as $nested) {
    		    if (is_array($nested)) {
    			    foreach ($nested as $field_name) {
    				    if (isset($annotation->{$field_name})) {
    					    $this->innerTraverseAnnotation($annotation->{$field_name}, $storage);
    				    }
    			    }
    		    } else if (isset($annotation->{$nested})) {
    			    $this->innerTraverseAnnotation($annotation->{$nested}, $storage);
    		    }
    	    }
        }
        
        private function innerTraverseAnnotation($obj, SplObjectStorage $storage): void
        {
    	    if ($obj !== null && !is_string($obj)) {
    		    if (is_array($obj)) {
    			    foreach ($obj as $value) {
    				    $this->innerTraverseAnnotation($value, $storage);
    			    }
    		    } else if (!$storage->contains($obj)) {
    			    $storage->attach($obj);
    			    $this->traverseAnnotation($obj, $storage);
    		    }
    	    }
        }
    }
    
    enhancement 
    opened by Prusias 13
  • Allow attributes' enums to be specified with an enum class string

    Allow attributes' enums to be specified with an enum class string

    Proposal

    When using Attribute to describe specifications, we would like to synchronize the enum property with the Enum class.

    I thought it would be a good idea to have the enum value automatically expanded from the Enum class name.

    #[Property('status', type: 'string', enum: StatusEnum::class, example: StatusEnum::DRAFT)]
    public StatusEnum status;
    

    What we dare not do

    • Allowing UnitEnum arrays to be specified. In PHP8.1, IDE and linter warn when calling EnumClass::cases() in Attribute, so it was decided not to support it at this time. For example, here are some warnings

      • Constant expression contains invalid operations
      • Cannot call abstract static method UnitEnum::cases().

    Could be a problem with the PHP version, but do you have any knowledge of this issue?

    opened by k2tzumi 13
  • User Notice: Required @OA\PathItem() not found

    User Notice: Required @OA\PathItem() not found

    Hi, I m using symfony 4.4 / nelmio api doc bundle 4.0 / swagger-php 3.0. When i try with a first example i get this error : User Notice: Required @OA\PathItem() not found

    ` namespace App\Controller;

    use OpenApi\Annotations as OA;

    /**

    • @OA\PathItem(
    • path="/products/{product_id}",
    • @OA\Parameter(ref="#/components/parameters/product_id_in_path_required")
    • ) */

    class ProductController {

    /**
     * @OA\Get(
     *   tags={"Products"},
     *   path="/products/{product_id}",
     *   @OA\Response(
     *       response="default",
     *       description="successful operation",
     *       @OA\JsonContent(ref="#/components/responses/product")
     *   )
     * )
     */
    public function getProduct($id)
    {
    }
    
    }`
    
    opened by mohamed-jebri 13
  • externalValue return

    externalValue return "string" instead of json content

    I'm looking to load "large" external json file on OA\Response.

    new OA\Response(
         response: 200,
         description: "Success",
         content: [
               new OA\JsonContent(
               examples: [
                     new OA\Examples(example: "result", summary: "Response complete",  externalValue: "http://test.domain.com/api/json/emp/res_Data.json"),
                    ]
               ),
         ]
    )
    

    The file "res_Data.json" is online, but on swagger documentation on "response" block there is only "string" instead of json file content.

    What's wrong or there are another way? Thanks

    opened by lucaele 1
  • Cannot use positional argument after named argument

    Cannot use positional argument after named argument

    PHP: 8.1.7 Laravel: 9.39.0 Swagger-php: 4.5

    This above code generete error

    "Whoops\Exception\ErrorException Cannot use positional argument after named argument"


    namespace App\Http\Controllers\Api_EMP;

    use App\Http\Controllers\Controller; use Illuminate\Http\Request; use OpenApi\Attributes as OA;

    #[OA\Info( title:"EMP2.3", description:"EMP", version:"0.1.1" )]

    #[OA\Server( description:"EMP", url:L5_SWAGGER_CONST_HOST_EMP )]

    #[OA\Schema( schema:"req_Data2", required:["code", "message"], new OA\Property( property:"code", type:"integer", format:"int32" ), new OA\Property( property:"message", type:"string" ) )]

    #[OA\Post( path:"/emp/data2", tags:["EMP"], summary:"Adds a new user - with oneOf examples", description:"Return a list of Data", new OA\RequestBody( new OA\JsonContent( ref:"#/components/schemas/req_Data2", new OA\Examples(example:"result", summary:"With Post Customer Object", value:["code" => 1, "message" => "ci siamo!"]), ), ), new OA\Response( response:200, description:"OK", new OA\JsonContent( oneOf:[ new OA\Schema(ref:"#/components/schemas/req_Data2") ], new OA\Examples(example:"result", summary:"With Post Customer Object", value:["code" => 1, "message" => "ci siamo!"]), ) ) )]

    class emp_controller extends Controller { // }

    Any idea how fix it?

    opened by lucaele 4
  • Documentation / Support for custom processors

    Documentation / Support for custom processors

    I'm currently playing around with Laravel and Custom processors in an attempt to generate schemas for endpoints automatically from Laravel FormRequest validation. I got started writing a custom processor and some basic parsing/generation code, but I'm not very certain on how to use the Analysis instance passed into the processor to add generated schema annotations for the request objects. I tried to use:

    $analysis->unmerged()->addAnnotation(
                        new OA\Schema(
                            title: "Update request",
                            description: "Request doing updates",
                            required: ["name"],
                            properties: [
                                new OA\Property(
                                    property: "name,
                                    description: "display name",
                                    type: "string",
                                    example: "Test"
                                ),
                            ],
                            type: "object"
                        ),
                        new Context()
                    );
    

    But it does not show up in the generated openapi.yml. I suppose maybe its got something to do with the context?

    I'd be grateful for some response, but I'll keep poking around in the code nevertheless. Thanks for your time!

    opened by 0xSpell 0
  • Add Proper Copyright notice to the project

    Add Proper Copyright notice to the project

    I cannot find the Copyright information anywhere in the Project or as I would expect it at the top of the LICENSE file.

    I would expect something like this: Copyright [yyyy] [name of copyright owner], in said LISENCE file as described within the text of the Apache 2.0 license description.

    The reason that this is important is that my employer has implemented strict OSS compliance guidelines to comply with various (mostly European) rules.

    My OSS Compliance Officer has forbid me from using this Sofware unless this is included. Which will cause issue as we have already integrated this into the project and cause lots of work to remove.

    May I suggest: Copyright 2022 Zircote project

    Lukasz

    opened by lgados 0
  • The 'items' field for Array property's isn't populated by the DocBlock

    The 'items' field for Array property's isn't populated by the DocBlock

    The following constructor:

         /**
         * @param DateTimeImmutable[] $times
         * @param string[] $alerts
         */
        public function __construct(
            #[OA\Property]
            public readonly array $times,
            #[OA\Property]
            public readonly array $alerts,
        )
    

    Will throw the error: @OA\Items() is required when @OA\Property() has type "array"

    The fix is to manually populate the info, this works:

         /**
         * @param DateTimeImmutable[] $times
         * @param string[] $alerts
         */
        public function __construct(
            #[OA\Property(items: new OA\Items(ref: "#/components/schemas/DateTimeImmutable", type: "object"))]
            public readonly array $times,
            #[OA\Property(items: new OA\Items(type: "string"))]
            public readonly array $alerts,
        )
    

    Is this a bug? Should the generator automatically populate the items info from the DocBlock generics?

    opened by CxDevLead 1
Releases(4.5.1)
  • 4.5.1(Nov 9, 2022)

    What's Changed

    • Fix broken link by @DerManoMann in https://github.com/zircote/swagger-php/pull/1343
    • Add support for content to Parameter attribute by @DerManoMann in https://github.com/zircote/swagger-php/pull/1344
    • Disable deprecation warning until issues sorted downstream by @DerManoMann in https://github.com/zircote/swagger-php/pull/1345

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.5.0...4.5.1

    Source code(tar.gz)
    Source code(zip)
  • 4.5.0(Nov 3, 2022)

    What's Changed

    • Add script to auto-generate processor docs by @DerManoMann in https://github.com/zircote/swagger-php/pull/1332
    • Merge annotation _aux property with context generated by @DerManoMann in https://github.com/zircote/swagger-php/pull/1333
    • Raise deprecation warning for Context::detect by @DerManoMann in https://github.com/zircote/swagger-php/pull/1334
    • Extend ExpandClasses processor to also consider ancestor traits by @DerManoMann in https://github.com/zircote/swagger-php/pull/1331

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.10...4.5.0

    Source code(tar.gz)
    Source code(zip)
  • 4.4.10(Oct 19, 2022)

    What's Changed

    • Refresh reference docs and disable xdebug on CL by @DerManoMann in https://github.com/zircote/swagger-php/pull/1312
    • Add more types/type-hints by @DerManoMann in https://github.com/zircote/swagger-php/pull/1313
    • Consistently use OA and OAT as relative namespace for annotations/att… by @DerManoMann in https://github.com/zircote/swagger-php/pull/1314
    • Add doc section about escaping in doctrine annotations by @DerManoMann in https://github.com/zircote/swagger-php/pull/1317
    • Allow enums to be specified with an enum array by @akalineskou in https://github.com/zircote/swagger-php/pull/1316
    • Allow to specify multiple bootstrap files by @DerManoMann in https://github.com/zircote/swagger-php/pull/1323
    • Collector by @DerManoMann in https://github.com/zircote/swagger-php/pull/1322
    • Fix double '\' when handling classes in the global namespace by @DerManoMann in https://github.com/zircote/swagger-php/pull/1329
    • Allow Schema attribute to be repeatable by @DerManoMann in https://github.com/zircote/swagger-php/pull/1330

    New Contributors

    • @akalineskou made their first contribution in https://github.com/zircote/swagger-php/pull/1316

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.9...4.4.10

    Source code(tar.gz)
    Source code(zip)
  • 4.4.9(Sep 11, 2022)

    What's Changed

    • Address psalm warnings by @DerManoMann in https://github.com/zircote/swagger-php/pull/1297
    • Add option to set config options on the command line by @DerManoMann in https://github.com/zircote/swagger-php/pull/1302
    • Tweak CS rules around global imports and enforce by @DerManoMann in https://github.com/zircote/swagger-php/pull/1305
    • Rename job by @DerManoMann in https://github.com/zircote/swagger-php/pull/1306
    • Allow attributes' enums to be specified with an enum class string by @k2tzumi in https://github.com/zircote/swagger-php/pull/1303
    • Break up dataProvider data into individual items by @DerManoMann in https://github.com/zircote/swagger-php/pull/1309
    • Add Attachable to Response::$content and RequestBody::$content by @GuilhemN in https://github.com/zircote/swagger-php/pull/1307

    New Contributors

    • @k2tzumi made their first contribution in https://github.com/zircote/swagger-php/pull/1303

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.8...4.4.9

    Source code(tar.gz)
    Source code(zip)
  • 4.4.8(Aug 16, 2022)

    What's Changed

    • Add single_line_comment_spacing rule by @DerManoMann in https://github.com/zircote/swagger-php/pull/1282
    • Explicitly set the PHP version by @DerManoMann in https://github.com/zircote/swagger-php/pull/1284
    • Add AttributeAnnotationFactoryTest and fixtures by @DerManoMann in https://github.com/zircote/swagger-php/pull/1283
    • Dep updates by @DerManoMann in https://github.com/zircote/swagger-php/pull/1289
    • Set uses details on context by @DerManoMann in https://github.com/zircote/swagger-php/pull/1294
    • Add response to the isRoot priority map by @DerManoMann in https://github.com/zircote/swagger-php/pull/1296

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.7...4.4.8

    Source code(tar.gz)
    Source code(zip)
  • 4.4.7(Jul 2, 2022)

    What's Changed

    • Do not return annotations merged into an explicit parent in AttributeAnnotationFactory by @GuilhemN in https://github.com/zircote/swagger-php/pull/1279

    New Contributors

    • @GuilhemN made their first contribution in https://github.com/zircote/swagger-php/pull/1279

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.6...4.4.7

    Source code(tar.gz)
    Source code(zip)
  • 4.4.6(Jun 30, 2022)

    What's Changed

    • [PHP 8.2] Fix ${var} string interpolation deprecation by @Ayesh in https://github.com/zircote/swagger-php/pull/1266
    • Address PHP 8.2. warnings by @DerManoMann in https://github.com/zircote/swagger-php/pull/1263
    • Add 8.2 to build matrix by @DerManoMann in https://github.com/zircote/swagger-php/pull/1260
    • CS tweaks by @DerManoMann in https://github.com/zircote/swagger-php/pull/1268
    • Fix vitepress link by @DerManoMann in https://github.com/zircote/swagger-php/pull/1269
    • Multi types by @DerManoMann in https://github.com/zircote/swagger-php/pull/1270
    • add+update project links by @alphaolomi in https://github.com/zircote/swagger-php/pull/1273
    • Pick up property type (simple) from method return type-hint by @DerManoMann in https://github.com/zircote/swagger-php/pull/1275
    • Only use method return type-hint if property type not yet set by @DerManoMann in https://github.com/zircote/swagger-php/pull/1276
    • export-ignore docs and Changelog.md by @DerManoMann in https://github.com/zircote/swagger-php/pull/1277
    • Handle '&' used for return by reference by @DerManoMann in https://github.com/zircote/swagger-php/pull/1274

    New Contributors

    • @Ayesh made their first contribution in https://github.com/zircote/swagger-php/pull/1266
    • @alphaolomi made their first contribution in https://github.com/zircote/swagger-php/pull/1273

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.5...4.4.6

    Source code(tar.gz)
    Source code(zip)
  • 2.1.2(Jun 20, 2022)

    What's Changed

    • type deprecation fix for preg_match and preg_split for php 8.1 by @potasiyam in https://github.com/zircote/swagger-php/pull/1265

    New Contributors

    • @potasiyam made their first contribution in https://github.com/zircote/swagger-php/pull/1265

    Full Changelog: https://github.com/zircote/swagger-php/compare/2.1.1...2.1.2

    Source code(tar.gz)
    Source code(zip)
  • 4.4.5(Jun 5, 2022)

    What's Changed

    • X typehint by @DerManoMann in https://github.com/zircote/swagger-php/pull/1255
    • xxxOf with type=object by @DerManoMann in https://github.com/zircote/swagger-php/pull/1254

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.4...4.4.5

    Source code(tar.gz)
    Source code(zip)
  • 4.4.4(May 29, 2022)

    What's Changed

    • Detect nullable on constructor property promotion by @DerManoMann in https://github.com/zircote/swagger-php/pull/1250
    • More static analysis by @DerManoMann in https://github.com/zircote/swagger-php/pull/1251

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.3...4.4.4

    Source code(tar.gz)
    Source code(zip)
  • 4.4.3(May 24, 2022)

    What's Changed

    • Allow the property attribute to be repeated by @DerManoMann in https://github.com/zircote/swagger-php/pull/1240
    • Allow original backing value in Enum by @ginnerpeace in https://github.com/zircote/swagger-php/pull/1239
    • Docs codeblocks by @DerManoMann in https://github.com/zircote/swagger-php/pull/1232
    • Dev tools by @DerManoMann in https://github.com/zircote/swagger-php/pull/1243
    • Allow SecurityScheme on methods/properties by @DerManoMann in https://github.com/zircote/swagger-php/pull/1246
    • Docblock augments by @DerManoMann in https://github.com/zircote/swagger-php/pull/1244
    • Wrong DocParser Exception without context by @matiaspub in https://github.com/zircote/swagger-php/pull/1247

    New Contributors

    • @ginnerpeace made their first contribution in https://github.com/zircote/swagger-php/pull/1239
    • @matiaspub made their first contribution in https://github.com/zircote/swagger-php/pull/1247

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.2...4.4.3

    Source code(tar.gz)
    Source code(zip)
  • 3.3.6(May 21, 2022)

    What's Changed

    • fix return type for Symfony debug class by @shyim in https://github.com/zircote/swagger-php/pull/1245

    Full Changelog: https://github.com/zircote/swagger-php/compare/3.3.4...3.3.6

    Source code(tar.gz)
    Source code(zip)
  • 4.4.2(May 13, 2022)

    What's Changed

    • Refactor strategy determining the root annotation in a context by @DerManoMann in https://github.com/zircote/swagger-php/pull/1227
    • Add faq about openapi CLI output missing by @DerManoMann in https://github.com/zircote/swagger-php/pull/1230
    • Change enum type from string[] to string[]|int[]|float[] by @berrugo in https://github.com/zircote/swagger-php/pull/1233
    • Allow Tag attribute on methods by @DerManoMann in https://github.com/zircote/swagger-php/pull/1236

    New Contributors

    • @berrugo made their first contribution in https://github.com/zircote/swagger-php/pull/1233

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.1...4.4.2

    Source code(tar.gz)
    Source code(zip)
  • 4.4.1(May 6, 2022)

    What's Changed

    • Re-add object as typehint for $ref by @DerManoMann in https://github.com/zircote/swagger-php/pull/1229

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.4.0...4.4.1

    Source code(tar.gz)
    Source code(zip)
  • 4.4.0(May 5, 2022)

    What's Changed

    • Refactor example code to avoid text on stdout by @DerManoMann in https://github.com/zircote/swagger-php/pull/1208
    • Initialise optional context properties with null by @DerManoMann in https://github.com/zircote/swagger-php/pull/1209
    • Add YAML support to Serializer by @DerManoMann in https://github.com/zircote/swagger-php/pull/1212
    • Components cleanup by @DerManoMann in https://github.com/zircote/swagger-php/pull/1199
    • Minor documentation fixes for v4 migration guide by @jt2k in https://github.com/zircote/swagger-php/pull/1214
    • fix Attributes\Components typo. by @recca0120 in https://github.com/zircote/swagger-php/pull/1215
    • Add test to ensure attribute parameters are matching annotations by @DerManoMann in https://github.com/zircote/swagger-php/pull/1217
    • Document parent and nested elements by @DerManoMann in https://github.com/zircote/swagger-php/pull/1219
    • Add PHPStan workflow and baseline by @DerManoMann in https://github.com/zircote/swagger-php/pull/1222
    • Add Psalm to analysis chain by @DerManoMann in https://github.com/zircote/swagger-php/pull/1223
    • Add support for generator / processor configuration by @DerManoMann in https://github.com/zircote/swagger-php/pull/1211
    • Handle required for Parameter by @DerManoMann in https://github.com/zircote/swagger-php/pull/1225
    • get enum backing value by @recca0120 in https://github.com/zircote/swagger-php/pull/1218

    New Contributors

    • @jt2k made their first contribution in https://github.com/zircote/swagger-php/pull/1214
    • @recca0120 made their first contribution in https://github.com/zircote/swagger-php/pull/1215

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.3.0...4.4.0

    Source code(tar.gz)
    Source code(zip)
  • 4.3.0(Apr 17, 2022)

    What's Changed

    • Skip inherited interfaces when expanding by @DerManoMann in https://github.com/zircote/swagger-php/pull/1202
    • Sync attribute flags and add \Attribute::TARGET_PARAMETER by @DerManoMann in https://github.com/zircote/swagger-php/pull/1206
    • Fix injecting docblock parser aliases by @DerManoMann in https://github.com/zircote/swagger-php/pull/1207

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.15...4.3.0

    Source code(tar.gz)
    Source code(zip)
  • 4.2.15(Apr 12, 2022)

    What's Changed

    • Rename license file to be in line with what GH expects by @DerManoMann in https://github.com/zircote/swagger-php/pull/1188
    • Use Generator::UNDEFINED as default for untyped args default/example by @DerManoMann in https://github.com/zircote/swagger-php/pull/1189
    • Add security parameter to OpenApi attribute by @DerManoMann in https://github.com/zircote/swagger-php/pull/1191
    • Add @see support to annotation property docblocks by @DerManoMann in https://github.com/zircote/swagger-php/pull/1194
    • Add callbacks parameter to OperationTrait by @edipoReboucas in https://github.com/zircote/swagger-php/pull/1196
    • Allow to annotate class constants as properties by @DerManoMann in https://github.com/zircote/swagger-php/pull/1193

    New Contributors

    • @edipoReboucas made their first contribution in https://github.com/zircote/swagger-php/pull/1196

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.14...4.2.15

    Source code(tar.gz)
    Source code(zip)
  • 4.2.14(Apr 6, 2022)

    What's Changed

    • Added deprecated to OperationTrait by @tm1000 in https://github.com/zircote/swagger-php/pull/1175
    • OpenApi version override by @DerManoMann in https://github.com/zircote/swagger-php/pull/1179
    • Document PHP requirements by @DerManoMann in https://github.com/zircote/swagger-php/pull/1182
    • Fix Generator reference link by @DerManoMann in https://github.com/zircote/swagger-php/pull/1184

    New Contributors

    • @tm1000 made their first contribution in https://github.com/zircote/swagger-php/pull/1175

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.13...4.2.14

    Source code(tar.gz)
    Source code(zip)
  • 4.2.13(Mar 23, 2022)

    What's Changed

    • Add missing request parameter for RequestBody.php by @lempzz in https://github.com/zircote/swagger-php/pull/1173
    • Add missing ref parameter for RequestBody.php by @lempzz in https://github.com/zircote/swagger-php/pull/1174

    New Contributors

    • @lempzz made their first contribution in https://github.com/zircote/swagger-php/pull/1173

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.12...4.2.13

    Source code(tar.gz)
    Source code(zip)
  • 4.2.12(Mar 18, 2022)

    What's Changed

    • Add some tests by @DerManoMann in https://github.com/zircote/swagger-php/pull/1155
    • Include annotation / attribute class docblocks in generated reference by @DerManoMann in https://github.com/zircote/swagger-php/pull/1156
    • Use 81 for workflows by @DerManoMann in https://github.com/zircote/swagger-php/pull/1157
    • Fix workflow syntax by @DerManoMann in https://github.com/zircote/swagger-php/pull/1158
    • Fix toJson method DocComment by @dsutphin in https://github.com/zircote/swagger-php/pull/1160
    • More ref gen by @DerManoMann in https://github.com/zircote/swagger-php/pull/1163
    • Add missing attribute Components parameter by @DerManoMann in https://github.com/zircote/swagger-php/pull/1167

    New Contributors

    • @dsutphin made their first contribution in https://github.com/zircote/swagger-php/pull/1160

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.11...4.2.12

    Source code(tar.gz)
    Source code(zip)
  • 4.2.11(Mar 6, 2022)

    What's Changed

    • Ignore operationId null by @DerManoMann in https://github.com/zircote/swagger-php/pull/1154

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.10...4.2.11

    Source code(tar.gz)
    Source code(zip)
  • 4.2.10(Mar 4, 2022)

    What's Changed

    • Fix a doc link to Annotation support by @kkreft in https://github.com/zircote/swagger-php/pull/1133
    • Only exit with code > 0 if the logged message was above notice by @bcremer in https://github.com/zircote/swagger-php/pull/1127
    • Tidy up console error logging by @DerManoMann in https://github.com/zircote/swagger-php/pull/1139
    • CS fixes for tests and fixtures by @DerManoMann in https://github.com/zircote/swagger-php/pull/1142
    • Add FAQ by @DerManoMann in https://github.com/zircote/swagger-php/pull/1148
    • Add article to FAQ by @DerManoMann in https://github.com/zircote/swagger-php/pull/1152
    • Add validation for unique operation ids by @DerManoMann in https://github.com/zircote/swagger-php/pull/1149

    New Contributors

    • @kkreft made their first contribution in https://github.com/zircote/swagger-php/pull/1133
    • @bcremer made their first contribution in https://github.com/zircote/swagger-php/pull/1127

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.9...4.2.10

    Source code(tar.gz)
    Source code(zip)
  • 3.3.5(May 18, 2022)

    What's Changed

    • Fix deprecated messages by @DerManoMann in https://github.com/zircote/swagger-php/pull/1137

    Full Changelog: https://github.com/zircote/swagger-php/compare/3.3.3...3.3.5

    Source code(tar.gz)
    Source code(zip)
  • 3.3.4(Feb 24, 2022)

    What's Changed

    • Fix deprecated messages by @DerManoMann in https://github.com/zircote/swagger-php/pull/1137

    Full Changelog: https://github.com/zircote/swagger-php/compare/3.3.3...3.3.4

    Source code(tar.gz)
    Source code(zip)
  • 4.2.9(Feb 20, 2022)

    What's Changed

    • Express nullable in 3.1.0 by @DerManoMann in https://github.com/zircote/swagger-php/pull/1125
    • Rely on existing class loaders when using reflection by @DerManoMann in https://github.com/zircote/swagger-php/pull/1126
    • Allow multiple Server attributes by @DerManoMann in https://github.com/zircote/swagger-php/pull/1130
    • Tweak properties doctype hint by @DerManoMann in https://github.com/zircote/swagger-php/pull/1131
    • Allow pure MediaType list as content by @DerManoMann in https://github.com/zircote/swagger-php/pull/1132

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.8...4.2.9

    Source code(tar.gz)
    Source code(zip)
  • 4.2.8(Feb 13, 2022)

    What's Changed

    • Add multi value query parameter recipe by @DerManoMann in https://github.com/zircote/swagger-php/pull/1115
    • Allow Tag and SecuritScheme to be repeatable by @DerManoMann in https://github.com/zircote/swagger-php/pull/1116
    • Fix example YAML validation warnings by @DerManoMann in https://github.com/zircote/swagger-php/pull/1114
    • Add script to aut-generate annotation/attribute reference docs by @DerManoMann in https://github.com/zircote/swagger-php/pull/1117
    • Fix annotations/attributes links by @DerManoMann in https://github.com/zircote/swagger-php/pull/1118
    • Fix typos in guide/cookbook.md by @mass6 in https://github.com/zircote/swagger-php/pull/1119
    • Add example of how to use custom response classes by @DerManoMann in https://github.com/zircote/swagger-php/pull/1121

    New Contributors

    • @mass6 made their first contribution in https://github.com/zircote/swagger-php/pull/1119

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.7...4.2.8

    Source code(tar.gz)
    Source code(zip)
  • 4.2.7(Feb 10, 2022)

    What's Changed

    • Enables more attribute targets for OpenApi\Attributes\Examples. by @abbluiz-userh in https://github.com/zircote/swagger-php/pull/1110
    • Add @DoctrineAnnotation rule and apply to Examples by @DerManoMann in https://github.com/zircote/swagger-php/pull/1111
    • Promoted property attribute type override by @DerManoMann in https://github.com/zircote/swagger-php/pull/1112
    • fix(Attributes): type RequestBody content by @caugner in https://github.com/zircote/swagger-php/pull/1098

    New Contributors

    • @caugner made their first contribution in https://github.com/zircote/swagger-php/pull/1098

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.6...4.2.7

    Source code(tar.gz)
    Source code(zip)
  • 4.2.6(Feb 7, 2022)

    What's Changed

    • Fix Discriminator Attribute mapping property type hint by @b-vadym in https://github.com/zircote/swagger-php/pull/1089
    • Fix typehints for additionalProperties by @DerManoMann in https://github.com/zircote/swagger-php/pull/1095
    • Add Style and Explode to Parameter attribute constuctor by @b-vadym in https://github.com/zircote/swagger-php/pull/1090
    • Handle unknown attributes by @DerManoMann in https://github.com/zircote/swagger-php/pull/1100
    • Documentation refactor by @DerManoMann in https://github.com/zircote/swagger-php/pull/1084
    • Enable gh-pages workflow by @DerManoMann in https://github.com/zircote/swagger-php/pull/1101
    • Includes 'example' argument in Examples attribute constructor (PHP 8.1) by @abbluiz-userh in https://github.com/zircote/swagger-php/pull/1104
    • Debug log invalid attribute by @DerManoMann in https://github.com/zircote/swagger-php/pull/1106
    • Support array in Examples value (PHP 8.1) by @abbluiz-userh in https://github.com/zircote/swagger-php/pull/1105

    New Contributors

    • @b-vadym made their first contribution in https://github.com/zircote/swagger-php/pull/1089
    • @abbluiz-userh made their first contribution in https://github.com/zircote/swagger-php/pull/1104

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.5...4.2.6

    Source code(tar.gz)
    Source code(zip)
  • 4.2.5(Jan 31, 2022)

    What's Changed

    • fix: remove ` by @Gemorroj in https://github.com/zircote/swagger-php/pull/1081
    • Update type-hinting on security property for operations. by @SlvrEagle23 in https://github.com/zircote/swagger-php/pull/1086
    • Skip constructor properties only for attributes by @DerManoMann in https://github.com/zircote/swagger-php/pull/1087

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.4...4.2.5

    Source code(tar.gz)
    Source code(zip)
  • 4.2.4(Jan 20, 2022)

    What's Changed

    • Update docblock by @DerManoMann in https://github.com/zircote/swagger-php/pull/1075
    • Change typehint of Operation tags to string by @stefanbraspenning in https://github.com/zircote/swagger-php/pull/1076
    • Add missing attribute Schema properties by @DerManoMann in https://github.com/zircote/swagger-php/pull/1080

    New Contributors

    • @stefanbraspenning made their first contribution in https://github.com/zircote/swagger-php/pull/1076

    Full Changelog: https://github.com/zircote/swagger-php/compare/4.2.3...4.2.4

    Source code(tar.gz)
    Source code(zip)
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io Daux.io is a documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It help

Daux.io 719 Nov 29, 2022
Generates documentation for your REST API from annotations

NelmioApiDocBundle The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs. Migrate from 3.x to 4.0 To migrate from

Nelmio 2.1k Nov 25, 2022
Yii2 Annotations Generate API Document Extension

Generate online api document by code annotation for yii2 easily

Trevor 16 Dec 15, 2021
phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to generate a complete set of API Documentation

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Dec 1, 2022
Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and / or RESTful API

Luracast Restler ![Gitter](https://badges.gitter.im/Join Chat.svg) Version 3.0 Release Candidate 5 Restler is a simple and effective multi-format Web

Luracast 1.4k Nov 20, 2022
Generate Sphinx/ReStructured documentation from PHPDoc

PHP-phpdoc-to-rst Forked from Francesco "Abbadon1334" Danti by AeonDigital. In this fork the changes has only visual and superficial effects [ just be

Rianna Cantarelli 0 Nov 16, 2021
Industrial-strength annotations for PHP

php-annotations Source-code annotations for PHP. Copyright (C) 2011-2015 Rasmus Schultz [email protected] https://github.com/php-annotations/php-anno

php-annotations 139 Nov 13, 2022
Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)

phpDox phpDox is a documentation generator for PHP projects. This includes, but is not limited to, API documentation. The main focus is on enriching t

Arne Blankerts 589 Nov 11, 2022
An API documentation generator

Sami: an API documentation generator WARNING: Sami is not supported nor maintained anymore. Feel free to fork. Curious about what Sami generates? Have

null 2k Nov 3, 2022
A php API documentation generator, fork of Sami

Doctum, a PHP API documentation generator. Fork of Sami Curious about what Doctum generates? Have a look at the MariaDB MySQL Kbs or Laravel documenta

Code LTS 195 Nov 20, 2022
Sami: an API documentation generator

Sami: an API documentation generator WARNING: Sami is not supported nor maintained anymore. Feel free to fork. Curious about what Sami generates? Have

null 2k Nov 3, 2022
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Nov 27, 2022
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Apr 20, 2021
Documentation Generator for PHP

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Nov 29, 2022
Documentation Generator for WordPress.

Pronamic WordPress Documentor is a tool to automatically extract data about the actions and filters of your WordPress theme or plugin.

Pronamic 35 Nov 11, 2022
A PHP framework foucs on API fast development.接口,从简单开始!PhalApi简称π框架,一个轻量级PHP开源接口框架,专注于接口服务开发。

PhalApi开源接口框架 / PhalApi API Framework 读音:派框架 Stargazers over time 开发文档 / Documents 专为PHPer准备的优雅而详细的开发文档,请看:PhalApi 2.x 开发文档。 PhalApi 2.x English Docs.

dogstar 1.5k Nov 12, 2022
FluxBB is a fast, light, user-friendly forum application for your website.

FluxBB 1.5 Readme About FluxBB is an open source forum application released under the GNU General Public Licence. It is free to download and use and w

FluxBB 476 Nov 23, 2022
30 seconds of code Short PHP code snippets for all your development needs

30 seconds of code Short PHP code snippets for all your development needs Visit our website to view our snippet collection. Use the Search page to fin

30 seconds of code 2.5k Nov 29, 2022
Ladumor Laravel Swagger help to setup swagger in your application easily

Laravel Swagger Installation Install the package by the following command, composer require ladumor/laravel-swagger Add Provider Add the provider to

Shailesh Ladumor 23 Jun 17, 2022