home actionText actionLink features true User Guide → /guide/ title details OpenAPI conformant Generate OpenAPI documents in version 3.0 or 3.1. title details Document your API inside PHP source code Using swagger-php lets you write the API documentation inside the PHP source files which helps keeping the documentation up-to-date. title details Annotation and Attribute support Annotations can be either docblocks or PHP 8.1 attributes. 1. Install with composer: > composer require zircote/swagger-php 2. Update your code Add swagger-php attributes or annotations to your source code. <<< @/snippets/minimal_api_at.php <<< @/snippets/minimal_api_an.php 3. Generate OpenAPI documentation > ./bin/openapi src -o openapi.yaml 4. Explore and interact with your API Use an OpenAPI tool like Swagger UI to explore and interact with your API. Links User Guide Reference OpenApi Documentation OpenApi Specification Learn by example Related projects Swagger-php 2.x documentation