Skip to content

Commit 817a603

Browse files
committed
Add missing schema to update:examples script
1 parent 69984d9 commit 817a603

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

packages/openapi-typescript/scripts/update-examples.ts

+21-23
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,27 @@ async function generateSchemas() {
2222
: rootCWD;
2323

2424
try {
25-
await Promise.all([
26-
execa("./bin/cli.js", [`./examples/${name}${ext}`, "-o", `./examples/${name}.ts`], { cwd }),
27-
...(name === "github-api"
28-
? [
29-
execa(
30-
"./bin/cli.js",
31-
[
32-
`./examples/${name}${ext}`,
33-
"--immutable",
34-
"--export-type",
35-
"-o",
36-
`./examples/${name}-export-type-immutable.ts`,
37-
],
38-
{ cwd },
39-
),
40-
execa(
41-
"./bin/cli.js",
42-
[`./examples/${name}${ext}`, "--immutable", "-o", `./examples/${name}-immutable.ts`],
43-
{ cwd },
44-
),
45-
]
46-
: []),
47-
]);
25+
const args: string[][] = [[`./examples/${name}${ext}`, "-o", `./examples/${name}.ts`]];
26+
27+
// addiitonal flag tests (only for GitHub API, arbitrarily-chosen so we don’t have too much noise)
28+
if (name === "github-api") {
29+
args.push([`./examples/${name}${ext}`, "--immutable", "-o", `./examples/${name}-immutable.ts`]);
30+
args.push([
31+
`./examples/${name}${ext}`,
32+
"--immutable",
33+
"--export-type",
34+
"-o",
35+
`./examples/${name}-export-type-immutable.ts`,
36+
]);
37+
args.push([
38+
`./examples/${name}${ext}`,
39+
"--properties-required-by-default",
40+
"o",
41+
`./examples/${name}-required.ts`,
42+
]);
43+
}
44+
45+
await Promise.all(args.map((a) => execa("./bin/cli.js", a, { cwd })));
4846

4947
schemasDoneCount++;
5048
const timeMs = Math.round(performance.now() - start);

0 commit comments

Comments
 (0)