文件操作 - no-invalid-schema-examples.ts
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/@redocly/openapi-core/src/rules/common/no-invalid-schema-examples.ts
编辑文件内容
import { getAdditionalPropertiesOption, validateExample } from '../utils'; import type { UserContext } from '../../walk'; import type { Oas3_1Schema } from '../../typings/openapi'; export const NoInvalidSchemaExamples: any = (opts: any) => { const allowAdditionalProperties = getAdditionalPropertiesOption(opts) ?? false; return { Schema: { leave(schema: Oas3_1Schema, ctx: UserContext) { if (schema.examples) { for (const example of schema.examples) { validateExample( example, schema, ctx.location.child(['examples', schema.examples.indexOf(example)]), ctx, allowAdditionalProperties ); } } if (schema.example !== undefined) { validateExample(schema.example, schema, ctx.location.child('example'), ctx, true); } }, }, }; };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件