https://github.com/reiterus/swagger-symfony
OpenAPI format of REST API Endpoints for a Symfony based project
https://github.com/reiterus/swagger-symfony
docker nginx openapi postgresql swagger symfony
Last synced: 10 months ago
JSON representation
OpenAPI format of REST API Endpoints for a Symfony based project
- Host: GitHub
- URL: https://github.com/reiterus/swagger-symfony
- Owner: reiterus
- Created: 2022-12-24T06:46:43.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-25T07:04:46.000Z (about 3 years ago)
- Last Synced: 2025-02-03T14:18:49.544Z (12 months ago)
- Topics: docker, nginx, openapi, postgresql, swagger, symfony
- Language: PHP
- Homepage:
- Size: 118 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swagger Symfony
Example of generating documentation for REST API endpoints based on the OpenAPI format. Controller methods are described using attributes.
### Composer required
- nelmio/api-doc-bundle
- zircote/swagger-php
### Endpoint description
```php
#[Get(
path: '/welcome',
description: 'Default response from new Controller method with JsonResponse',
summary: 'Welcome message',
tags: ['welcome'],
responses: [
new Response(
response: 200,
description: 'Keys "message" and "path"',
content: [
new JsonContent(ref: '#/components/schemas/JsonDefault')
]
),
new Response(response: 400, description: 'Bad Request'),
new Response(response: 404, description: 'Not found'),
]
)]
```
### Screenshot
