Skip to content

Commit e23b42d

Browse files
imballinstastahmer
authored andcommitted
feat: reduce dependency count threshold for a type to be imported from common file to just 1
1 parent 4254b72 commit e23b42d

File tree

3 files changed

+604
-126
lines changed

3 files changed

+604
-126
lines changed

.changeset/seven-hotels-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-zod-client": minor
3+
---
4+
5+
feat: reduce dependency count threshold for a type to be imported from common file to just 1

lib/src/template-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export const getZodClientTemplateContext = (
175175
const groupTypes = {} as Record<string, string>;
176176
Object.entries(group.schemas).forEach(([name, schema]) => {
177177
const count = dependenciesCount.get(name) ?? 0;
178-
if (count > 1) {
178+
if (count >= 1) {
179179
group.imports![name] = "common";
180180
commonSchemaNames.add(name);
181181
} else {

0 commit comments

Comments
 (0)