Skip to content

Commit d20586a

Browse files
committed
fix: handle multiline description
1 parent f71bfa9 commit d20586a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/openApiToZod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ export const getZodChain = ({ schema, meta, options }: ZodChainArgs) => {
265265
.with("array", () => chains.push(getZodChainableArrayValidations(schema)))
266266
.otherwise(() => void 0);
267267

268-
if (typeof schema.description === "string" && schema.description !== "" && options?.withDescription) {
269-
chains.push(`describe("${schema.description}")`);
268+
if (options?.withDescription && typeof schema.description === "string" && schema.description !== "") {
269+
chains.push(`describe(\`${schema.description}\`)`);
270270
}
271271

272272
const output = chains

0 commit comments

Comments
 (0)