docs/index.md
> composer require zircote/swagger-php
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.
::: info spec mode
As of version 6.5.0, a new, improved set of attributes has beend introduced - the spec attributes.
When using those, the mode needs to be set to spec in order to generate OpenAPI documents.
> ./vendor/bin/openapi -m spec ...
:::
<codeblock id="minimal"> <template v-slot:at><<< @/snippets/minimal_api_at.php
</template> <template v-slot:an><<< @/snippets/minimal_api_an.php
</template> <template v-slot:spec><<< @/snippets/minimal_api_spec.php
</template> </codeblock>> ./vendor/bin/openapi src -o openapi.yaml
Use an OpenAPI tool like Swagger UI or Scalar to explore and interact with your API.