An open API service indexing awesome lists of open source software.

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

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
![Screenshot](screen.png)