UNPKG

@redocly/openapi-core

Version:

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

17 lines 614 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]), }); } seenOperations.add(operation.operationId); }, }; }; //# sourceMappingURL=operation-operationId-unique.js.map