···88 * future, we should add a strict check and throw on duplicate identifiers.
99 */
1010export const ensureUniqueOperationId = ({
1111+ context,
1112 id,
1213 method,
1314 operationIds,
1415 path,
1516}: {
1717+ context: IR.Context;
1618 id: string | undefined;
1719 method: IR.OperationObject['method'];
1820 operationIds: Map<string, string>;
···2527 const operationKey = `${method.toUpperCase()} ${path}`;
26282729 if (operationIds.has(id)) {
2828- // TODO: parser - support throw on duplicate
2929- console.warn(
3030- `❗️ Duplicate operationId: ${id} in ${operationKey}. Please ensure your operation IDs are unique. This behavior is not supported and will likely lead to unexpected results.`,
3131- );
3030+ if (context.config.logs.level !== 'silent') {
3131+ // TODO: parser - support throw on duplicate
3232+ console.warn(
3333+ `❗️ Duplicate operationId: ${id} in ${operationKey}. Please ensure your operation IDs are unique. This behavior is not supported and will likely lead to unexpected results.`,
3434+ );
3535+ }
3236 } else {
3337 operationIds.set(id, operationKey);
3438 }