Skip to content

Commit 891f03f

Browse files
committed
Fail on duplicated operation IDs
1 parent 9f08532 commit 891f03f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/openapi-typescript/src/index.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,17 @@ 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+
styleguide: {
55+
rules: {
56+
"operation-operationId-unique": { severity: "error" }, // throw error on duplicate operationIDs
57+
},
58+
},
59+
},
60+
{ extends: ["minimal"] },
61+
));
5262

5363
const schema = await validateAndBundle(source, {
5464
redoc,

0 commit comments

Comments
 (0)