Skip to content

Commit

Permalink
fix: pass options when shouldExportAllSchemas is true
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurGoupil authored and astahmer committed Sep 27, 2023
1 parent 85f496d commit efebdf2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/options-passed-when-shouldExportAllSchemas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"openapi-zod-client": patch
---

Pass options object to `getZodSchema` when `shouldExportAllSchemas` is true.
2 changes: 1 addition & 1 deletion lib/src/template-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const getZodClientTemplateContext = (
if (options?.shouldExportAllSchemas) {
Object.entries(docSchemas).forEach(([name, schema]) => {
if (!result.zodSchemaByName[name]) {
result.zodSchemaByName[name] = getZodSchema({ schema, ctx: result }).toString();
result.zodSchemaByName[name] = getZodSchema({ schema, ctx: result, options }).toString();
}
});
}
Expand Down

1 comment on commit efebdf2

@vercel
Copy link

@vercel vercel bot commented on efebdf2 Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.