Skip to content

Commit 33fe292

Browse files
committed
Fail on duplicated operation IDs
1 parent 9f08532 commit 33fe292

File tree

2 files changed

+18
-42
lines changed

2 files changed

+18
-42
lines changed

packages/openapi-typescript/src/index.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,18 @@ export default async function openapiTS(
4848
}
4949

5050
const redoc =
51-
options.redocly ?? (await createConfig({}, { extends: ["minimal"] }));
51+
options.redocly ??
52+
(await createConfig(
53+
{
54+
// @ts-expect-error This is OK
55+
styleguide: {
56+
rules: {
57+
"operation-operationId-unique": { severity: "error" }, // throw error on duplicate operationIDs
58+
},
59+
},
60+
},
61+
{ extends: ["minimal"] },
62+
));
5263

5364
const schema = await validateAndBundle(source, {
5465
redoc,

pnpm-lock.yaml

+6-41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)