From 7e654c275e89df4ea6234f60999c1176d3b560c6 Mon Sep 17 00:00:00 2001 From: Qluxzz Date: Tue, 17 Mar 2026 21:56:31 +0100 Subject: [PATCH 1/4] kebab-case boolean flags --- packages/openapi-typescript/bin/cli.js | 36 +++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/openapi-typescript/bin/cli.js b/packages/openapi-typescript/bin/cli.js index 31be6e795..d3395ff01 100755 --- a/packages/openapi-typescript/bin/cli.js +++ b/packages/openapi-typescript/bin/cli.js @@ -73,29 +73,29 @@ if (args.includes("--root-types-keep-casing") && !args.includes("--root-types")) } const BOOLEAN_FLAGS = [ - "additionalProperties", + "additional-properties", "alphabetize", - "arrayLength", + "array-length", "check", - "conditionalEnums", - "contentNever", - "dedupeEnums", - "defaultNonNullable", - "emptyObjectsUnknown", + "conditional-enums", + "content-never", + "dedupe-enums", + "default-non-nullable", + "empty-objects-unknown", "enum", - "enumValues", - "excludeDeprecated", - "exportType", - "generatePathParams", + "enum-values", + "exclude-deprecated", + "export-type", + "generate-path-params", "help", "immutable", - "makePathsEnum", - "pathParamsAsTypes", - "propertiesRequiredByDefault", - "readWriteMarkers", - "rootTypes", - "rootTypesKeepCasing", - "rootTypesNoSchemaPrefix", + "make-paths-enum", + "path-params-as-types", + "properties-required-by-default", + "read-write-markers", + "root-types", + "root-types-keep-casing", + "root-types-no-schema-prefix", ]; const flags = parser(args, { From baa08f19f29b13a90b6fa4d40209156c298d32e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Andersson?= Date: Tue, 17 Mar 2026 22:21:53 +0100 Subject: [PATCH 2/4] Add changest --- .changeset/flat-bugs-type.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/flat-bugs-type.md diff --git a/.changeset/flat-bugs-type.md b/.changeset/flat-bugs-type.md new file mode 100644 index 000000000..390d1d3dd --- /dev/null +++ b/.changeset/flat-bugs-type.md @@ -0,0 +1,5 @@ +--- +"openapi-typescript": patch +--- + +Fix boolean flags not being parsed as bools and thus consuming the input argument if it is given last From 7b990f14d479389355c58dfed3dbd4328e8fb840 Mon Sep 17 00:00:00 2001 From: Qluxzz Date: Tue, 17 Mar 2026 23:03:32 +0100 Subject: [PATCH 3/4] Add test that previously timed out since we got stuck waiting for stdin --- packages/openapi-typescript/test/cli.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/openapi-typescript/test/cli.test.ts b/packages/openapi-typescript/test/cli.test.ts index b61aed0d5..b575e3570 100644 --- a/packages/openapi-typescript/test/cli.test.ts +++ b/packages/openapi-typescript/test/cli.test.ts @@ -44,6 +44,14 @@ describe("CLI", () => { ci: { timeout: TIMEOUT }, }, ], + [ + "snapshot > GitHub API (root types, input file last)", + { + given: ["--root-types", "./examples/github-api.yaml"], + want: new URL("./examples/github-api-root-types.ts", root), + ci: { timeout: TIMEOUT }, + }, + ], [ "snapshot > GitHub API (next)", { From fdd08892894ebcb987c9206bfaa0c2b9ffd28504 Mon Sep 17 00:00:00 2001 From: Qluxzz Date: Tue, 17 Mar 2026 23:15:04 +0100 Subject: [PATCH 4/4] Add another test that previously timed out due to waiting on stdin --- packages/openapi-typescript/test/cli.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/openapi-typescript/test/cli.test.ts b/packages/openapi-typescript/test/cli.test.ts index b575e3570..f6941f258 100644 --- a/packages/openapi-typescript/test/cli.test.ts +++ b/packages/openapi-typescript/test/cli.test.ts @@ -92,6 +92,14 @@ describe("CLI", () => { ci: { timeout: TIMEOUT }, }, ], + [ + "snapshot > enum root types filtering, input file last", + { + given: ["--root-types", "--enum", "--root-types-no-schema-prefix", "./examples/enum-root-types.yaml"], + want: new URL("./examples/enum-root-types.ts", root), + ci: { timeout: TIMEOUT }, + }, + ], ]; for (const [testName, { given, want, ci }] of tests) {