Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Version 24

### v24.7.2

- Fixed the negative response MIME type for ~~`arrayResultHandler`~~ (deprecated entity):
- Should have been `text/plain`.

### v24.7.1

- Compatibility fix for `zod@^3.25.68` and `^4.0.0`:
Expand Down
4 changes: 2 additions & 2 deletions example/example.documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ paths:
"400":
description: GET /v1/user/list Negative response
content:
application/json:
text/plain:
schema:
type: string
examples:
Expand All @@ -457,7 +457,7 @@ paths:
"400":
description: HEAD /v1/user/list Negative response
content:
application/json:
text/plain:
schema:
type: string
examples:
Expand Down
5 changes: 4 additions & 1 deletion express-zod-api/src/result-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ export const arrayResultHandler = new ResultHandler({
}
return responseSchema;
},
negative: z.string().example("Sample error message"),
negative: {
schema: z.string().example("Sample error message"),
mimeType: "text/plain",
},
handler: ({ response, output, error, logger, request, input }) => {
if (error) {
const httpError = ensureHttpError(error);
Expand Down