文件操作 - operation-operationId-unique.ts
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/@redocly/openapi-core/src/rules/common/operation-operationId-unique.ts
编辑文件内容
import type { Oas3Rule, Oas2Rule } from '../../visitors'; import type { Oas2Operation } from '../../typings/swagger'; import type { Oas3Operation } from '../../typings/openapi'; import type { UserContext } from '../../walk'; export const OperationIdUnique: Oas3Rule | Oas2Rule = () => { const seenOperations = new Set(); return { Operation(operation: Oas2Operation | Oas3Operation, { report, location }: UserContext) { 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); }, }; };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件