fix: missing 422 error code in openapi spec

This commit is contained in:
elmariss committed 2025-10-12 14:20:45 +02:00
1 parent 4b34a7d8b2
commit 737ec521b6
10 files changed
+368 -38

No files matched your search

+21
View File
@@ -40,6 +40,27 @@ use OpenApi\Attributes as OA;
new OA\Property(property: 'message', type: 'string', example: 'Resource not found.'),
]
)),
new OA\Response(
response: 422,
description: 'Validation error.',
content: new OA\JsonContent(
type: 'object',
properties: [
new OA\Property(property: 'message', type: 'string', example: 'Validation error.'),
new OA\Property(
property: 'errors',
type: 'object',
additionalProperties: new OA\AdditionalProperties(
type: 'array',
items: new OA\Items(type: 'string')
),
example: [
'name' => ['The name field is required.'],
'api_url' => ['The api url field is required.', 'The api url format is invalid.'],
]
),
]
)),
],
)]
class OpenApi