openapi-typescript version
7.10.1
Node.js version
24.7.0
OS + version
macOS 15.6.1
Description
This unfortunately burned way too much of my time to manually stick debug prints and find out how the parsing works.
When providing flags such as --array-length as the first parameters, the CLI will interpret them as part of the schema-file instead of flags and just hang during the resolution under this code:
if (schema instanceof node_stream.Readable) {
const contents = await new Promise((resolve) => {
schema.resume();
schema.setEncoding("utf8");
let content = "";
schema.on("data", (chunk) => {
content += chunk;
});
schema.on("end", () => {
resolve(content.trim());
});
});
Reproduction
Run any flag such as --array-length before providing the schema
DEBUG=* npx openapi-typescript --array-length ./openapi.json -o ./generated-api.d.ts
Expected result
Parse flags using a CLI library such as yargs OR validate a minimal startswith("-") to alert user of how to use
Required
Extra
openapi-typescript version
7.10.1
Node.js version
24.7.0
OS + version
macOS 15.6.1
Description
This unfortunately burned way too much of my time to manually stick debug prints and find out how the parsing works.
When providing flags such as
--array-lengthas the first parameters, the CLI will interpret them as part of the schema-file instead of flags and just hang during the resolution under this code:Reproduction
Run any flag such as
--array-lengthbefore providing the schemaDEBUG=* npx openapi-typescript --array-length ./openapi.json -o ./generated-api.d.tsExpected result
Parse flags using a CLI library such as
yargsOR validate a minimalstartswith("-")to alert user of how to useRequired
npx @redocly/cli@latest lint)Extra