Skip to content

Commit 5262b18

Browse files
authored
Merge pull request #1430 from ponmileleke54-dev/#1232
fix(api): standardize error response envelope
2 parents 2e69fa4 + cd7837d commit 5262b18

19 files changed

Lines changed: 236 additions & 256 deletions

backend/src/config/swagger.ts

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -481,27 +481,20 @@ See [Sandbox Mode Documentation](../docs/SANDBOX_MODE.md) for details.`,
481481
type: 'object',
482482
properties: {
483483
error: {
484-
type: 'string',
485-
description: 'Error message',
486-
example: 'Resource not found',
487-
},
488-
code: {
489-
type: 'string',
490-
description: 'Error code',
491-
example: 'NOT_FOUND',
492-
},
493-
message: {
494-
type: 'string',
495-
nullable: true,
496-
description: 'Human-readable detail (present on many error responses)',
497-
},
498-
details: {
499-
type: 'array',
500-
nullable: true,
501-
description: 'Structured validation issues (zod) when the error is a 400',
502-
items: { type: 'object' },
484+
type: 'object',
485+
required: ['code', 'message'],
486+
properties: {
487+
code: { type: 'string', example: 'NOT_FOUND' },
488+
message: { type: 'string', example: 'Resource not found' },
489+
details: {
490+
type: 'array',
491+
description: 'Structured validation issues when applicable',
492+
items: { type: 'object' },
493+
},
494+
},
503495
},
504496
},
497+
required: ['error'],
505498
},
506499
},
507500
},

0 commit comments

Comments
 (0)