UNPKG

@redocly/openapi-core

Version:

See https://github.com/Redocly/redocly-cli

18 lines 716 B
export const OperationIdUnique = () => { const seenOperations = new Set(); return { Operation(operation, { report, location }) { if (!operation.operationId) return; if (seenOperations.has(operation.operationId)) { report({ message: 'Every operation must have a unique `operationId`.', location: location.child([operation.operationId]), reference: 'https://redocly.com/docs/cli/rules/oas/operation-operationId-unique', }); } seenOperations.add(operation.operationId); }, }; }; //# sourceMappingURL=operation-operationId-unique.js.map