文件操作 - response-contains-property.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/@redocly/openapi-core/lib/rules/oas2/response-contains-property.js
编辑文件内容
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ResponseContainsProperty = void 0; const utils_1 = require("../../utils"); const ResponseContainsProperty = (options) => { const names = options.names || {}; let key; return { Operation: { Response: { skip: (_response, key) => { return `${key}` === '204'; }, enter: (_response, ctx) => { key = ctx.key; }, Schema(schema, { report, location }) { if (schema.type !== 'object') return; const expectedProperties = names[key] || names[(0, utils_1.getMatchingStatusCodeRange)(key)] || names[(0, utils_1.getMatchingStatusCodeRange)(key).toLowerCase()] || []; for (const expectedProperty of expectedProperties) { if (!schema.properties?.[expectedProperty]) { report({ message: `Response object must contain a top-level "${expectedProperty}" property.`, location: location.child('properties').key(), }); } } }, }, }, }; }; exports.ResponseContainsProperty = ResponseContainsProperty;
修改文件时间
将文件时间修改为当前时间的前一年
删除文件