Skip to content

Commit c1e17ad

Browse files
committed
fix: update error property
1 parent 8b1d27a commit c1e17ad

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/common/decorators/base-endpoint/base-endpoint.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,31 @@ export function Endpoint(options: ApiEndpointOptions) {
5656
properties: {
5757
message: { type: 'string' },
5858
statusCode: { type: 'number', example: 400 },
59-
errors: { type: 'array', items: { type: 'object' } },
59+
errors: {
60+
type: 'array',
61+
items: {
62+
type: 'object',
63+
properties: {
64+
validation: { type: 'string', example: 'uuid' },
65+
code: { type: 'string', example: 'invalid_string' },
66+
message: { type: 'string', example: 'Invalid uuid' },
67+
path: {
68+
type: 'array',
69+
items: { type: 'string' },
70+
example: ['uuid'],
71+
},
72+
},
73+
required: ['validation', 'code', 'message', 'path'],
74+
},
75+
example: [
76+
{
77+
validation: 'uuid',
78+
code: 'invalid_string',
79+
message: 'Invalid uuid',
80+
path: ['uuid'],
81+
},
82+
],
83+
},
6084
},
6185
},
6286
}),

0 commit comments

Comments
 (0)