Skip to content

Swagger-PHP

Generate OpenAPI documentation for your RESTful API.

1. Install with composer:

shell
> composer require zircote/swagger-php

2. Update your code

Add swagger-php attributes (or legacy annotations) to your source code.

⚠️ doctrine/annotations is going to be deprecated in the future, so wherever possible attributes should be used.

3. Generate OpenAPI documentation

shell
> ./vendor/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.