next-rest-framework
next-rest-framework copied to clipboard
Missing 400 response body structure
The generated OpenAPI spec describes 400 error responses as having this structure:
{
"type": "object",
"properties": { "message": { "type": "string" } },
"required": ["message"],
"additionalProperties": false
}
They actually include error output from zod:
{
"message": "Invalid request body.",
"errors": [
{
"code": "invalid_string",
"validation": "datetime",
"message": "Invalid datetime",
"path": [
"foo"
]
}
]
}
Ideally the OpenAPI spec should include this so generated clients can access the errors.