Skip to content

Commit 062899f

Browse files
committed
Generate zod extended files fix
1 parent 6ba43d9 commit 062899f

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@povio/openapi-codegen-cli",
3-
"version": "0.13.4",
3+
"version": "0.13.5",
44
"main": "./dist/index.js",
55
"bin": {
66
"openapi-codegen": "./dist/sh.js"

src/generators/utils/generate-files.utils.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,7 @@ export function getStandaloneFiles(resolver: SchemaResolver): GenerateFileData[]
7979
}
8080

8181
export function getZodExtendedFiles(data: GenerateData, resolver: SchemaResolver): GenerateFileData[] {
82-
const hasZodExtendedFile = Array.from(data.values()).some(({ endpoints }) =>
83-
endpoints.some((endpoint) => endpoint.parameters.some((param) => param.parameterSortingEnumSchemaName)),
84-
);
85-
if (!hasZodExtendedFile) {
86-
return [];
87-
}
88-
89-
const zodContent = generateZod(resolver);
90-
if (!zodContent) {
82+
if (!resolver.options.parseRequestParams) {
9183
return [];
9284
}
9385

@@ -97,7 +89,7 @@ export function getZodExtendedFiles(data: GenerateData, resolver: SchemaResolver
9789
output: resolver.options.output,
9890
fileName: getFileNameWithExtension(ZOD_EXTENDED_FILE),
9991
}),
100-
content: zodContent,
92+
content: generateZod(resolver),
10193
},
10294
];
10395
}

0 commit comments

Comments
 (0)