文件操作 - no-http-verbs-in-paths.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js
编辑文件内容
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NoHttpVerbsInPaths = void 0; const utils_1 = require("../../utils"); const httpMethods = ['get', 'head', 'post', 'put', 'patch', 'delete', 'options', 'trace']; const NoHttpVerbsInPaths = ({ splitIntoWords }) => { return { PathItem(_path, { key, report, location }) { const pathKey = key.toString(); if (!pathKey.startsWith('/')) return; const pathSegments = pathKey.split('/'); for (const pathSegment of pathSegments) { if (!pathSegment || (0, utils_1.isPathParameter)(pathSegment)) continue; const isHttpMethodIncluded = (method) => { return splitIntoWords ? (0, utils_1.splitCamelCaseIntoWords)(pathSegment).has(method) : pathSegment.toLocaleLowerCase().includes(method); }; for (const method of httpMethods) { if (isHttpMethodIncluded(method)) { report({ message: `path \`${pathKey}\` should not contain http verb ${method}`, location: location.key(), }); } } } }, }; }; exports.NoHttpVerbsInPaths = NoHttpVerbsInPaths;
修改文件时间
将文件时间修改为当前时间的前一年
删除文件