Back to Swagger Php

Index

docs/index.md

6.1.21.3 KB
Original Source

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.

⚠️ The doctrine/annotations library used to parse annotation is going to be deprecated, so wherever possible attributes should be used.

<codeblock id="minimal"> <template v-slot:at>

<<< @/snippets/minimal_api_at.php

</template> <template v-slot:an>

<<< @/snippets/minimal_api_an.php

</template> </codeblock>

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 or Scalar to explore and interact with your API.