You've already forked Php-Template
feat/swagger #24
@@ -37,6 +37,20 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
PHP_IDE_CONFIG: serverName=localhost
|
PHP_IDE_CONFIG: serverName=localhost
|
||||||
|
|
||||||
|
swagger-ui:
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.swagger-ui.entrypoints=web-secure"
|
||||||
|
- "traefik.http.routers.swagger-ui.rule=Host(`localhost`) && PathPrefix(`/docs`)"
|
||||||
|
- "traefik.http.routers.swagger-ui.tls=true"
|
||||||
|
- "traefik.http.routers.swagger-ui.service=swagger-ui"
|
||||||
|
- "traefik.http.services.swagger-ui.loadbalancer.server.port=8080"
|
||||||
|
image: swaggerapi/swagger-ui:latest
|
||||||
|
container_name: swagger-ui
|
||||||
|
environment:
|
||||||
|
BASE_URL: /docs
|
||||||
|
URL: /.well-known/swagger.yaml
|
||||||
|
|
||||||
migration-container:
|
migration-container:
|
||||||
volumes:
|
volumes:
|
||||||
- ./db/migrations:/app/db/migrations
|
- ./db/migrations:/app/db/migrations
|
||||||
|
|||||||
@@ -23,9 +23,11 @@ use OpenApi\Attributes as OA;
|
|||||||
class HealthcheckController extends Controller
|
class HealthcheckController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* Handles the GET request for health check.
|
||||||
|
*
|
||||||
* @throws \JsonException
|
* @throws \JsonException
|
||||||
*/
|
*/
|
||||||
#[OA\Get(path: '/healthz')]
|
#[OA\Get(path: '/healthz', tags: ['Healthcheck'])]
|
||||||
#[OA\Response(response: '200', description: 'Healthcheck OK')]
|
#[OA\Response(response: '200', description: 'Healthcheck OK')]
|
||||||
#[OA\Response(response: '503', description: 'Healthcheck Failed')]
|
#[OA\Response(response: '503', description: 'Healthcheck Failed')]
|
||||||
public function get(ServerRequest $request): ResponseInterface
|
public function get(ServerRequest $request): ResponseInterface
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class IndexController extends Controller
|
|||||||
#[Guards\Jwt]
|
#[Guards\Jwt]
|
||||||
#[Guards\Scope(['get.index', 'status.check'])]
|
#[Guards\Scope(['get.index', 'status.check'])]
|
||||||
#[Guards\RequireAllScopes]
|
#[Guards\RequireAllScopes]
|
||||||
#[OA\Get(path: '/')]
|
#[OA\Get(path: '/', tags: ['Examples'])]
|
||||||
#[OA\Response(
|
#[OA\Response(
|
||||||
response: '200',
|
response: '200',
|
||||||
description: 'An Example Response',
|
description: 'An Example Response',
|
||||||
@@ -40,11 +40,13 @@ class IndexController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Handles the POST request for the index route.
|
||||||
|
*
|
||||||
* @throws \JsonException
|
* @throws \JsonException
|
||||||
*/
|
*/
|
||||||
#[Guards\Jwt]
|
#[Guards\Jwt]
|
||||||
#[Guards\Scope(['post.index'])]
|
#[Guards\Scope(['post.index'])]
|
||||||
#[OA\Post(path: '/')]
|
#[OA\Post(path: '/', tags: ['Examples'])]
|
||||||
#[OA\Response(
|
#[OA\Response(
|
||||||
response: '200',
|
response: '200',
|
||||||
description: 'An Example Response',
|
description: 'An Example Response',
|
||||||
|
|||||||
Reference in New Issue
Block a user