Skip to content

Commit daa2da6

Browse files
committed
mv doesImplyContent into depictResponse.
1 parent 8446e98 commit daa2da6

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

express-zod-api/src/documentation-helpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { z } from "zod/v4";
2828
import { ResponseVariant } from "./api-response";
2929
import { ezBufferBrand } from "./buffer-schema";
3030
import {
31+
doesImplyContent,
3132
FlatObject,
3233
getRoutePathParams,
3334
getTransformedType,
@@ -498,7 +499,7 @@ export const depictResponse = ({
498499
statusCode: number;
499500
hasMultipleStatusCodes: boolean;
500501
}): ResponseObject => {
501-
if (!mimeTypes) return { description };
502+
if (!mimeTypes || !doesImplyContent(method, variant)) return { description };
502503
const response = asOAS(
503504
depict(schema, {
504505
rules: { ...brandHandling, ...depicters },

express-zod-api/src/documentation.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ import * as R from "ramda";
1111
import { responseVariants } from "./api-response";
1212
import { contentTypes } from "./content-type";
1313
import { DocumentationError } from "./errors";
14-
import {
15-
doesImplyContent,
16-
getInputSources,
17-
makeCleanId,
18-
} from "./common-helpers";
14+
import { getInputSources, makeCleanId } from "./common-helpers";
1915
import { CommonConfig } from "./config-type";
2016
import { processContainers } from "./logical-container";
2117
import { ClientMethod } from "./method";
@@ -205,7 +201,7 @@ export class Documentation extends OpenApiBuilder {
205201
...commons,
206202
variant,
207203
schema,
208-
mimeTypes: doesImplyContent(method, variant) ? mimeTypes : null,
204+
mimeTypes,
209205
statusCode,
210206
hasMultipleStatusCodes:
211207
apiResponses.length > 1 || statusCodes.length > 1,

0 commit comments

Comments
 (0)