fix(server): return diagnosable body for schema rejections (#26631)

This commit is contained in:
Kit Langton
2026-05-10 12:21:32 -04:00
committed by GitHub
parent cc2915be16
commit 049502fac6
10 changed files with 606 additions and 324 deletions
@@ -178,17 +178,20 @@ function addLegacyErrorSchemas(spec: OpenApiSpec) {
if (!spec.components?.schemas) return
spec.components.schemas.BadRequestError = {
type: "object",
required: ["data", "errors", "success"],
required: ["name", "data"],
properties: {
data: {},
errors: {
type: "array",
items: {
type: "object",
additionalProperties: {},
name: { type: "string", enum: ["BadRequest"] },
data: {
type: "object",
required: ["message"],
properties: {
message: { type: "string" },
kind: {
type: "string",
enum: ["Params", "Headers", "Query", "Body", "Payload"],
},
},
},
success: { type: "boolean", enum: [false] },
},
}
spec.components.schemas.NotFoundError = {