From 5a736fc0ddb50422b71121d50ba9e0e7bc31ced2 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 12 Jul 2026 13:06:12 +0100 Subject: [PATCH 1/2] feat: use hyperjump/json-schema for validating input documents --- .gitattributes | 3 - .gitignore | 1 + AGENTS.md | 4 - docs/architecture.md | 2 +- package.json | 5 +- packages/openapi-code-generator/package.json | 5 +- .../src/core/loaders/typespec.loader.ts | 3 +- .../src/core/openapi-validator.spec.ts | 7 +- .../src/core/openapi-validator.ts | 85 +- .../src/core/schemas/IValidateFunction.ts | 13 +- .../openapi-3.0-specification-validator.ts | 18764 ---------------- .../openapi-3.1-specification-validator.ts | 15 - pnpm-lock.yaml | 117 +- pnpm-workspace.yaml | 1 + scripts/ci-pipeline.sh | 4 +- scripts/generate-ajv-validator.js | 169 - scripts/generate-webstorm-runconfigs.mjs | 93 + 17 files changed, 278 insertions(+), 19013 deletions(-) delete mode 100644 packages/openapi-code-generator/src/core/schemas/openapi-3.0-specification-validator.ts delete mode 100644 packages/openapi-code-generator/src/core/schemas/openapi-3.1-specification-validator.ts delete mode 100755 scripts/generate-ajv-validator.js create mode 100755 scripts/generate-webstorm-runconfigs.mjs diff --git a/.gitattributes b/.gitattributes index cfb8ddfdc..db3ba934e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,4 @@ -# Pre-compiled ajv validators generated by ./scripts/generate-ajv-validator.js # Any uncommitted changes will be rejected by CI using ./scripts/assert-clean-working-directory.sh -packages/openapi-code-generater/src/core/schemas/openapi-3.0-specification-validator.js linguist-generated=true -packages/openapi-code-generater/src/core/schemas/openapi-3.1-specification-validator.js linguist-generated=true integration-tests/*/src/generated/** linguist-generated=true e2e/src/generated/** linguist-generated=true integration-tests-definitions/** linguist-vendored=true diff --git a/.gitignore b/.gitignore index 68aef61dc..be51ba819 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ next-env.d.ts .plandex-v2 .plandexignore .junie +.run diff --git a/AGENTS.md b/AGENTS.md index e478ac7da..9100f06f5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,10 +13,6 @@ This is a monorepo managed with `pnpm`. It produces a CLI tool for generating hi - `integration-tests-definitions/`: Contains source specifications. - `integration-tests/*/src/generated/`: Contains generated code. - `tsconfig.tsbuildinfo`: Compiler state files. -- **Generated Files**: - - `src/core/schemas/openapi-3.0-specification-validator.js` - - `src/core/schemas/openapi-3.1-specification-validator.js` - - (These are generated by `ajv` during the build process). ## Development Workflow diff --git a/docs/architecture.md b/docs/architecture.md index 551d19b91..1be2d55c8 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -8,7 +8,7 @@ This document describes the high-level architecture, package structure, and comm The system follows a typical compiler/generator pipeline: 1. **Loading**: Specifications are loaded and resolved (including remote/local references). -2. **Validation**: Loaded specifications are validated against their respective schemas using pre-compiled AJV validators. +2. **Validation**: Loaded specifications are validated against their respective schemas using `@hyperjump/json-schema` 3. **Normalization**: The specification is transformed into a normalized Intermediate Representation (IR). 4. **Building**: Template-specific builders transform the IR into code structures (types, schemas, clients/routers). 5. **Emission**: The generated structures are formatted and written to the file system. diff --git a/package.json b/package.json index 2bbea2b0a..92e01be5e 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "docs:generate": "node ./scripts/generate-toc.mjs", "refresh": "./scripts/refresh-data.sh", "lint": "biome check --fix .", - "build": "node ./scripts/generate-ajv-validator.js && pnpm run -r --workspace-concurrency=4 bundle && tsc -b tsconfig.json", + "build": "pnpm run -r --workspace-concurrency=4 bundle && tsc -b tsconfig.json", "build:docs": "pnpm --filter @nahkies/openapi-code-generator-documentation run build", "build:watch": "tsc -b tsconfig.json -w", "test": "vitest run", @@ -51,9 +51,6 @@ "@tsconfig/strictest": "^2.0.8", "@types/node": "^22.20.0", "@vitest/coverage-v8": "catalog:", - "ajv": "^8.20.0", - "ajv-draft-04": "^1.0.0", - "ajv-formats": "^3.0.1", "commander": "catalog:", "conventional-changelog-conventionalcommits": "catalog:", "husky": "^9.1.7", diff --git a/packages/openapi-code-generator/package.json b/packages/openapi-code-generator/package.json index 63083ba98..d3b79e744 100644 --- a/packages/openapi-code-generator/package.json +++ b/packages/openapi-code-generator/package.json @@ -89,9 +89,8 @@ "@biomejs/js-api": "catalog:", "@biomejs/wasm-nodejs": "catalog:", "@commander-js/extra-typings": "catalog:", - "ajv": "^8.20.0", - "ajv-draft-04": "^1.0.0", - "ajv-formats": "^3.0.1", + "@hyperjump/json-schema": "catalog:", + "@hyperjump/json-schema-errors": "github:hyperjump-io/json-schema-errors#429b18eb914fa1e01b23f38519e4da240e4113d8", "commander": "catalog:", "js-yaml": "catalog:", "json5": "^2.2.3", diff --git a/packages/openapi-code-generator/src/core/loaders/typespec.loader.ts b/packages/openapi-code-generator/src/core/loaders/typespec.loader.ts index 2e6b2f2dc..0f9a0bc5f 100644 --- a/packages/openapi-code-generator/src/core/loaders/typespec.loader.ts +++ b/packages/openapi-code-generator/src/core/loaders/typespec.loader.ts @@ -72,7 +72,8 @@ export class TypespecLoader { throw new Error("no versions returned") } - return newestVersion.document + // remove undefined properties, as the validator will reject these. + return JSON.parse(JSON.stringify(newestVersion.document)) } static async create( diff --git a/packages/openapi-code-generator/src/core/openapi-validator.spec.ts b/packages/openapi-code-generator/src/core/openapi-validator.spec.ts index 0330ac2d5..dc2a2da26 100644 --- a/packages/openapi-code-generator/src/core/openapi-validator.spec.ts +++ b/packages/openapi-code-generator/src/core/openapi-validator.spec.ts @@ -49,7 +49,7 @@ describe("core/openapi-validator", () => { true, ), ).rejects.toThrow( - "Validation failed: -> must NOT have fewer than 1 properties at path '/paths/~1something/get/responses'", + "Validation failed: -> Expected an object with at least '1' properties at path '#/paths/~1something/get/responses' ({\"schemaLocations\":[\"https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Responses/minProperties\"]})", ) }) }) @@ -89,7 +89,7 @@ describe("core/openapi-validator", () => { ).resolves.toBeUndefined() }) - it.skip("should reject an invalid specification", async () => { + it("should reject an invalid specification", async () => { const validator = await OpenapiValidator.create() await expect( validator.validate( @@ -111,7 +111,8 @@ describe("core/openapi-validator", () => { true, ), ).rejects.toThrow( - "Validation failed: -> must NOT have fewer than 1 properties at path '/paths/~1something/get/responses'", + "Validation failed: -> Expected an object with at least '1' properties at path '#/paths/~1something/get/responses' ({\"schemaLocations\":[\"https://spec.openapis.org/oas/3.1/schema#/$defs/responses/minProperties\"]})\n" + + "-> Missing required 'property: 'default'' at path '#/paths/~1something/get/responses' ({\"schemaLocations\":[\"https://spec.openapis.org/oas/3.1/schema#/$defs/responses/then/required\"]})", ) }) }) diff --git a/packages/openapi-code-generator/src/core/openapi-validator.ts b/packages/openapi-code-generator/src/core/openapi-validator.ts index 0fac19f89..ea454dfe8 100644 --- a/packages/openapi-code-generator/src/core/openapi-validator.ts +++ b/packages/openapi-code-generator/src/core/openapi-validator.ts @@ -1,7 +1,17 @@ +import type {Json} from "@hyperjump/json-pointer" +import type { + Output, + OutputFormat, + ValidationOptions, +} from "@hyperjump/json-schema/lib/index.d.ts" +import {validate as validate3_0} from "@hyperjump/json-schema/openapi-3-0" +import {validate as validate3_1} from "@hyperjump/json-schema/openapi-3-1" +import { + jsonSchemaErrors, + setNormalizationHandler, +} from "@hyperjump/json-schema-errors" import {logger} from "./logger.ts" import type {ValidateFunction} from "./schemas/IValidateFunction.ts" -import validate3_0 from "./schemas/openapi-3.0-specification-validator.ts" -import validate3_1 from "./schemas/openapi-3.1-specification-validator.ts" export interface IOpenapiValidator { validate(filename: string, schema: unknown, strict?: boolean): Promise @@ -41,7 +51,7 @@ export class OpenapiValidator implements IOpenapiValidator { "unknown" const validate = this.validationFunction(version) - const isValid = validate(schema) + const {isValid, errors} = await validate(schema) if (!isValid) { logger.warn(`Found errors validating '${filename}'.`) @@ -50,10 +60,16 @@ export class OpenapiValidator implements IOpenapiValidator { ) const messages = - validate.errors?.map((err) => { + errors.map((err) => { return [ - `-> ${err.message} at path '${err.instancePath}'`, - err.params, + `-> ${err.message} at path '${err.instanceLocation}'`.replace( + /[\u202A-\u202E\u2066-\u2069]/g, + "'", + ), + { + schemaLocations: err.schemaLocations, + alternatives: err.alternatives, + }, ] as const }) ?? [] @@ -76,22 +92,51 @@ export class OpenapiValidator implements IOpenapiValidator { static async create( onValidationFailed: (filename: string) => Promise = async () => {}, ): Promise { - const skipValidationLoadSpecificationError: ValidateFunction = () => { - return true - } + setNormalizationHandler("https://json-schema.org/keyword/comment", { + evaluate() { + // Only applicator keywords need to return a value + }, + }) + + return new OpenapiValidator( + wrapHyperjump(validate3_1, "https://spec.openapis.org/oas/3.1/schema"), + wrapHyperjump(validate3_0, "https://spec.openapis.org/oas/3.0/schema"), + onValidationFailed, + ) + } +} +function wrapHyperjump( + validate: ( + url: string, + value: Json, + options?: OutputFormat | ValidationOptions, + ) => Promise, + uri: string, +): ValidateFunction { + // biome-ignore lint/suspicious/noExplicitAny: unknown input + return async (it: any) => { try { - return new OpenapiValidator(validate3_1, validate3_0, onValidationFailed) - } catch (err) { - logger.warn( - "Skipping validation as failed to load schema specification", - {err}, - ) - return new OpenapiValidator( - skipValidationLoadSpecificationError, - skipValidationLoadSpecificationError, - onValidationFailed, - ) + const res = await validate(uri, it, "BASIC") + + if (res.valid) { + return {isValid: true, errors: []} + } + + const errors = await jsonSchemaErrors(res, uri, it) + return {isValid: false, errors} + } catch (err: unknown) { + return { + isValid: false, + errors: [ + { + message: err instanceof Error ? err.message : String(err), + alternatives: [], + schemaLocations: [], + instanceLocation: "", + }, + ], + } } } } diff --git a/packages/openapi-code-generator/src/core/schemas/IValidateFunction.ts b/packages/openapi-code-generator/src/core/schemas/IValidateFunction.ts index 075ae7eeb..38be33ca1 100644 --- a/packages/openapi-code-generator/src/core/schemas/IValidateFunction.ts +++ b/packages/openapi-code-generator/src/core/schemas/IValidateFunction.ts @@ -1,7 +1,8 @@ -import type {ErrorObject} from "ajv" +import type {JsonSchemaErrors} from "@hyperjump/json-schema-errors" -export interface ValidateFunction { - (data: unknown): boolean - - errors?: null | ErrorObject[] -} +export type ValidateFunction = ( + // biome-ignore lint/suspicious/noExplicitAny: unknown input + data: any, +) => Promise< + {isValid: true; errors: never[]} | {isValid: false; errors: JsonSchemaErrors} +> diff --git a/packages/openapi-code-generator/src/core/schemas/openapi-3.0-specification-validator.ts b/packages/openapi-code-generator/src/core/schemas/openapi-3.0-specification-validator.ts deleted file mode 100644 index 7e0e6f3d6..000000000 --- a/packages/openapi-code-generator/src/core/schemas/openapi-3.0-specification-validator.ts +++ /dev/null @@ -1,18764 +0,0 @@ -/** AUTOGENERATED - DO NOT EDIT **/ -// @ts-nocheck -/* istanbul ignore file */ -/* c8 ignore start */ -"use strict" -export const validate = validate10 -export default validate10 -const schema11 = { - id: "https://spec.openapis.org/oas/3.0/schema/2024-10-18", - $schema: "http://json-schema.org/draft-04/schema#", - description: "The description of OpenAPI v3.0.x Documents", - type: "object", - required: ["openapi", "info", "paths"], - properties: { - openapi: {type: "string", pattern: "^3\\.0\\.\\d(-.+)?$"}, - info: {$ref: "#/definitions/Info"}, - externalDocs: {$ref: "#/definitions/ExternalDocumentation"}, - servers: {type: "array", items: {$ref: "#/definitions/Server"}}, - security: { - type: "array", - items: {$ref: "#/definitions/SecurityRequirement"}, - }, - tags: { - type: "array", - items: {$ref: "#/definitions/Tag"}, - uniqueItems: true, - }, - paths: {$ref: "#/definitions/Paths"}, - components: {$ref: "#/definitions/Components"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - definitions: { - Reference: { - type: "object", - required: ["$ref"], - patternProperties: { - "^\\$ref$": {type: "string", format: "uri-reference"}, - }, - }, - Info: { - type: "object", - required: ["title", "version"], - properties: { - title: {type: "string"}, - description: {type: "string"}, - termsOfService: {type: "string", format: "uri-reference"}, - contact: {$ref: "#/definitions/Contact"}, - license: {$ref: "#/definitions/License"}, - version: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Contact: { - type: "object", - properties: { - name: {type: "string"}, - url: {type: "string", format: "uri-reference"}, - email: {type: "string", format: "email"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - License: { - type: "object", - required: ["name"], - properties: { - name: {type: "string"}, - url: {type: "string", format: "uri-reference"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Server: { - type: "object", - required: ["url"], - properties: { - url: {type: "string"}, - description: {type: "string"}, - variables: { - type: "object", - additionalProperties: {$ref: "#/definitions/ServerVariable"}, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - ServerVariable: { - type: "object", - required: ["default"], - properties: { - enum: {type: "array", items: {type: "string"}}, - default: {type: "string"}, - description: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Components: { - type: "object", - properties: { - schemas: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - }, - responses: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Response"}, - ], - }, - }, - }, - parameters: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Parameter"}, - ], - }, - }, - }, - examples: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Example"}, - ], - }, - }, - }, - requestBodies: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/RequestBody"}, - ], - }, - }, - }, - headers: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Header"}, - ], - }, - }, - }, - securitySchemes: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/SecurityScheme"}, - ], - }, - }, - }, - links: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Link"}, - ], - }, - }, - }, - callbacks: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Callback"}, - ], - }, - }, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Schema: { - type: "object", - properties: { - title: {type: "string"}, - multipleOf: {type: "number", minimum: 0, exclusiveMinimum: true}, - maximum: {type: "number"}, - exclusiveMaximum: {type: "boolean", default: false}, - minimum: {type: "number"}, - exclusiveMinimum: {type: "boolean", default: false}, - maxLength: {type: "integer", minimum: 0}, - minLength: {type: "integer", minimum: 0, default: 0}, - pattern: {type: "string", format: "regex"}, - maxItems: {type: "integer", minimum: 0}, - minItems: {type: "integer", minimum: 0, default: 0}, - uniqueItems: {type: "boolean", default: false}, - maxProperties: {type: "integer", minimum: 0}, - minProperties: {type: "integer", minimum: 0, default: 0}, - required: { - type: "array", - items: {type: "string"}, - minItems: 1, - uniqueItems: true, - }, - enum: {type: "array", items: {}, minItems: 1, uniqueItems: false}, - type: { - type: "string", - enum: ["array", "boolean", "integer", "number", "object", "string"], - }, - not: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - allOf: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - oneOf: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - anyOf: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - items: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - properties: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - {type: "boolean"}, - ], - default: true, - }, - description: {type: "string"}, - format: {type: "string"}, - default: {}, - nullable: {type: "boolean", default: false}, - discriminator: {$ref: "#/definitions/Discriminator"}, - readOnly: {type: "boolean", default: false}, - writeOnly: {type: "boolean", default: false}, - example: {}, - externalDocs: {$ref: "#/definitions/ExternalDocumentation"}, - deprecated: {type: "boolean", default: false}, - xml: {$ref: "#/definitions/XML"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Discriminator: { - type: "object", - required: ["propertyName"], - properties: { - propertyName: {type: "string"}, - mapping: {type: "object", additionalProperties: {type: "string"}}, - }, - }, - XML: { - type: "object", - properties: { - name: {type: "string"}, - namespace: {type: "string", format: "uri"}, - prefix: {type: "string"}, - attribute: {type: "boolean", default: false}, - wrapped: {type: "boolean", default: false}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Response: { - type: "object", - required: ["description"], - properties: { - description: {type: "string"}, - headers: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Header"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - content: { - type: "object", - additionalProperties: {$ref: "#/definitions/MediaType"}, - }, - links: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Link"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - MediaType: { - type: "object", - properties: { - schema: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - example: {}, - examples: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Example"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - encoding: { - type: "object", - additionalProperties: {$ref: "#/definitions/Encoding"}, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - allOf: [{$ref: "#/definitions/ExampleXORExamples"}], - }, - Example: { - type: "object", - properties: { - summary: {type: "string"}, - description: {type: "string"}, - value: {}, - externalValue: {type: "string", format: "uri-reference"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Header: { - type: "object", - properties: { - description: {type: "string"}, - required: {type: "boolean", default: false}, - deprecated: {type: "boolean", default: false}, - allowEmptyValue: {type: "boolean", default: false}, - style: {type: "string", enum: ["simple"], default: "simple"}, - explode: {type: "boolean"}, - allowReserved: {type: "boolean", default: false}, - schema: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - content: { - type: "object", - additionalProperties: {$ref: "#/definitions/MediaType"}, - minProperties: 1, - maxProperties: 1, - }, - example: {}, - examples: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Example"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - allOf: [ - {$ref: "#/definitions/ExampleXORExamples"}, - {$ref: "#/definitions/SchemaXORContent"}, - ], - }, - Paths: { - type: "object", - patternProperties: {"^\\/": {$ref: "#/definitions/PathItem"}, "^x-": {}}, - additionalProperties: false, - }, - PathItem: { - type: "object", - properties: { - $ref: {type: "string"}, - summary: {type: "string"}, - description: {type: "string"}, - get: {$ref: "#/definitions/Operation"}, - put: {$ref: "#/definitions/Operation"}, - post: {$ref: "#/definitions/Operation"}, - delete: {$ref: "#/definitions/Operation"}, - options: {$ref: "#/definitions/Operation"}, - head: {$ref: "#/definitions/Operation"}, - patch: {$ref: "#/definitions/Operation"}, - trace: {$ref: "#/definitions/Operation"}, - servers: {type: "array", items: {$ref: "#/definitions/Server"}}, - parameters: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Parameter"}, - {$ref: "#/definitions/Reference"}, - ], - }, - uniqueItems: true, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Operation: { - type: "object", - required: ["responses"], - properties: { - tags: {type: "array", items: {type: "string"}}, - summary: {type: "string"}, - description: {type: "string"}, - externalDocs: {$ref: "#/definitions/ExternalDocumentation"}, - operationId: {type: "string"}, - parameters: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Parameter"}, - {$ref: "#/definitions/Reference"}, - ], - }, - uniqueItems: true, - }, - requestBody: { - oneOf: [ - {$ref: "#/definitions/RequestBody"}, - {$ref: "#/definitions/Reference"}, - ], - }, - responses: {$ref: "#/definitions/Responses"}, - callbacks: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Callback"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - deprecated: {type: "boolean", default: false}, - security: { - type: "array", - items: {$ref: "#/definitions/SecurityRequirement"}, - }, - servers: {type: "array", items: {$ref: "#/definitions/Server"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Responses: { - type: "object", - properties: { - default: { - oneOf: [ - {$ref: "#/definitions/Response"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - patternProperties: { - "^[1-5](?:\\d{2}|XX)$": { - oneOf: [ - {$ref: "#/definitions/Response"}, - {$ref: "#/definitions/Reference"}, - ], - }, - "^x-": {}, - }, - minProperties: 1, - additionalProperties: false, - }, - SecurityRequirement: { - type: "object", - additionalProperties: {type: "array", items: {type: "string"}}, - }, - Tag: { - type: "object", - required: ["name"], - properties: { - name: {type: "string"}, - description: {type: "string"}, - externalDocs: {$ref: "#/definitions/ExternalDocumentation"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - ExternalDocumentation: { - type: "object", - required: ["url"], - properties: { - description: {type: "string"}, - url: {type: "string", format: "uri-reference"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - ExampleXORExamples: { - description: "Example and examples are mutually exclusive", - not: {required: ["example", "examples"]}, - }, - SchemaXORContent: { - description: - "Schema and content are mutually exclusive, at least one is required", - not: {required: ["schema", "content"]}, - oneOf: [ - {required: ["schema"]}, - { - required: ["content"], - description: "Some properties are not allowed if content is present", - allOf: [ - {not: {required: ["style"]}}, - {not: {required: ["explode"]}}, - {not: {required: ["allowReserved"]}}, - {not: {required: ["example"]}}, - {not: {required: ["examples"]}}, - ], - }, - ], - }, - Parameter: { - type: "object", - properties: { - name: {type: "string"}, - in: {type: "string"}, - description: {type: "string"}, - required: {type: "boolean", default: false}, - deprecated: {type: "boolean", default: false}, - allowEmptyValue: {type: "boolean", default: false}, - style: {type: "string"}, - explode: {type: "boolean"}, - allowReserved: {type: "boolean", default: false}, - schema: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - content: { - type: "object", - additionalProperties: {$ref: "#/definitions/MediaType"}, - minProperties: 1, - maxProperties: 1, - }, - example: {}, - examples: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Example"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - required: ["name", "in"], - allOf: [ - {$ref: "#/definitions/ExampleXORExamples"}, - {$ref: "#/definitions/SchemaXORContent"}, - ], - oneOf: [ - {$ref: "#/definitions/PathParameter"}, - {$ref: "#/definitions/QueryParameter"}, - {$ref: "#/definitions/HeaderParameter"}, - {$ref: "#/definitions/CookieParameter"}, - ], - }, - PathParameter: { - description: "Parameter in path", - required: ["required"], - properties: { - in: {enum: ["path"]}, - style: {enum: ["matrix", "label", "simple"], default: "simple"}, - required: {enum: [true]}, - }, - }, - QueryParameter: { - description: "Parameter in query", - properties: { - in: {enum: ["query"]}, - style: { - enum: ["form", "spaceDelimited", "pipeDelimited", "deepObject"], - default: "form", - }, - }, - }, - HeaderParameter: { - description: "Parameter in header", - properties: { - in: {enum: ["header"]}, - style: {enum: ["simple"], default: "simple"}, - }, - }, - CookieParameter: { - description: "Parameter in cookie", - properties: { - in: {enum: ["cookie"]}, - style: {enum: ["form"], default: "form"}, - }, - }, - RequestBody: { - type: "object", - required: ["content"], - properties: { - description: {type: "string"}, - content: { - type: "object", - additionalProperties: {$ref: "#/definitions/MediaType"}, - }, - required: {type: "boolean", default: false}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - SecurityScheme: { - oneOf: [ - {$ref: "#/definitions/APIKeySecurityScheme"}, - {$ref: "#/definitions/HTTPSecurityScheme"}, - {$ref: "#/definitions/OAuth2SecurityScheme"}, - {$ref: "#/definitions/OpenIdConnectSecurityScheme"}, - ], - }, - APIKeySecurityScheme: { - type: "object", - required: ["type", "name", "in"], - properties: { - type: {type: "string", enum: ["apiKey"]}, - name: {type: "string"}, - in: {type: "string", enum: ["header", "query", "cookie"]}, - description: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - HTTPSecurityScheme: { - type: "object", - required: ["scheme", "type"], - properties: { - scheme: {type: "string"}, - bearerFormat: {type: "string"}, - description: {type: "string"}, - type: {type: "string", enum: ["http"]}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - oneOf: [ - { - description: "Bearer", - properties: { - scheme: {type: "string", pattern: "^[Bb][Ee][Aa][Rr][Ee][Rr]$"}, - }, - }, - { - description: "Non Bearer", - not: {required: ["bearerFormat"]}, - properties: { - scheme: { - not: {type: "string", pattern: "^[Bb][Ee][Aa][Rr][Ee][Rr]$"}, - }, - }, - }, - ], - }, - OAuth2SecurityScheme: { - type: "object", - required: ["type", "flows"], - properties: { - type: {type: "string", enum: ["oauth2"]}, - flows: {$ref: "#/definitions/OAuthFlows"}, - description: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - OpenIdConnectSecurityScheme: { - type: "object", - required: ["type", "openIdConnectUrl"], - properties: { - type: {type: "string", enum: ["openIdConnect"]}, - openIdConnectUrl: {type: "string", format: "uri-reference"}, - description: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - OAuthFlows: { - type: "object", - properties: { - implicit: {$ref: "#/definitions/ImplicitOAuthFlow"}, - password: {$ref: "#/definitions/PasswordOAuthFlow"}, - clientCredentials: {$ref: "#/definitions/ClientCredentialsFlow"}, - authorizationCode: {$ref: "#/definitions/AuthorizationCodeOAuthFlow"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - ImplicitOAuthFlow: { - type: "object", - required: ["authorizationUrl", "scopes"], - properties: { - authorizationUrl: {type: "string", format: "uri-reference"}, - refreshUrl: {type: "string", format: "uri-reference"}, - scopes: {type: "object", additionalProperties: {type: "string"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - PasswordOAuthFlow: { - type: "object", - required: ["tokenUrl", "scopes"], - properties: { - tokenUrl: {type: "string", format: "uri-reference"}, - refreshUrl: {type: "string", format: "uri-reference"}, - scopes: {type: "object", additionalProperties: {type: "string"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - ClientCredentialsFlow: { - type: "object", - required: ["tokenUrl", "scopes"], - properties: { - tokenUrl: {type: "string", format: "uri-reference"}, - refreshUrl: {type: "string", format: "uri-reference"}, - scopes: {type: "object", additionalProperties: {type: "string"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - AuthorizationCodeOAuthFlow: { - type: "object", - required: ["authorizationUrl", "tokenUrl", "scopes"], - properties: { - authorizationUrl: {type: "string", format: "uri-reference"}, - tokenUrl: {type: "string", format: "uri-reference"}, - refreshUrl: {type: "string", format: "uri-reference"}, - scopes: {type: "object", additionalProperties: {type: "string"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - Link: { - type: "object", - properties: { - operationId: {type: "string"}, - operationRef: {type: "string", format: "uri-reference"}, - parameters: {type: "object", additionalProperties: {}}, - requestBody: {}, - description: {type: "string"}, - server: {$ref: "#/definitions/Server"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - not: { - description: "Operation Id and Operation Ref are mutually exclusive", - required: ["operationId", "operationRef"], - }, - }, - Callback: { - type: "object", - additionalProperties: {$ref: "#/definitions/PathItem"}, - patternProperties: {"^x-": {}}, - }, - Encoding: { - type: "object", - properties: { - contentType: {type: "string"}, - headers: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Header"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - style: { - type: "string", - enum: ["form", "spaceDelimited", "pipeDelimited", "deepObject"], - }, - explode: {type: "boolean"}, - allowReserved: {type: "boolean", default: false}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - }, - }, -} -const schema15 = { - type: "object", - required: ["url"], - properties: { - description: {type: "string"}, - url: {type: "string", format: "uri-reference"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema18 = { - type: "object", - additionalProperties: {type: "array", items: {type: "string"}}, -} -const pattern0 = new RegExp("^x-", "u") -const pattern1 = new RegExp("^3\\.0\\.\\d(-.+)?$", "u") -const schema12 = { - type: "object", - required: ["title", "version"], - properties: { - title: {type: "string"}, - description: {type: "string"}, - termsOfService: {type: "string", format: "uri-reference"}, - contact: {$ref: "#/definitions/Contact"}, - license: {$ref: "#/definitions/License"}, - version: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema13 = { - type: "object", - properties: { - name: {type: "string"}, - url: {type: "string", format: "uri-reference"}, - email: {type: "string", format: "email"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema14 = { - type: "object", - required: ["name"], - properties: { - name: {type: "string"}, - url: {type: "string", format: "uri-reference"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const formats0 = - /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i -const formats4 = - /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i -function validate11( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if ( - (data.title === undefined && (missing0 = "title")) || - (data.version === undefined && (missing0 = "version")) - ) { - validate11.errors = [ - { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - }, - ] - return false - } else { - const _errs1 = errors - for (const key0 in data) { - if ( - !( - key0 === "title" || - key0 === "description" || - key0 === "termsOfService" || - key0 === "contact" || - key0 === "license" || - key0 === "version" || - pattern0.test(key0) - ) - ) { - validate11.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.title !== undefined) { - const _errs2 = errors - if (typeof data.title !== "string") { - validate11.errors = [ - { - instancePath: instancePath + "/title", - schemaPath: "#/properties/title/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.description !== undefined) { - const _errs4 = errors - if (typeof data.description !== "string") { - validate11.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.termsOfService !== undefined) { - let data2 = data.termsOfService - const _errs6 = errors - if (errors === _errs6) { - if (errors === _errs6) { - if (typeof data2 === "string") { - if (!formats0.test(data2)) { - validate11.errors = [ - { - instancePath: instancePath + "/termsOfService", - schemaPath: "#/properties/termsOfService/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + "uri-reference" + '"', - }, - ] - return false - } - } else { - validate11.errors = [ - { - instancePath: instancePath + "/termsOfService", - schemaPath: "#/properties/termsOfService/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid0 = _errs6 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.contact !== undefined) { - let data3 = data.contact - const _errs8 = errors - const _errs9 = errors - if (errors === _errs9) { - if ( - data3 && - typeof data3 == "object" && - !Array.isArray(data3) - ) { - const _errs11 = errors - for (const key1 in data3) { - if ( - !( - key1 === "name" || - key1 === "url" || - key1 === "email" || - pattern0.test(key1) - ) - ) { - validate11.errors = [ - { - instancePath: instancePath + "/contact", - schemaPath: - "#/definitions/Contact/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key1}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs11 === errors) { - if (data3.name !== undefined) { - const _errs12 = errors - if (typeof data3.name !== "string") { - validate11.errors = [ - { - instancePath: instancePath + "/contact/name", - schemaPath: - "#/definitions/Contact/properties/name/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid2 = _errs12 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data3.url !== undefined) { - let data5 = data3.url - const _errs14 = errors - if (errors === _errs14) { - if (errors === _errs14) { - if (typeof data5 === "string") { - if (!formats0.test(data5)) { - validate11.errors = [ - { - instancePath: - instancePath + "/contact/url", - schemaPath: - "#/definitions/Contact/properties/url/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate11.errors = [ - { - instancePath: - instancePath + "/contact/url", - schemaPath: - "#/definitions/Contact/properties/url/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid2 = _errs14 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data3.email !== undefined) { - let data6 = data3.email - const _errs16 = errors - if (errors === _errs16) { - if (errors === _errs16) { - if (typeof data6 === "string") { - if (!formats4.test(data6)) { - validate11.errors = [ - { - instancePath: - instancePath + "/contact/email", - schemaPath: - "#/definitions/Contact/properties/email/format", - keyword: "format", - params: {format: "email"}, - message: - 'must match format "' + - "email" + - '"', - }, - ] - return false - } - } else { - validate11.errors = [ - { - instancePath: - instancePath + "/contact/email", - schemaPath: - "#/definitions/Contact/properties/email/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid2 = _errs16 === errors - } else { - var valid2 = true - } - } - } - } - } else { - validate11.errors = [ - { - instancePath: instancePath + "/contact", - schemaPath: "#/definitions/Contact/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs8 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.license !== undefined) { - let data7 = data.license - const _errs18 = errors - const _errs19 = errors - if (errors === _errs19) { - if ( - data7 && - typeof data7 == "object" && - !Array.isArray(data7) - ) { - let missing1 - if (data7.name === undefined && (missing1 = "name")) { - validate11.errors = [ - { - instancePath: instancePath + "/license", - schemaPath: "#/definitions/License/required", - keyword: "required", - params: {missingProperty: missing1}, - message: - "must have required property '" + - missing1 + - "'", - }, - ] - return false - } else { - const _errs21 = errors - for (const key2 in data7) { - if ( - !( - key2 === "name" || - key2 === "url" || - pattern0.test(key2) - ) - ) { - validate11.errors = [ - { - instancePath: instancePath + "/license", - schemaPath: - "#/definitions/License/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key2}, - message: - "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs21 === errors) { - if (data7.name !== undefined) { - const _errs22 = errors - if (typeof data7.name !== "string") { - validate11.errors = [ - { - instancePath: - instancePath + "/license/name", - schemaPath: - "#/definitions/License/properties/name/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid4 = _errs22 === errors - } else { - var valid4 = true - } - if (valid4) { - if (data7.url !== undefined) { - let data9 = data7.url - const _errs24 = errors - if (errors === _errs24) { - if (errors === _errs24) { - if (typeof data9 === "string") { - if (!formats0.test(data9)) { - validate11.errors = [ - { - instancePath: - instancePath + "/license/url", - schemaPath: - "#/definitions/License/properties/url/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate11.errors = [ - { - instancePath: - instancePath + "/license/url", - schemaPath: - "#/definitions/License/properties/url/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid4 = _errs24 === errors - } else { - var valid4 = true - } - } - } - } - } else { - validate11.errors = [ - { - instancePath: instancePath + "/license", - schemaPath: "#/definitions/License/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs18 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.version !== undefined) { - const _errs26 = errors - if (typeof data.version !== "string") { - validate11.errors = [ - { - instancePath: instancePath + "/version", - schemaPath: "#/properties/version/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs26 === errors - } else { - var valid0 = true - } - } - } - } - } - } - } - } - } else { - validate11.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate11.errors = vErrors - return errors === 0 -} -const schema16 = { - type: "object", - required: ["url"], - properties: { - url: {type: "string"}, - description: {type: "string"}, - variables: { - type: "object", - additionalProperties: {$ref: "#/definitions/ServerVariable"}, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema17 = { - type: "object", - required: ["default"], - properties: { - enum: {type: "array", items: {type: "string"}}, - default: {type: "string"}, - description: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -function validate13( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if (data.url === undefined && (missing0 = "url")) { - validate13.errors = [ - { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - }, - ] - return false - } else { - const _errs1 = errors - for (const key0 in data) { - if ( - !( - key0 === "url" || - key0 === "description" || - key0 === "variables" || - pattern0.test(key0) - ) - ) { - validate13.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.url !== undefined) { - const _errs2 = errors - if (typeof data.url !== "string") { - validate13.errors = [ - { - instancePath: instancePath + "/url", - schemaPath: "#/properties/url/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.description !== undefined) { - const _errs4 = errors - if (typeof data.description !== "string") { - validate13.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.variables !== undefined) { - let data2 = data.variables - const _errs6 = errors - if (errors === _errs6) { - if ( - data2 && - typeof data2 == "object" && - !Array.isArray(data2) - ) { - for (const key1 in data2) { - let data3 = data2[key1] - const _errs9 = errors - const _errs10 = errors - if (errors === _errs10) { - if ( - data3 && - typeof data3 == "object" && - !Array.isArray(data3) - ) { - let missing1 - if ( - data3.default === undefined && - (missing1 = "default") - ) { - validate13.errors = [ - { - instancePath: - instancePath + - "/variables/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/definitions/ServerVariable/required", - keyword: "required", - params: {missingProperty: missing1}, - message: - "must have required property '" + - missing1 + - "'", - }, - ] - return false - } else { - const _errs12 = errors - for (const key2 in data3) { - if ( - !( - key2 === "enum" || - key2 === "default" || - key2 === "description" || - pattern0.test(key2) - ) - ) { - validate13.errors = [ - { - instancePath: - instancePath + - "/variables/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/ServerVariable/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key2}, - message: - "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs12 === errors) { - if (data3.enum !== undefined) { - let data4 = data3.enum - const _errs13 = errors - if (errors === _errs13) { - if (Array.isArray(data4)) { - var valid4 = true - const len0 = data4.length - for (let i0 = 0; i0 < len0; i0++) { - const _errs15 = errors - if (typeof data4[i0] !== "string") { - validate13.errors = [ - { - instancePath: - instancePath + - "/variables/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/enum/" + - i0, - schemaPath: - "#/definitions/ServerVariable/properties/enum/items/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid4 = _errs15 === errors - if (!valid4) { - break - } - } - } else { - validate13.errors = [ - { - instancePath: - instancePath + - "/variables/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/enum", - schemaPath: - "#/definitions/ServerVariable/properties/enum/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid3 = _errs13 === errors - } else { - var valid3 = true - } - if (valid3) { - if (data3.default !== undefined) { - const _errs17 = errors - if (typeof data3.default !== "string") { - validate13.errors = [ - { - instancePath: - instancePath + - "/variables/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/default", - schemaPath: - "#/definitions/ServerVariable/properties/default/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid3 = _errs17 === errors - } else { - var valid3 = true - } - if (valid3) { - if (data3.description !== undefined) { - const _errs19 = errors - if (typeof data3.description !== "string") { - validate13.errors = [ - { - instancePath: - instancePath + - "/variables/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/description", - schemaPath: - "#/definitions/ServerVariable/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid3 = _errs19 === errors - } else { - var valid3 = true - } - } - } - } - } - } else { - validate13.errors = [ - { - instancePath: - instancePath + - "/variables/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/ServerVariable/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid1 = _errs9 === errors - if (!valid1) { - break - } - } - } else { - validate13.errors = [ - { - instancePath: instancePath + "/variables", - schemaPath: "#/properties/variables/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs6 === errors - } else { - var valid0 = true - } - } - } - } - } - } else { - validate13.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate13.errors = vErrors - return errors === 0 -} -const schema19 = { - type: "object", - required: ["name"], - properties: { - name: {type: "string"}, - description: {type: "string"}, - externalDocs: {$ref: "#/definitions/ExternalDocumentation"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -function validate15( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if (data.name === undefined && (missing0 = "name")) { - validate15.errors = [ - { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - }, - ] - return false - } else { - const _errs1 = errors - for (const key0 in data) { - if ( - !( - key0 === "name" || - key0 === "description" || - key0 === "externalDocs" || - pattern0.test(key0) - ) - ) { - validate15.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.name !== undefined) { - const _errs2 = errors - if (typeof data.name !== "string") { - validate15.errors = [ - { - instancePath: instancePath + "/name", - schemaPath: "#/properties/name/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.description !== undefined) { - const _errs4 = errors - if (typeof data.description !== "string") { - validate15.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.externalDocs !== undefined) { - let data2 = data.externalDocs - const _errs6 = errors - const _errs7 = errors - if (errors === _errs7) { - if ( - data2 && - typeof data2 == "object" && - !Array.isArray(data2) - ) { - let missing1 - if (data2.url === undefined && (missing1 = "url")) { - validate15.errors = [ - { - instancePath: instancePath + "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/required", - keyword: "required", - params: {missingProperty: missing1}, - message: - "must have required property '" + missing1 + "'", - }, - ] - return false - } else { - const _errs9 = errors - for (const key1 in data2) { - if ( - !( - key1 === "description" || - key1 === "url" || - pattern0.test(key1) - ) - ) { - validate15.errors = [ - { - instancePath: instancePath + "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key1}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs9 === errors) { - if (data2.description !== undefined) { - const _errs10 = errors - if (typeof data2.description !== "string") { - validate15.errors = [ - { - instancePath: - instancePath + "/externalDocs/description", - schemaPath: - "#/definitions/ExternalDocumentation/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid2 = _errs10 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data2.url !== undefined) { - let data4 = data2.url - const _errs12 = errors - if (errors === _errs12) { - if (errors === _errs12) { - if (typeof data4 === "string") { - if (!formats0.test(data4)) { - validate15.errors = [ - { - instancePath: - instancePath + "/externalDocs/url", - schemaPath: - "#/definitions/ExternalDocumentation/properties/url/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate15.errors = [ - { - instancePath: - instancePath + "/externalDocs/url", - schemaPath: - "#/definitions/ExternalDocumentation/properties/url/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid2 = _errs12 === errors - } else { - var valid2 = true - } - } - } - } - } else { - validate15.errors = [ - { - instancePath: instancePath + "/externalDocs", - schemaPath: "#/definitions/ExternalDocumentation/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs6 === errors - } else { - var valid0 = true - } - } - } - } - } - } else { - validate15.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate15.errors = vErrors - return errors === 0 -} -const schema21 = { - type: "object", - patternProperties: {"^\\/": {$ref: "#/definitions/PathItem"}, "^x-": {}}, - additionalProperties: false, -} -const pattern10 = new RegExp("^\\/", "u") -const schema22 = { - type: "object", - properties: { - $ref: {type: "string"}, - summary: {type: "string"}, - description: {type: "string"}, - get: {$ref: "#/definitions/Operation"}, - put: {$ref: "#/definitions/Operation"}, - post: {$ref: "#/definitions/Operation"}, - delete: {$ref: "#/definitions/Operation"}, - options: {$ref: "#/definitions/Operation"}, - head: {$ref: "#/definitions/Operation"}, - patch: {$ref: "#/definitions/Operation"}, - trace: {$ref: "#/definitions/Operation"}, - servers: {type: "array", items: {$ref: "#/definitions/Server"}}, - parameters: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Parameter"}, - {$ref: "#/definitions/Reference"}, - ], - }, - uniqueItems: true, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema33 = { - type: "object", - required: ["$ref"], - patternProperties: {"^\\$ref$": {type: "string", format: "uri-reference"}}, -} -const func3 = Object.prototype.hasOwnProperty -const func0 = require("ajv/dist/runtime/equal").default -const pattern18 = new RegExp("^\\$ref$", "u") -const schema23 = { - type: "object", - required: ["responses"], - properties: { - tags: {type: "array", items: {type: "string"}}, - summary: {type: "string"}, - description: {type: "string"}, - externalDocs: {$ref: "#/definitions/ExternalDocumentation"}, - operationId: {type: "string"}, - parameters: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Parameter"}, - {$ref: "#/definitions/Reference"}, - ], - }, - uniqueItems: true, - }, - requestBody: { - oneOf: [ - {$ref: "#/definitions/RequestBody"}, - {$ref: "#/definitions/Reference"}, - ], - }, - responses: {$ref: "#/definitions/Responses"}, - callbacks: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Callback"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - deprecated: {type: "boolean", default: false}, - security: { - type: "array", - items: {$ref: "#/definitions/SecurityRequirement"}, - }, - servers: {type: "array", items: {$ref: "#/definitions/Server"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema25 = { - type: "object", - properties: { - name: {type: "string"}, - in: {type: "string"}, - description: {type: "string"}, - required: {type: "boolean", default: false}, - deprecated: {type: "boolean", default: false}, - allowEmptyValue: {type: "boolean", default: false}, - style: {type: "string"}, - explode: {type: "boolean"}, - allowReserved: {type: "boolean", default: false}, - schema: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - content: { - type: "object", - additionalProperties: {$ref: "#/definitions/MediaType"}, - minProperties: 1, - maxProperties: 1, - }, - example: {}, - examples: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Example"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - required: ["name", "in"], - allOf: [ - {$ref: "#/definitions/ExampleXORExamples"}, - {$ref: "#/definitions/SchemaXORContent"}, - ], - oneOf: [ - {$ref: "#/definitions/PathParameter"}, - {$ref: "#/definitions/QueryParameter"}, - {$ref: "#/definitions/HeaderParameter"}, - {$ref: "#/definitions/CookieParameter"}, - ], -} -const schema26 = { - description: "Parameter in path", - required: ["required"], - properties: { - in: {enum: ["path"]}, - style: {enum: ["matrix", "label", "simple"], default: "simple"}, - required: {enum: [true]}, - }, -} -const schema27 = { - description: "Parameter in query", - properties: { - in: {enum: ["query"]}, - style: { - enum: ["form", "spaceDelimited", "pipeDelimited", "deepObject"], - default: "form", - }, - }, -} -const schema28 = { - description: "Parameter in header", - properties: { - in: {enum: ["header"]}, - style: {enum: ["simple"], default: "simple"}, - }, -} -const schema29 = { - description: "Parameter in cookie", - properties: { - in: {enum: ["cookie"]}, - style: {enum: ["form"], default: "form"}, - }, -} -const schema30 = { - description: "Example and examples are mutually exclusive", - not: {required: ["example", "examples"]}, -} -const schema31 = { - description: - "Schema and content are mutually exclusive, at least one is required", - not: {required: ["schema", "content"]}, - oneOf: [ - {required: ["schema"]}, - { - required: ["content"], - description: "Some properties are not allowed if content is present", - allOf: [ - {not: {required: ["style"]}}, - {not: {required: ["explode"]}}, - {not: {required: ["allowReserved"]}}, - {not: {required: ["example"]}}, - {not: {required: ["examples"]}}, - ], - }, - ], -} -const schema47 = { - type: "object", - properties: { - summary: {type: "string"}, - description: {type: "string"}, - value: {}, - externalValue: {type: "string", format: "uri-reference"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema32 = { - type: "object", - properties: { - title: {type: "string"}, - multipleOf: {type: "number", minimum: 0, exclusiveMinimum: true}, - maximum: {type: "number"}, - exclusiveMaximum: {type: "boolean", default: false}, - minimum: {type: "number"}, - exclusiveMinimum: {type: "boolean", default: false}, - maxLength: {type: "integer", minimum: 0}, - minLength: {type: "integer", minimum: 0, default: 0}, - pattern: {type: "string", format: "regex"}, - maxItems: {type: "integer", minimum: 0}, - minItems: {type: "integer", minimum: 0, default: 0}, - uniqueItems: {type: "boolean", default: false}, - maxProperties: {type: "integer", minimum: 0}, - minProperties: {type: "integer", minimum: 0, default: 0}, - required: { - type: "array", - items: {type: "string"}, - minItems: 1, - uniqueItems: true, - }, - enum: {type: "array", items: {}, minItems: 1, uniqueItems: false}, - type: { - type: "string", - enum: ["array", "boolean", "integer", "number", "object", "string"], - }, - not: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - allOf: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - oneOf: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - anyOf: { - type: "array", - items: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - items: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - properties: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - {type: "boolean"}, - ], - default: true, - }, - description: {type: "string"}, - format: {type: "string"}, - default: {}, - nullable: {type: "boolean", default: false}, - discriminator: {$ref: "#/definitions/Discriminator"}, - readOnly: {type: "boolean", default: false}, - writeOnly: {type: "boolean", default: false}, - example: {}, - externalDocs: {$ref: "#/definitions/ExternalDocumentation"}, - deprecated: {type: "boolean", default: false}, - xml: {$ref: "#/definitions/XML"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema40 = { - type: "object", - required: ["propertyName"], - properties: { - propertyName: {type: "string"}, - mapping: {type: "object", additionalProperties: {type: "string"}}, - }, -} -const schema42 = { - type: "object", - properties: { - name: {type: "string"}, - namespace: {type: "string", format: "uri"}, - prefix: {type: "string"}, - attribute: {type: "boolean", default: false}, - wrapped: {type: "boolean", default: false}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const formats14 = require("ajv-formats/dist/formats").fullFormats.regex -const formats32 = require("ajv-formats/dist/formats").fullFormats.uri -const wrapper0 = {validate: validate21} -function validate21( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - const _errs1 = errors - for (const key0 in data) { - if (!(func3.call(schema32.properties, key0) || pattern0.test(key0))) { - validate21.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.title !== undefined) { - const _errs2 = errors - if (typeof data.title !== "string") { - validate21.errors = [ - { - instancePath: instancePath + "/title", - schemaPath: "#/properties/title/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.multipleOf !== undefined) { - let data1 = data.multipleOf - const _errs4 = errors - if (errors === _errs4) { - if (typeof data1 == "number") { - if (data1 <= 0 || isNaN(data1)) { - validate21.errors = [ - { - instancePath: instancePath + "/multipleOf", - schemaPath: "#/properties/multipleOf/minimum", - keyword: "minimum", - params: {comparison: ">", limit: 0}, - message: "must be > 0", - }, - ] - return false - } - } else { - validate21.errors = [ - { - instancePath: instancePath + "/multipleOf", - schemaPath: "#/properties/multipleOf/type", - keyword: "type", - params: {type: "number"}, - message: "must be number", - }, - ] - return false - } - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.maximum !== undefined) { - const _errs6 = errors - if (!(typeof data.maximum == "number")) { - validate21.errors = [ - { - instancePath: instancePath + "/maximum", - schemaPath: "#/properties/maximum/type", - keyword: "type", - params: {type: "number"}, - message: "must be number", - }, - ] - return false - } - var valid0 = _errs6 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.exclusiveMaximum !== undefined) { - const _errs8 = errors - if (typeof data.exclusiveMaximum !== "boolean") { - validate21.errors = [ - { - instancePath: instancePath + "/exclusiveMaximum", - schemaPath: "#/properties/exclusiveMaximum/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid0 = _errs8 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.minimum !== undefined) { - const _errs10 = errors - if (!(typeof data.minimum == "number")) { - validate21.errors = [ - { - instancePath: instancePath + "/minimum", - schemaPath: "#/properties/minimum/type", - keyword: "type", - params: {type: "number"}, - message: "must be number", - }, - ] - return false - } - var valid0 = _errs10 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.exclusiveMinimum !== undefined) { - const _errs12 = errors - if (typeof data.exclusiveMinimum !== "boolean") { - validate21.errors = [ - { - instancePath: instancePath + "/exclusiveMinimum", - schemaPath: "#/properties/exclusiveMinimum/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid0 = _errs12 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.maxLength !== undefined) { - let data6 = data.maxLength - const _errs14 = errors - if ( - !( - typeof data6 == "number" && - !(data6 % 1) && - !isNaN(data6) - ) - ) { - validate21.errors = [ - { - instancePath: instancePath + "/maxLength", - schemaPath: "#/properties/maxLength/type", - keyword: "type", - params: {type: "integer"}, - message: "must be integer", - }, - ] - return false - } - if (errors === _errs14) { - if (typeof data6 == "number") { - if (data6 < 0 || isNaN(data6)) { - validate21.errors = [ - { - instancePath: instancePath + "/maxLength", - schemaPath: "#/properties/maxLength/minimum", - keyword: "minimum", - params: {comparison: ">=", limit: 0}, - message: "must be >= 0", - }, - ] - return false - } - } - } - var valid0 = _errs14 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.minLength !== undefined) { - let data7 = data.minLength - const _errs16 = errors - if ( - !( - typeof data7 == "number" && - !(data7 % 1) && - !isNaN(data7) - ) - ) { - validate21.errors = [ - { - instancePath: instancePath + "/minLength", - schemaPath: "#/properties/minLength/type", - keyword: "type", - params: {type: "integer"}, - message: "must be integer", - }, - ] - return false - } - if (errors === _errs16) { - if (typeof data7 == "number") { - if (data7 < 0 || isNaN(data7)) { - validate21.errors = [ - { - instancePath: instancePath + "/minLength", - schemaPath: "#/properties/minLength/minimum", - keyword: "minimum", - params: {comparison: ">=", limit: 0}, - message: "must be >= 0", - }, - ] - return false - } - } - } - var valid0 = _errs16 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.pattern !== undefined) { - let data8 = data.pattern - const _errs18 = errors - if (errors === _errs18) { - if (errors === _errs18) { - if (typeof data8 === "string") { - if (!formats14(data8)) { - validate21.errors = [ - { - instancePath: instancePath + "/pattern", - schemaPath: "#/properties/pattern/format", - keyword: "format", - params: {format: "regex"}, - message: - 'must match format "' + "regex" + '"', - }, - ] - return false - } - } else { - validate21.errors = [ - { - instancePath: instancePath + "/pattern", - schemaPath: "#/properties/pattern/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid0 = _errs18 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.maxItems !== undefined) { - let data9 = data.maxItems - const _errs20 = errors - if ( - !( - typeof data9 == "number" && - !(data9 % 1) && - !isNaN(data9) - ) - ) { - validate21.errors = [ - { - instancePath: instancePath + "/maxItems", - schemaPath: "#/properties/maxItems/type", - keyword: "type", - params: {type: "integer"}, - message: "must be integer", - }, - ] - return false - } - if (errors === _errs20) { - if (typeof data9 == "number") { - if (data9 < 0 || isNaN(data9)) { - validate21.errors = [ - { - instancePath: instancePath + "/maxItems", - schemaPath: - "#/properties/maxItems/minimum", - keyword: "minimum", - params: {comparison: ">=", limit: 0}, - message: "must be >= 0", - }, - ] - return false - } - } - } - var valid0 = _errs20 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.minItems !== undefined) { - let data10 = data.minItems - const _errs22 = errors - if ( - !( - typeof data10 == "number" && - !(data10 % 1) && - !isNaN(data10) - ) - ) { - validate21.errors = [ - { - instancePath: instancePath + "/minItems", - schemaPath: "#/properties/minItems/type", - keyword: "type", - params: {type: "integer"}, - message: "must be integer", - }, - ] - return false - } - if (errors === _errs22) { - if (typeof data10 == "number") { - if (data10 < 0 || isNaN(data10)) { - validate21.errors = [ - { - instancePath: - instancePath + "/minItems", - schemaPath: - "#/properties/minItems/minimum", - keyword: "minimum", - params: {comparison: ">=", limit: 0}, - message: "must be >= 0", - }, - ] - return false - } - } - } - var valid0 = _errs22 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.uniqueItems !== undefined) { - const _errs24 = errors - if (typeof data.uniqueItems !== "boolean") { - validate21.errors = [ - { - instancePath: - instancePath + "/uniqueItems", - schemaPath: - "#/properties/uniqueItems/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid0 = _errs24 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.maxProperties !== undefined) { - let data12 = data.maxProperties - const _errs26 = errors - if ( - !( - typeof data12 == "number" && - !(data12 % 1) && - !isNaN(data12) - ) - ) { - validate21.errors = [ - { - instancePath: - instancePath + "/maxProperties", - schemaPath: - "#/properties/maxProperties/type", - keyword: "type", - params: {type: "integer"}, - message: "must be integer", - }, - ] - return false - } - if (errors === _errs26) { - if (typeof data12 == "number") { - if (data12 < 0 || isNaN(data12)) { - validate21.errors = [ - { - instancePath: - instancePath + "/maxProperties", - schemaPath: - "#/properties/maxProperties/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 0, - }, - message: "must be >= 0", - }, - ] - return false - } - } - } - var valid0 = _errs26 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.minProperties !== undefined) { - let data13 = data.minProperties - const _errs28 = errors - if ( - !( - typeof data13 == "number" && - !(data13 % 1) && - !isNaN(data13) - ) - ) { - validate21.errors = [ - { - instancePath: - instancePath + "/minProperties", - schemaPath: - "#/properties/minProperties/type", - keyword: "type", - params: {type: "integer"}, - message: "must be integer", - }, - ] - return false - } - if (errors === _errs28) { - if (typeof data13 == "number") { - if (data13 < 0 || isNaN(data13)) { - validate21.errors = [ - { - instancePath: - instancePath + "/minProperties", - schemaPath: - "#/properties/minProperties/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 0, - }, - message: "must be >= 0", - }, - ] - return false - } - } - } - var valid0 = _errs28 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.required !== undefined) { - let data14 = data.required - const _errs30 = errors - if (errors === _errs30) { - if (Array.isArray(data14)) { - if (data14.length < 1) { - validate21.errors = [ - { - instancePath: - instancePath + "/required", - schemaPath: - "#/properties/required/minItems", - keyword: "minItems", - params: {limit: 1}, - message: - "must NOT have fewer than 1 items", - }, - ] - return false - } else { - var valid1 = true - const len0 = data14.length - for (let i0 = 0; i0 < len0; i0++) { - const _errs32 = errors - if ( - typeof data14[i0] !== "string" - ) { - validate21.errors = [ - { - instancePath: - instancePath + - "/required/" + - i0, - schemaPath: - "#/properties/required/items/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid1 = _errs32 === errors - if (!valid1) { - break - } - } - if (valid1) { - let i1 = data14.length - let j0 - if (i1 > 1) { - const indices0 = {} - for (; i1--; ) { - let item0 = data14[i1] - if ( - typeof item0 !== "string" - ) { - continue - } - if ( - typeof indices0[item0] == - "number" - ) { - j0 = indices0[item0] - validate21.errors = [ - { - instancePath: - instancePath + - "/required", - schemaPath: - "#/properties/required/uniqueItems", - keyword: "uniqueItems", - params: {i: i1, j: j0}, - message: - "must NOT have duplicate items (items ## " + - j0 + - " and " + - i1 + - " are identical)", - }, - ] - return false - break - } - indices0[item0] = i1 - } - } - } - } - } else { - validate21.errors = [ - { - instancePath: - instancePath + "/required", - schemaPath: - "#/properties/required/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs30 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.enum !== undefined) { - let data16 = data.enum - const _errs34 = errors - if (errors === _errs34) { - if (Array.isArray(data16)) { - if (data16.length < 1) { - validate21.errors = [ - { - instancePath: - instancePath + "/enum", - schemaPath: - "#/properties/enum/minItems", - keyword: "minItems", - params: {limit: 1}, - message: - "must NOT have fewer than 1 items", - }, - ] - return false - } - } else { - validate21.errors = [ - { - instancePath: - instancePath + "/enum", - schemaPath: - "#/properties/enum/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs34 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.type !== undefined) { - let data17 = data.type - const _errs36 = errors - if (typeof data17 !== "string") { - validate21.errors = [ - { - instancePath: - instancePath + "/type", - schemaPath: - "#/properties/type/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - if ( - !( - data17 === "array" || - data17 === "boolean" || - data17 === "integer" || - data17 === "number" || - data17 === "object" || - data17 === "string" - ) - ) { - validate21.errors = [ - { - instancePath: - instancePath + "/type", - schemaPath: - "#/properties/type/enum", - keyword: "enum", - params: { - allowedValues: - schema32.properties.type - .enum, - }, - message: - "must be equal to one of the allowed values", - }, - ] - return false - } - var valid0 = _errs36 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.not !== undefined) { - let data18 = data.not - const _errs38 = errors - const _errs39 = errors - let valid3 = false - let passing0 = null - const _errs40 = errors - if ( - !wrapper0.validate(data18, { - instancePath: - instancePath + "/not", - parentData: data, - parentDataProperty: "not", - rootData, - }) - ) { - vErrors = - vErrors === null - ? wrapper0.validate.errors - : vErrors.concat( - wrapper0.validate.errors, - ) - errors = vErrors.length - } - var _valid0 = _errs40 === errors - if (_valid0) { - valid3 = true - passing0 = 0 - } - const _errs41 = errors - const _errs42 = errors - if (errors === _errs42) { - if ( - data18 && - typeof data18 == "object" && - !Array.isArray(data18) - ) { - let missing0 - if ( - data18.$ref === undefined && - (missing0 = "$ref") - ) { - const err0 = { - instancePath: - instancePath + "/not", - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: { - missingProperty: missing0, - }, - message: - "must have required property '" + - missing0 + - "'", - } - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } else { - var valid5 = true - for (const key1 in data18) { - if (pattern18.test(key1)) { - let data19 = data18[key1] - const _errs44 = errors - if (errors === _errs44) { - if ( - errors === _errs44 - ) { - if ( - typeof data19 === - "string" - ) { - if ( - !formats0.test( - data19, - ) - ) { - const err1 = { - instancePath: - instancePath + - "/not/" + - key1 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: - "format", - params: { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === null - ) { - vErrors = [err1] - } else { - vErrors.push( - err1, - ) - } - errors++ - } - } else { - const err2 = { - instancePath: - instancePath + - "/not/" + - key1 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: { - type: "string", - }, - message: - "must be string", - } - if ( - vErrors === null - ) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - } - } - var valid5 = - _errs44 === errors - if (!valid5) { - break - } - } - } - } - } else { - const err3 = { - instancePath: - instancePath + "/not", - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - } - var _valid0 = _errs41 === errors - if (_valid0 && valid3) { - valid3 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid3 = true - passing0 = 1 - } - } - if (!valid3) { - const err4 = { - instancePath: - instancePath + "/not", - schemaPath: - "#/properties/not/oneOf", - keyword: "oneOf", - params: { - passingSchemas: passing0, - }, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - validate21.errors = vErrors - return false - } else { - errors = _errs39 - if (vErrors !== null) { - if (_errs39) { - vErrors.length = _errs39 - } else { - vErrors = null - } - } - } - var valid0 = _errs38 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.allOf !== undefined) { - let data20 = data.allOf - const _errs46 = errors - if (errors === _errs46) { - if (Array.isArray(data20)) { - var valid6 = true - const len1 = data20.length - for ( - let i2 = 0; - i2 < len1; - i2++ - ) { - let data21 = data20[i2] - const _errs48 = errors - const _errs49 = errors - let valid7 = false - let passing1 = null - const _errs50 = errors - if ( - !wrapper0.validate( - data21, - { - instancePath: - instancePath + - "/allOf/" + - i2, - parentData: data20, - parentDataProperty: - i2, - rootData, - }, - ) - ) { - vErrors = - vErrors === null - ? wrapper0.validate - .errors - : vErrors.concat( - wrapper0.validate - .errors, - ) - errors = vErrors.length - } - var _valid1 = - _errs50 === errors - if (_valid1) { - valid7 = true - passing1 = 0 - } - const _errs51 = errors - const _errs52 = errors - if (errors === _errs52) { - if ( - data21 && - typeof data21 == - "object" && - !Array.isArray(data21) - ) { - let missing1 - if ( - data21.$ref === - undefined && - (missing1 = "$ref") - ) { - const err5 = { - instancePath: - instancePath + - "/allOf/" + - i2, - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: { - missingProperty: - missing1, - }, - message: - "must have required property '" + - missing1 + - "'", - } - if ( - vErrors === null - ) { - vErrors = [err5] - } else { - vErrors.push(err5) - } - errors++ - } else { - var valid9 = true - for (const key2 in data21) { - if ( - pattern18.test( - key2, - ) - ) { - let data22 = - data21[key2] - const _errs54 = - errors - if ( - errors === - _errs54 - ) { - if ( - errors === - _errs54 - ) { - if ( - typeof data22 === - "string" - ) { - if ( - !formats0.test( - data22, - ) - ) { - const err6 = - { - instancePath: - instancePath + - "/allOf/" + - i2 + - "/" + - key2 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: - "format", - params: - { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === - null - ) { - vErrors = - [err6] - } else { - vErrors.push( - err6, - ) - } - errors++ - } - } else { - const err7 = - { - instancePath: - instancePath + - "/allOf/" + - i2 + - "/" + - key2 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - } - if ( - vErrors === - null - ) { - vErrors = - [err7] - } else { - vErrors.push( - err7, - ) - } - errors++ - } - } - } - var valid9 = - _errs54 === - errors - if (!valid9) { - break - } - } - } - } - } else { - const err8 = { - instancePath: - instancePath + - "/allOf/" + - i2, - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: { - type: "object", - }, - message: - "must be object", - } - if (vErrors === null) { - vErrors = [err8] - } else { - vErrors.push(err8) - } - errors++ - } - } - var _valid1 = - _errs51 === errors - if (_valid1 && valid7) { - valid7 = false - passing1 = [passing1, 1] - } else { - if (_valid1) { - valid7 = true - passing1 = 1 - } - } - if (!valid7) { - const err9 = { - instancePath: - instancePath + - "/allOf/" + - i2, - schemaPath: - "#/properties/allOf/items/oneOf", - keyword: "oneOf", - params: { - passingSchemas: - passing1, - }, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err9] - } else { - vErrors.push(err9) - } - errors++ - validate21.errors = - vErrors - return false - } else { - errors = _errs49 - if (vErrors !== null) { - if (_errs49) { - vErrors.length = - _errs49 - } else { - vErrors = null - } - } - } - var valid6 = - _errs48 === errors - if (!valid6) { - break - } - } - } else { - validate21.errors = [ - { - instancePath: - instancePath + "/allOf", - schemaPath: - "#/properties/allOf/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs46 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.oneOf !== undefined) { - let data23 = data.oneOf - const _errs56 = errors - if (errors === _errs56) { - if (Array.isArray(data23)) { - var valid10 = true - const len2 = data23.length - for ( - let i3 = 0; - i3 < len2; - i3++ - ) { - let data24 = data23[i3] - const _errs58 = errors - const _errs59 = errors - let valid11 = false - let passing2 = null - const _errs60 = errors - if ( - !wrapper0.validate( - data24, - { - instancePath: - instancePath + - "/oneOf/" + - i3, - parentData: data23, - parentDataProperty: - i3, - rootData, - }, - ) - ) { - vErrors = - vErrors === null - ? wrapper0.validate - .errors - : vErrors.concat( - wrapper0 - .validate - .errors, - ) - errors = vErrors.length - } - var _valid2 = - _errs60 === errors - if (_valid2) { - valid11 = true - passing2 = 0 - } - const _errs61 = errors - const _errs62 = errors - if (errors === _errs62) { - if ( - data24 && - typeof data24 == - "object" && - !Array.isArray(data24) - ) { - let missing2 - if ( - data24.$ref === - undefined && - (missing2 = "$ref") - ) { - const err10 = { - instancePath: - instancePath + - "/oneOf/" + - i3, - schemaPath: - "#/definitions/Reference/required", - keyword: - "required", - params: { - missingProperty: - missing2, - }, - message: - "must have required property '" + - missing2 + - "'", - } - if ( - vErrors === null - ) { - vErrors = [err10] - } else { - vErrors.push( - err10, - ) - } - errors++ - } else { - var valid13 = true - for (const key3 in data24) { - if ( - pattern18.test( - key3, - ) - ) { - let data25 = - data24[key3] - const _errs64 = - errors - if ( - errors === - _errs64 - ) { - if ( - errors === - _errs64 - ) { - if ( - typeof data25 === - "string" - ) { - if ( - !formats0.test( - data25, - ) - ) { - const err11 = - { - instancePath: - instancePath + - "/oneOf/" + - i3 + - "/" + - key3 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: - "format", - params: - { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === - null - ) { - vErrors = - [ - err11, - ] - } else { - vErrors.push( - err11, - ) - } - errors++ - } - } else { - const err12 = - { - instancePath: - instancePath + - "/oneOf/" + - i3 + - "/" + - key3 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - } - if ( - vErrors === - null - ) { - vErrors = - [ - err12, - ] - } else { - vErrors.push( - err12, - ) - } - errors++ - } - } - } - var valid13 = - _errs64 === - errors - if (!valid13) { - break - } - } - } - } - } else { - const err13 = { - instancePath: - instancePath + - "/oneOf/" + - i3, - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: { - type: "object", - }, - message: - "must be object", - } - if ( - vErrors === null - ) { - vErrors = [err13] - } else { - vErrors.push(err13) - } - errors++ - } - } - var _valid2 = - _errs61 === errors - if (_valid2 && valid11) { - valid11 = false - passing2 = [passing2, 1] - } else { - if (_valid2) { - valid11 = true - passing2 = 1 - } - } - if (!valid11) { - const err14 = { - instancePath: - instancePath + - "/oneOf/" + - i3, - schemaPath: - "#/properties/oneOf/items/oneOf", - keyword: "oneOf", - params: { - passingSchemas: - passing2, - }, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err14] - } else { - vErrors.push(err14) - } - errors++ - validate21.errors = - vErrors - return false - } else { - errors = _errs59 - if (vErrors !== null) { - if (_errs59) { - vErrors.length = - _errs59 - } else { - vErrors = null - } - } - } - var valid10 = - _errs58 === errors - if (!valid10) { - break - } - } - } else { - validate21.errors = [ - { - instancePath: - instancePath + - "/oneOf", - schemaPath: - "#/properties/oneOf/type", - keyword: "type", - params: {type: "array"}, - message: - "must be array", - }, - ] - return false - } - } - var valid0 = _errs56 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.anyOf !== undefined) { - let data26 = data.anyOf - const _errs66 = errors - if (errors === _errs66) { - if (Array.isArray(data26)) { - var valid14 = true - const len3 = data26.length - for ( - let i4 = 0; - i4 < len3; - i4++ - ) { - let data27 = data26[i4] - const _errs68 = errors - const _errs69 = errors - let valid15 = false - let passing3 = null - const _errs70 = errors - if ( - !wrapper0.validate( - data27, - { - instancePath: - instancePath + - "/anyOf/" + - i4, - parentData: - data26, - parentDataProperty: - i4, - rootData, - }, - ) - ) { - vErrors = - vErrors === null - ? wrapper0 - .validate - .errors - : vErrors.concat( - wrapper0 - .validate - .errors, - ) - errors = - vErrors.length - } - var _valid3 = - _errs70 === errors - if (_valid3) { - valid15 = true - passing3 = 0 - } - const _errs71 = errors - const _errs72 = errors - if ( - errors === _errs72 - ) { - if ( - data27 && - typeof data27 == - "object" && - !Array.isArray( - data27, - ) - ) { - let missing3 - if ( - data27.$ref === - undefined && - (missing3 = - "$ref") - ) { - const err15 = { - instancePath: - instancePath + - "/anyOf/" + - i4, - schemaPath: - "#/definitions/Reference/required", - keyword: - "required", - params: { - missingProperty: - missing3, - }, - message: - "must have required property '" + - missing3 + - "'", - } - if ( - vErrors === null - ) { - vErrors = [ - err15, - ] - } else { - vErrors.push( - err15, - ) - } - errors++ - } else { - var valid17 = true - for (const key4 in data27) { - if ( - pattern18.test( - key4, - ) - ) { - let data28 = - data27[key4] - const _errs74 = - errors - if ( - errors === - _errs74 - ) { - if ( - errors === - _errs74 - ) { - if ( - typeof data28 === - "string" - ) { - if ( - !formats0.test( - data28, - ) - ) { - const err16 = - { - instancePath: - instancePath + - "/anyOf/" + - i4 + - "/" + - key4 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: - "format", - params: - { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === - null - ) { - vErrors = - [ - err16, - ] - } else { - vErrors.push( - err16, - ) - } - errors++ - } - } else { - const err17 = - { - instancePath: - instancePath + - "/anyOf/" + - i4 + - "/" + - key4 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - } - if ( - vErrors === - null - ) { - vErrors = - [ - err17, - ] - } else { - vErrors.push( - err17, - ) - } - errors++ - } - } - } - var valid17 = - _errs74 === - errors - if ( - !valid17 - ) { - break - } - } - } - } - } else { - const err18 = { - instancePath: - instancePath + - "/anyOf/" + - i4, - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: { - type: "object", - }, - message: - "must be object", - } - if ( - vErrors === null - ) { - vErrors = [err18] - } else { - vErrors.push( - err18, - ) - } - errors++ - } - } - var _valid3 = - _errs71 === errors - if ( - _valid3 && - valid15 - ) { - valid15 = false - passing3 = [ - passing3, - 1, - ] - } else { - if (_valid3) { - valid15 = true - passing3 = 1 - } - } - if (!valid15) { - const err19 = { - instancePath: - instancePath + - "/anyOf/" + - i4, - schemaPath: - "#/properties/anyOf/items/oneOf", - keyword: "oneOf", - params: { - passingSchemas: - passing3, - }, - message: - "must match exactly one schema in oneOf", - } - if ( - vErrors === null - ) { - vErrors = [err19] - } else { - vErrors.push(err19) - } - errors++ - validate21.errors = - vErrors - return false - } else { - errors = _errs69 - if ( - vErrors !== null - ) { - if (_errs69) { - vErrors.length = - _errs69 - } else { - vErrors = null - } - } - } - var valid14 = - _errs68 === errors - if (!valid14) { - break - } - } - } else { - validate21.errors = [ - { - instancePath: - instancePath + - "/anyOf", - schemaPath: - "#/properties/anyOf/type", - keyword: "type", - params: { - type: "array", - }, - message: - "must be array", - }, - ] - return false - } - } - var valid0 = - _errs66 === errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.items !== undefined - ) { - let data29 = data.items - const _errs76 = errors - const _errs77 = errors - let valid18 = false - let passing4 = null - const _errs78 = errors - if ( - !wrapper0.validate( - data29, - { - instancePath: - instancePath + - "/items", - parentData: data, - parentDataProperty: - "items", - rootData, - }, - ) - ) { - vErrors = - vErrors === null - ? wrapper0.validate - .errors - : vErrors.concat( - wrapper0.validate - .errors, - ) - errors = vErrors.length - } - var _valid4 = - _errs78 === errors - if (_valid4) { - valid18 = true - passing4 = 0 - } - const _errs79 = errors - const _errs80 = errors - if (errors === _errs80) { - if ( - data29 && - typeof data29 == - "object" && - !Array.isArray(data29) - ) { - let missing4 - if ( - data29.$ref === - undefined && - (missing4 = "$ref") - ) { - const err20 = { - instancePath: - instancePath + - "/items", - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: { - missingProperty: - missing4, - }, - message: - "must have required property '" + - missing4 + - "'", - } - if ( - vErrors === null - ) { - vErrors = [err20] - } else { - vErrors.push(err20) - } - errors++ - } else { - var valid20 = true - for (const key5 in data29) { - if ( - pattern18.test( - key5, - ) - ) { - let data30 = - data29[key5] - const _errs82 = - errors - if ( - errors === - _errs82 - ) { - if ( - errors === - _errs82 - ) { - if ( - typeof data30 === - "string" - ) { - if ( - !formats0.test( - data30, - ) - ) { - const err21 = - { - instancePath: - instancePath + - "/items/" + - key5 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: - "format", - params: - { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === - null - ) { - vErrors = - [ - err21, - ] - } else { - vErrors.push( - err21, - ) - } - errors++ - } - } else { - const err22 = - { - instancePath: - instancePath + - "/items/" + - key5 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - } - if ( - vErrors === - null - ) { - vErrors = - [err22] - } else { - vErrors.push( - err22, - ) - } - errors++ - } - } - } - var valid20 = - _errs82 === - errors - if (!valid20) { - break - } - } - } - } - } else { - const err23 = { - instancePath: - instancePath + - "/items", - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: { - type: "object", - }, - message: - "must be object", - } - if (vErrors === null) { - vErrors = [err23] - } else { - vErrors.push(err23) - } - errors++ - } - } - var _valid4 = - _errs79 === errors - if (_valid4 && valid18) { - valid18 = false - passing4 = [passing4, 1] - } else { - if (_valid4) { - valid18 = true - passing4 = 1 - } - } - if (!valid18) { - const err24 = { - instancePath: - instancePath + - "/items", - schemaPath: - "#/properties/items/oneOf", - keyword: "oneOf", - params: { - passingSchemas: - passing4, - }, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err24] - } else { - vErrors.push(err24) - } - errors++ - validate21.errors = - vErrors - return false - } else { - errors = _errs77 - if (vErrors !== null) { - if (_errs77) { - vErrors.length = - _errs77 - } else { - vErrors = null - } - } - } - var valid0 = - _errs76 === errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.properties !== - undefined - ) { - let data31 = - data.properties - const _errs84 = errors - if (errors === _errs84) { - if ( - data31 && - typeof data31 == - "object" && - !Array.isArray(data31) - ) { - for (const key6 in data31) { - let data32 = - data31[key6] - const _errs87 = - errors - const _errs88 = - errors - let valid22 = false - let passing5 = null - const _errs89 = - errors - if ( - !wrapper0.validate( - data32, - { - instancePath: - instancePath + - "/properties/" + - key6 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - parentData: - data31, - parentDataProperty: - key6, - rootData, - }, - ) - ) { - vErrors = - vErrors === null - ? wrapper0 - .validate - .errors - : vErrors.concat( - wrapper0 - .validate - .errors, - ) - errors = - vErrors.length - } - var _valid5 = - _errs89 === errors - if (_valid5) { - valid22 = true - passing5 = 0 - } - const _errs90 = - errors - const _errs91 = - errors - if ( - errors === _errs91 - ) { - if ( - data32 && - typeof data32 == - "object" && - !Array.isArray( - data32, - ) - ) { - let missing5 - if ( - data32.$ref === - undefined && - (missing5 = - "$ref") - ) { - const err25 = - { - instancePath: - instancePath + - "/properties/" + - key6 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/required", - keyword: - "required", - params: { - missingProperty: - missing5, - }, - message: - "must have required property '" + - missing5 + - "'", - } - if ( - vErrors === - null - ) { - vErrors = [ - err25, - ] - } else { - vErrors.push( - err25, - ) - } - errors++ - } else { - var valid24 = true - for (const key7 in data32) { - if ( - pattern18.test( - key7, - ) - ) { - let data33 = - data32[ - key7 - ] - const _errs93 = - errors - if ( - errors === - _errs93 - ) { - if ( - errors === - _errs93 - ) { - if ( - typeof data33 === - "string" - ) { - if ( - !formats0.test( - data33, - ) - ) { - const err26 = - { - instancePath: - instancePath + - "/properties/" + - key6 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ) + - "/" + - key7 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: - "format", - params: - { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === - null - ) { - vErrors = - [ - err26, - ] - } else { - vErrors.push( - err26, - ) - } - errors++ - } - } else { - const err27 = - { - instancePath: - instancePath + - "/properties/" + - key6 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ) + - "/" + - key7 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - } - if ( - vErrors === - null - ) { - vErrors = - [ - err27, - ] - } else { - vErrors.push( - err27, - ) - } - errors++ - } - } - } - var valid24 = - _errs93 === - errors - if ( - !valid24 - ) { - break - } - } - } - } - } else { - const err28 = { - instancePath: - instancePath + - "/properties/" + - key6 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/type", - keyword: - "type", - params: { - type: "object", - }, - message: - "must be object", - } - if ( - vErrors === - null - ) { - vErrors = [ - err28, - ] - } else { - vErrors.push( - err28, - ) - } - errors++ - } - } - var _valid5 = - _errs90 === errors - if ( - _valid5 && - valid22 - ) { - valid22 = false - passing5 = [ - passing5, - 1, - ] - } else { - if (_valid5) { - valid22 = true - passing5 = 1 - } - } - if (!valid22) { - const err29 = { - instancePath: - instancePath + - "/properties/" + - key6 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/properties/properties/additionalProperties/oneOf", - keyword: - "oneOf", - params: { - passingSchemas: - passing5, - }, - message: - "must match exactly one schema in oneOf", - } - if ( - vErrors === null - ) { - vErrors = [ - err29, - ] - } else { - vErrors.push( - err29, - ) - } - errors++ - validate21.errors = - vErrors - return false - } else { - errors = _errs88 - if ( - vErrors !== null - ) { - if (_errs88) { - vErrors.length = - _errs88 - } else { - vErrors = null - } - } - } - var valid21 = - _errs87 === errors - if (!valid21) { - break - } - } - } else { - validate21.errors = [ - { - instancePath: - instancePath + - "/properties", - schemaPath: - "#/properties/properties/type", - keyword: "type", - params: { - type: "object", - }, - message: - "must be object", - }, - ] - return false - } - } - var valid0 = - _errs84 === errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.additionalProperties !== - undefined - ) { - let data34 = - data.additionalProperties - const _errs95 = errors - const _errs96 = errors - let valid25 = false - let passing6 = null - const _errs97 = errors - if ( - !wrapper0.validate( - data34, - { - instancePath: - instancePath + - "/additionalProperties", - parentData: data, - parentDataProperty: - "additionalProperties", - rootData, - }, - ) - ) { - vErrors = - vErrors === null - ? wrapper0 - .validate - .errors - : vErrors.concat( - wrapper0 - .validate - .errors, - ) - errors = - vErrors.length - } - var _valid6 = - _errs97 === errors - if (_valid6) { - valid25 = true - passing6 = 0 - } - const _errs98 = errors - const _errs99 = errors - if ( - errors === _errs99 - ) { - if ( - data34 && - typeof data34 == - "object" && - !Array.isArray( - data34, - ) - ) { - let missing6 - if ( - data34.$ref === - undefined && - (missing6 = - "$ref") - ) { - const err30 = { - instancePath: - instancePath + - "/additionalProperties", - schemaPath: - "#/definitions/Reference/required", - keyword: - "required", - params: { - missingProperty: - missing6, - }, - message: - "must have required property '" + - missing6 + - "'", - } - if ( - vErrors === null - ) { - vErrors = [ - err30, - ] - } else { - vErrors.push( - err30, - ) - } - errors++ - } else { - var valid27 = true - for (const key8 in data34) { - if ( - pattern18.test( - key8, - ) - ) { - let data35 = - data34[key8] - const _errs101 = - errors - if ( - errors === - _errs101 - ) { - if ( - errors === - _errs101 - ) { - if ( - typeof data35 === - "string" - ) { - if ( - !formats0.test( - data35, - ) - ) { - const err31 = - { - instancePath: - instancePath + - "/additionalProperties/" + - key8 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: - "format", - params: - { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === - null - ) { - vErrors = - [ - err31, - ] - } else { - vErrors.push( - err31, - ) - } - errors++ - } - } else { - const err32 = - { - instancePath: - instancePath + - "/additionalProperties/" + - key8 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - } - if ( - vErrors === - null - ) { - vErrors = - [ - err32, - ] - } else { - vErrors.push( - err32, - ) - } - errors++ - } - } - } - var valid27 = - _errs101 === - errors - if ( - !valid27 - ) { - break - } - } - } - } - } else { - const err33 = { - instancePath: - instancePath + - "/additionalProperties", - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: { - type: "object", - }, - message: - "must be object", - } - if ( - vErrors === null - ) { - vErrors = [err33] - } else { - vErrors.push( - err33, - ) - } - errors++ - } - } - var _valid6 = - _errs98 === errors - if ( - _valid6 && - valid25 - ) { - valid25 = false - passing6 = [ - passing6, - 1, - ] - } else { - if (_valid6) { - valid25 = true - passing6 = 1 - } - const _errs103 = - errors - if ( - typeof data34 !== - "boolean" - ) { - const err34 = { - instancePath: - instancePath + - "/additionalProperties", - schemaPath: - "#/properties/additionalProperties/oneOf/2/type", - keyword: "type", - params: { - type: "boolean", - }, - message: - "must be boolean", - } - if ( - vErrors === null - ) { - vErrors = [err34] - } else { - vErrors.push( - err34, - ) - } - errors++ - } - var _valid6 = - _errs103 === errors - if ( - _valid6 && - valid25 - ) { - valid25 = false - passing6 = [ - passing6, - 2, - ] - } else { - if (_valid6) { - valid25 = true - passing6 = 2 - } - } - } - if (!valid25) { - const err35 = { - instancePath: - instancePath + - "/additionalProperties", - schemaPath: - "#/properties/additionalProperties/oneOf", - keyword: "oneOf", - params: { - passingSchemas: - passing6, - }, - message: - "must match exactly one schema in oneOf", - } - if ( - vErrors === null - ) { - vErrors = [err35] - } else { - vErrors.push(err35) - } - errors++ - validate21.errors = - vErrors - return false - } else { - errors = _errs96 - if ( - vErrors !== null - ) { - if (_errs96) { - vErrors.length = - _errs96 - } else { - vErrors = null - } - } - } - var valid0 = - _errs95 === errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.description !== - undefined - ) { - const _errs105 = - errors - if ( - typeof data.description !== - "string" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/description", - schemaPath: - "#/properties/description/type", - keyword: - "type", - params: { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - var valid0 = - _errs105 === errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.format !== - undefined - ) { - const _errs107 = - errors - if ( - typeof data.format !== - "string" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/format", - schemaPath: - "#/properties/format/type", - keyword: - "type", - params: { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - var valid0 = - _errs107 === - errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.nullable !== - undefined - ) { - const _errs109 = - errors - if ( - typeof data.nullable !== - "boolean" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/nullable", - schemaPath: - "#/properties/nullable/type", - keyword: - "type", - params: { - type: "boolean", - }, - message: - "must be boolean", - }, - ] - return false - } - var valid0 = - _errs109 === - errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.discriminator !== - undefined - ) { - let data39 = - data.discriminator - const _errs111 = - errors - const _errs112 = - errors - if ( - errors === - _errs112 - ) { - if ( - data39 && - typeof data39 == - "object" && - !Array.isArray( - data39, - ) - ) { - let missing7 - if ( - data39.propertyName === - undefined && - (missing7 = - "propertyName") - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/discriminator", - schemaPath: - "#/definitions/Discriminator/required", - keyword: - "required", - params: - { - missingProperty: - missing7, - }, - message: - "must have required property '" + - missing7 + - "'", - }, - ] - return false - } else { - if ( - data39.propertyName !== - undefined - ) { - const _errs114 = - errors - if ( - typeof data39.propertyName !== - "string" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/discriminator/propertyName", - schemaPath: - "#/definitions/Discriminator/properties/propertyName/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - var valid29 = - _errs114 === - errors - } else { - var valid29 = true - } - if ( - valid29 - ) { - if ( - data39.mapping !== - undefined - ) { - let data41 = - data39.mapping - const _errs116 = - errors - if ( - errors === - _errs116 - ) { - if ( - data41 && - typeof data41 == - "object" && - !Array.isArray( - data41, - ) - ) { - for (const key9 in data41) { - const _errs119 = - errors - if ( - typeof data41[ - key9 - ] !== - "string" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/discriminator/mapping/" + - key9 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Discriminator/properties/mapping/additionalProperties/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - var valid30 = - _errs119 === - errors - if ( - !valid30 - ) { - break - } - } - } else { - validate21.errors = - [ - { - instancePath: - instancePath + - "/discriminator/mapping", - schemaPath: - "#/definitions/Discriminator/properties/mapping/type", - keyword: - "type", - params: - { - type: "object", - }, - message: - "must be object", - }, - ] - return false - } - } - var valid29 = - _errs116 === - errors - } else { - var valid29 = true - } - } - } - } else { - validate21.errors = - [ - { - instancePath: - instancePath + - "/discriminator", - schemaPath: - "#/definitions/Discriminator/type", - keyword: - "type", - params: - { - type: "object", - }, - message: - "must be object", - }, - ] - return false - } - } - var valid0 = - _errs111 === - errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.readOnly !== - undefined - ) { - const _errs121 = - errors - if ( - typeof data.readOnly !== - "boolean" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/readOnly", - schemaPath: - "#/properties/readOnly/type", - keyword: - "type", - params: - { - type: "boolean", - }, - message: - "must be boolean", - }, - ] - return false - } - var valid0 = - _errs121 === - errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.writeOnly !== - undefined - ) { - const _errs123 = - errors - if ( - typeof data.writeOnly !== - "boolean" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/writeOnly", - schemaPath: - "#/properties/writeOnly/type", - keyword: - "type", - params: - { - type: "boolean", - }, - message: - "must be boolean", - }, - ] - return false - } - var valid0 = - _errs123 === - errors - } else { - var valid0 = true - } - if (valid0) { - if ( - data.externalDocs !== - undefined - ) { - let data45 = - data.externalDocs - const _errs125 = - errors - const _errs126 = - errors - if ( - errors === - _errs126 - ) { - if ( - data45 && - typeof data45 == - "object" && - !Array.isArray( - data45, - ) - ) { - let missing8 - if ( - data45.url === - undefined && - (missing8 = - "url") - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/required", - keyword: - "required", - params: - { - missingProperty: - missing8, - }, - message: - "must have required property '" + - missing8 + - "'", - }, - ] - return false - } else { - const _errs128 = - errors - for (const key10 in data45) { - if ( - !( - key10 === - "description" || - key10 === - "url" || - pattern0.test( - key10, - ) - ) - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/additionalProperties", - keyword: - "additionalProperties", - params: - { - additionalProperty: - key10, - }, - message: - "must NOT have additional properties", - }, - ] - return false - break - } - } - if ( - _errs128 === - errors - ) { - if ( - data45.description !== - undefined - ) { - const _errs129 = - errors - if ( - typeof data45.description !== - "string" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/externalDocs/description", - schemaPath: - "#/definitions/ExternalDocumentation/properties/description/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - var valid32 = - _errs129 === - errors - } else { - var valid32 = true - } - if ( - valid32 - ) { - if ( - data45.url !== - undefined - ) { - let data47 = - data45.url - const _errs131 = - errors - if ( - errors === - _errs131 - ) { - if ( - errors === - _errs131 - ) { - if ( - typeof data47 === - "string" - ) { - if ( - !formats0.test( - data47, - ) - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/externalDocs/url", - schemaPath: - "#/definitions/ExternalDocumentation/properties/url/format", - keyword: - "format", - params: - { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate21.errors = - [ - { - instancePath: - instancePath + - "/externalDocs/url", - schemaPath: - "#/definitions/ExternalDocumentation/properties/url/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - } - } - var valid32 = - _errs131 === - errors - } else { - var valid32 = true - } - } - } - } - } else { - validate21.errors = - [ - { - instancePath: - instancePath + - "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/type", - keyword: - "type", - params: - { - type: "object", - }, - message: - "must be object", - }, - ] - return false - } - } - var valid0 = - _errs125 === - errors - } else { - var valid0 = true - } - if ( - valid0 - ) { - if ( - data.deprecated !== - undefined - ) { - const _errs133 = - errors - if ( - typeof data.deprecated !== - "boolean" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/deprecated", - schemaPath: - "#/properties/deprecated/type", - keyword: - "type", - params: - { - type: "boolean", - }, - message: - "must be boolean", - }, - ] - return false - } - var valid0 = - _errs133 === - errors - } else { - var valid0 = true - } - if ( - valid0 - ) { - if ( - data.xml !== - undefined - ) { - let data49 = - data.xml - const _errs135 = - errors - const _errs136 = - errors - if ( - errors === - _errs136 - ) { - if ( - data49 && - typeof data49 == - "object" && - !Array.isArray( - data49, - ) - ) { - const _errs138 = - errors - for (const key11 in data49) { - if ( - !( - key11 === - "name" || - key11 === - "namespace" || - key11 === - "prefix" || - key11 === - "attribute" || - key11 === - "wrapped" || - pattern0.test( - key11, - ) - ) - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/xml", - schemaPath: - "#/definitions/XML/additionalProperties", - keyword: - "additionalProperties", - params: - { - additionalProperty: - key11, - }, - message: - "must NOT have additional properties", - }, - ] - return false - break - } - } - if ( - _errs138 === - errors - ) { - if ( - data49.name !== - undefined - ) { - const _errs139 = - errors - if ( - typeof data49.name !== - "string" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/xml/name", - schemaPath: - "#/definitions/XML/properties/name/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - var valid34 = - _errs139 === - errors - } else { - var valid34 = true - } - if ( - valid34 - ) { - if ( - data49.namespace !== - undefined - ) { - let data51 = - data49.namespace - const _errs141 = - errors - if ( - errors === - _errs141 - ) { - if ( - errors === - _errs141 - ) { - if ( - typeof data51 === - "string" - ) { - if ( - !formats32( - data51, - ) - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/xml/namespace", - schemaPath: - "#/definitions/XML/properties/namespace/format", - keyword: - "format", - params: - { - format: - "uri", - }, - message: - 'must match format "' + - "uri" + - '"', - }, - ] - return false - } - } else { - validate21.errors = - [ - { - instancePath: - instancePath + - "/xml/namespace", - schemaPath: - "#/definitions/XML/properties/namespace/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - } - } - var valid34 = - _errs141 === - errors - } else { - var valid34 = true - } - if ( - valid34 - ) { - if ( - data49.prefix !== - undefined - ) { - const _errs143 = - errors - if ( - typeof data49.prefix !== - "string" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/xml/prefix", - schemaPath: - "#/definitions/XML/properties/prefix/type", - keyword: - "type", - params: - { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - var valid34 = - _errs143 === - errors - } else { - var valid34 = true - } - if ( - valid34 - ) { - if ( - data49.attribute !== - undefined - ) { - const _errs145 = - errors - if ( - typeof data49.attribute !== - "boolean" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/xml/attribute", - schemaPath: - "#/definitions/XML/properties/attribute/type", - keyword: - "type", - params: - { - type: "boolean", - }, - message: - "must be boolean", - }, - ] - return false - } - var valid34 = - _errs145 === - errors - } else { - var valid34 = true - } - if ( - valid34 - ) { - if ( - data49.wrapped !== - undefined - ) { - const _errs147 = - errors - if ( - typeof data49.wrapped !== - "boolean" - ) { - validate21.errors = - [ - { - instancePath: - instancePath + - "/xml/wrapped", - schemaPath: - "#/definitions/XML/properties/wrapped/type", - keyword: - "type", - params: - { - type: "boolean", - }, - message: - "must be boolean", - }, - ] - return false - } - var valid34 = - _errs147 === - errors - } else { - var valid34 = true - } - } - } - } - } - } - } else { - validate21.errors = - [ - { - instancePath: - instancePath + - "/xml", - schemaPath: - "#/definitions/XML/type", - keyword: - "type", - params: - { - type: "object", - }, - message: - "must be object", - }, - ] - return false - } - } - var valid0 = - _errs135 === - errors - } else { - var valid0 = true - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } else { - validate21.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate21.errors = vErrors - return errors === 0 -} -const schema44 = { - type: "object", - properties: { - schema: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - example: {}, - examples: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Example"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - encoding: { - type: "object", - additionalProperties: {$ref: "#/definitions/Encoding"}, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - allOf: [{$ref: "#/definitions/ExampleXORExamples"}], -} -const schema49 = { - type: "object", - properties: { - contentType: {type: "string"}, - headers: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Header"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - style: { - type: "string", - enum: ["form", "spaceDelimited", "pipeDelimited", "deepObject"], - }, - explode: {type: "boolean"}, - allowReserved: {type: "boolean", default: false}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema50 = { - type: "object", - properties: { - description: {type: "string"}, - required: {type: "boolean", default: false}, - deprecated: {type: "boolean", default: false}, - allowEmptyValue: {type: "boolean", default: false}, - style: {type: "string", enum: ["simple"], default: "simple"}, - explode: {type: "boolean"}, - allowReserved: {type: "boolean", default: false}, - schema: { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - content: { - type: "object", - additionalProperties: {$ref: "#/definitions/MediaType"}, - minProperties: 1, - maxProperties: 1, - }, - example: {}, - examples: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Example"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - allOf: [ - {$ref: "#/definitions/ExampleXORExamples"}, - {$ref: "#/definitions/SchemaXORContent"}, - ], -} -const wrapper7 = {validate: validate23} -function validate26( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - const _errs1 = errors - const _errs3 = errors - const _errs4 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if ( - (data.example === undefined && (missing0 = "example")) || - (data.examples === undefined && (missing0 = "examples")) - ) { - const err0 = {} - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } - } - var valid2 = _errs4 === errors - if (valid2) { - validate26.errors = [ - { - instancePath, - schemaPath: "#/definitions/ExampleXORExamples/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - }, - ] - return false - } else { - errors = _errs3 - if (vErrors !== null) { - if (_errs3) { - vErrors.length = _errs3 - } else { - vErrors = null - } - } - } - var valid0 = _errs1 === errors - if (valid0) { - const _errs5 = errors - const _errs7 = errors - const _errs8 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing1 - if ( - (data.schema === undefined && (missing1 = "schema")) || - (data.content === undefined && (missing1 = "content")) - ) { - const err1 = {} - if (vErrors === null) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - } - } - var valid4 = _errs8 === errors - if (valid4) { - validate26.errors = [ - { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - }, - ] - return false - } else { - errors = _errs7 - if (vErrors !== null) { - if (_errs7) { - vErrors.length = _errs7 - } else { - vErrors = null - } - } - const _errs9 = errors - let valid5 = false - let passing0 = null - const _errs10 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing2 - if (data.schema === undefined && (missing2 = "schema")) { - const err2 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf/0/required", - keyword: "required", - params: {missingProperty: missing2}, - message: "must have required property '" + missing2 + "'", - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - } - var _valid0 = _errs10 === errors - if (_valid0) { - valid5 = true - passing0 = 0 - } - const _errs11 = errors - const _errs12 = errors - const _errs13 = errors - const _errs14 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing3 - if (data.style === undefined && (missing3 = "style")) { - const err3 = {} - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - } - var valid7 = _errs14 === errors - if (valid7) { - const err4 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf/1/allOf/0/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - } else { - errors = _errs13 - if (vErrors !== null) { - if (_errs13) { - vErrors.length = _errs13 - } else { - vErrors = null - } - } - } - var valid6 = _errs12 === errors - if (valid6) { - const _errs15 = errors - const _errs16 = errors - const _errs17 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing4 - if (data.explode === undefined && (missing4 = "explode")) { - const err5 = {} - if (vErrors === null) { - vErrors = [err5] - } else { - vErrors.push(err5) - } - errors++ - } - } - var valid8 = _errs17 === errors - if (valid8) { - const err6 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf/1/allOf/1/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err6] - } else { - vErrors.push(err6) - } - errors++ - } else { - errors = _errs16 - if (vErrors !== null) { - if (_errs16) { - vErrors.length = _errs16 - } else { - vErrors = null - } - } - } - var valid6 = _errs15 === errors - if (valid6) { - const _errs18 = errors - const _errs19 = errors - const _errs20 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing5 - if ( - data.allowReserved === undefined && - (missing5 = "allowReserved") - ) { - const err7 = {} - if (vErrors === null) { - vErrors = [err7] - } else { - vErrors.push(err7) - } - errors++ - } - } - var valid9 = _errs20 === errors - if (valid9) { - const err8 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf/1/allOf/2/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err8] - } else { - vErrors.push(err8) - } - errors++ - } else { - errors = _errs19 - if (vErrors !== null) { - if (_errs19) { - vErrors.length = _errs19 - } else { - vErrors = null - } - } - } - var valid6 = _errs18 === errors - if (valid6) { - const _errs21 = errors - const _errs22 = errors - const _errs23 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing6 - if (data.example === undefined && (missing6 = "example")) { - const err9 = {} - if (vErrors === null) { - vErrors = [err9] - } else { - vErrors.push(err9) - } - errors++ - } - } - var valid10 = _errs23 === errors - if (valid10) { - const err10 = { - instancePath, - schemaPath: - "#/definitions/SchemaXORContent/oneOf/1/allOf/3/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err10] - } else { - vErrors.push(err10) - } - errors++ - } else { - errors = _errs22 - if (vErrors !== null) { - if (_errs22) { - vErrors.length = _errs22 - } else { - vErrors = null - } - } - } - var valid6 = _errs21 === errors - if (valid6) { - const _errs24 = errors - const _errs25 = errors - const _errs26 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing7 - if (data.examples === undefined && (missing7 = "examples")) { - const err11 = {} - if (vErrors === null) { - vErrors = [err11] - } else { - vErrors.push(err11) - } - errors++ - } - } - var valid11 = _errs26 === errors - if (valid11) { - const err12 = { - instancePath, - schemaPath: - "#/definitions/SchemaXORContent/oneOf/1/allOf/4/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err12] - } else { - vErrors.push(err12) - } - errors++ - } else { - errors = _errs25 - if (vErrors !== null) { - if (_errs25) { - vErrors.length = _errs25 - } else { - vErrors = null - } - } - } - var valid6 = _errs24 === errors - } - } - } - } - if (errors === _errs11) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing8 - if (data.content === undefined && (missing8 = "content")) { - const err13 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf/1/required", - keyword: "required", - params: {missingProperty: missing8}, - message: "must have required property '" + missing8 + "'", - } - if (vErrors === null) { - vErrors = [err13] - } else { - vErrors.push(err13) - } - errors++ - } - } - } - var _valid0 = _errs11 === errors - if (_valid0 && valid5) { - valid5 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid5 = true - passing0 = 1 - } - } - if (!valid5) { - const err14 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err14] - } else { - vErrors.push(err14) - } - errors++ - validate26.errors = vErrors - return false - } else { - errors = _errs9 - if (vErrors !== null) { - if (_errs9) { - vErrors.length = _errs9 - } else { - vErrors = null - } - } - } - } - var valid0 = _errs5 === errors - } - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - const _errs27 = errors - for (const key0 in data) { - if (!(func3.call(schema50.properties, key0) || pattern0.test(key0))) { - validate26.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs27 === errors) { - if (data.description !== undefined) { - const _errs28 = errors - if (typeof data.description !== "string") { - validate26.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid12 = _errs28 === errors - } else { - var valid12 = true - } - if (valid12) { - if (data.required !== undefined) { - const _errs30 = errors - if (typeof data.required !== "boolean") { - validate26.errors = [ - { - instancePath: instancePath + "/required", - schemaPath: "#/properties/required/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid12 = _errs30 === errors - } else { - var valid12 = true - } - if (valid12) { - if (data.deprecated !== undefined) { - const _errs32 = errors - if (typeof data.deprecated !== "boolean") { - validate26.errors = [ - { - instancePath: instancePath + "/deprecated", - schemaPath: "#/properties/deprecated/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid12 = _errs32 === errors - } else { - var valid12 = true - } - if (valid12) { - if (data.allowEmptyValue !== undefined) { - const _errs34 = errors - if (typeof data.allowEmptyValue !== "boolean") { - validate26.errors = [ - { - instancePath: instancePath + "/allowEmptyValue", - schemaPath: "#/properties/allowEmptyValue/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid12 = _errs34 === errors - } else { - var valid12 = true - } - if (valid12) { - if (data.style !== undefined) { - let data4 = data.style - const _errs36 = errors - if (typeof data4 !== "string") { - validate26.errors = [ - { - instancePath: instancePath + "/style", - schemaPath: "#/properties/style/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - if (!(data4 === "simple")) { - validate26.errors = [ - { - instancePath: instancePath + "/style", - schemaPath: "#/properties/style/enum", - keyword: "enum", - params: {allowedValues: schema50.properties.style.enum}, - message: "must be equal to one of the allowed values", - }, - ] - return false - } - var valid12 = _errs36 === errors - } else { - var valid12 = true - } - if (valid12) { - if (data.explode !== undefined) { - const _errs38 = errors - if (typeof data.explode !== "boolean") { - validate26.errors = [ - { - instancePath: instancePath + "/explode", - schemaPath: "#/properties/explode/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid12 = _errs38 === errors - } else { - var valid12 = true - } - if (valid12) { - if (data.allowReserved !== undefined) { - const _errs40 = errors - if (typeof data.allowReserved !== "boolean") { - validate26.errors = [ - { - instancePath: instancePath + "/allowReserved", - schemaPath: "#/properties/allowReserved/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid12 = _errs40 === errors - } else { - var valid12 = true - } - if (valid12) { - if (data.schema !== undefined) { - let data7 = data.schema - const _errs42 = errors - const _errs43 = errors - let valid13 = false - let passing1 = null - const _errs44 = errors - if ( - !validate21(data7, { - instancePath: instancePath + "/schema", - parentData: data, - parentDataProperty: "schema", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate21.errors - : vErrors.concat(validate21.errors) - errors = vErrors.length - } - var _valid1 = _errs44 === errors - if (_valid1) { - valid13 = true - passing1 = 0 - } - const _errs45 = errors - const _errs46 = errors - if (errors === _errs46) { - if ( - data7 && - typeof data7 == "object" && - !Array.isArray(data7) - ) { - let missing9 - if ( - data7.$ref === undefined && - (missing9 = "$ref") - ) { - const err15 = { - instancePath: instancePath + "/schema", - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing9}, - message: - "must have required property '" + - missing9 + - "'", - } - if (vErrors === null) { - vErrors = [err15] - } else { - vErrors.push(err15) - } - errors++ - } else { - var valid15 = true - for (const key1 in data7) { - if (pattern18.test(key1)) { - let data8 = data7[key1] - const _errs48 = errors - if (errors === _errs48) { - if (errors === _errs48) { - if (typeof data8 === "string") { - if (!formats0.test(data8)) { - const err16 = { - instancePath: - instancePath + - "/schema/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err16] - } else { - vErrors.push(err16) - } - errors++ - } - } else { - const err17 = { - instancePath: - instancePath + - "/schema/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err17] - } else { - vErrors.push(err17) - } - errors++ - } - } - } - var valid15 = _errs48 === errors - if (!valid15) { - break - } - } - } - } - } else { - const err18 = { - instancePath: instancePath + "/schema", - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err18] - } else { - vErrors.push(err18) - } - errors++ - } - } - var _valid1 = _errs45 === errors - if (_valid1 && valid13) { - valid13 = false - passing1 = [passing1, 1] - } else { - if (_valid1) { - valid13 = true - passing1 = 1 - } - } - if (!valid13) { - const err19 = { - instancePath: instancePath + "/schema", - schemaPath: "#/properties/schema/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing1}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err19] - } else { - vErrors.push(err19) - } - errors++ - validate26.errors = vErrors - return false - } else { - errors = _errs43 - if (vErrors !== null) { - if (_errs43) { - vErrors.length = _errs43 - } else { - vErrors = null - } - } - } - var valid12 = _errs42 === errors - } else { - var valid12 = true - } - if (valid12) { - if (data.content !== undefined) { - let data9 = data.content - const _errs50 = errors - if (errors === _errs50) { - if ( - data9 && - typeof data9 == "object" && - !Array.isArray(data9) - ) { - if (Object.keys(data9).length > 1) { - validate26.errors = [ - { - instancePath: instancePath + "/content", - schemaPath: - "#/properties/content/maxProperties", - keyword: "maxProperties", - params: {limit: 1}, - message: - "must NOT have more than 1 properties", - }, - ] - return false - } else { - if (Object.keys(data9).length < 1) { - validate26.errors = [ - { - instancePath: instancePath + "/content", - schemaPath: - "#/properties/content/minProperties", - keyword: "minProperties", - params: {limit: 1}, - message: - "must NOT have fewer than 1 properties", - }, - ] - return false - } else { - for (const key2 in data9) { - const _errs53 = errors - if ( - !wrapper7.validate(data9[key2], { - instancePath: - instancePath + - "/content/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - parentData: data9, - parentDataProperty: key2, - rootData, - }) - ) { - vErrors = - vErrors === null - ? wrapper7.validate.errors - : vErrors.concat( - wrapper7.validate.errors, - ) - errors = vErrors.length - } - var valid16 = _errs53 === errors - if (!valid16) { - break - } - } - } - } - } else { - validate26.errors = [ - { - instancePath: instancePath + "/content", - schemaPath: "#/properties/content/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid12 = _errs50 === errors - } else { - var valid12 = true - } - if (valid12) { - if (data.examples !== undefined) { - let data11 = data.examples - const _errs54 = errors - if (errors === _errs54) { - if ( - data11 && - typeof data11 == "object" && - !Array.isArray(data11) - ) { - for (const key3 in data11) { - let data12 = data11[key3] - const _errs57 = errors - const _errs58 = errors - let valid18 = false - let passing2 = null - const _errs59 = errors - const _errs60 = errors - if (errors === _errs60) { - if ( - data12 && - typeof data12 == "object" && - !Array.isArray(data12) - ) { - const _errs62 = errors - for (const key4 in data12) { - if ( - !( - key4 === "summary" || - key4 === "description" || - key4 === "value" || - key4 === "externalValue" || - pattern0.test(key4) - ) - ) { - const err20 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Example/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key4}, - message: - "must NOT have additional properties", - } - if (vErrors === null) { - vErrors = [err20] - } else { - vErrors.push(err20) - } - errors++ - break - } - } - if (_errs62 === errors) { - if (data12.summary !== undefined) { - const _errs63 = errors - if ( - typeof data12.summary !== "string" - ) { - const err21 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/summary", - schemaPath: - "#/definitions/Example/properties/summary/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err21] - } else { - vErrors.push(err21) - } - errors++ - } - var valid20 = _errs63 === errors - } else { - var valid20 = true - } - if (valid20) { - if ( - data12.description !== undefined - ) { - const _errs65 = errors - if ( - typeof data12.description !== - "string" - ) { - const err22 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/description", - schemaPath: - "#/definitions/Example/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err22] - } else { - vErrors.push(err22) - } - errors++ - } - var valid20 = _errs65 === errors - } else { - var valid20 = true - } - if (valid20) { - if ( - data12.externalValue !== undefined - ) { - let data15 = data12.externalValue - const _errs67 = errors - if (errors === _errs67) { - if (errors === _errs67) { - if ( - typeof data15 === "string" - ) { - if ( - !formats0.test(data15) - ) { - const err23 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace( - /\//g, - "~1", - ) + - "/externalValue", - schemaPath: - "#/definitions/Example/properties/externalValue/format", - keyword: "format", - params: { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err23] - } else { - vErrors.push(err23) - } - errors++ - } - } else { - const err24 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace( - /\//g, - "~1", - ) + - "/externalValue", - schemaPath: - "#/definitions/Example/properties/externalValue/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err24] - } else { - vErrors.push(err24) - } - errors++ - } - } - } - var valid20 = _errs67 === errors - } else { - var valid20 = true - } - } - } - } - } else { - const err25 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Example/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err25] - } else { - vErrors.push(err25) - } - errors++ - } - } - var _valid2 = _errs59 === errors - if (_valid2) { - valid18 = true - passing2 = 0 - } - const _errs69 = errors - const _errs70 = errors - if (errors === _errs70) { - if ( - data12 && - typeof data12 == "object" && - !Array.isArray(data12) - ) { - let missing10 - if ( - data12.$ref === undefined && - (missing10 = "$ref") - ) { - const err26 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing10}, - message: - "must have required property '" + - missing10 + - "'", - } - if (vErrors === null) { - vErrors = [err26] - } else { - vErrors.push(err26) - } - errors++ - } else { - var valid22 = true - for (const key5 in data12) { - if (pattern18.test(key5)) { - let data16 = data12[key5] - const _errs72 = errors - if (errors === _errs72) { - if (errors === _errs72) { - if ( - typeof data16 === "string" - ) { - if (!formats0.test(data16)) { - const err27 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace( - /\//g, - "~1", - ) + - "/" + - key5 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err27] - } else { - vErrors.push(err27) - } - errors++ - } - } else { - const err28 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key5 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err28] - } else { - vErrors.push(err28) - } - errors++ - } - } - } - var valid22 = _errs72 === errors - if (!valid22) { - break - } - } - } - } - } else { - const err29 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err29] - } else { - vErrors.push(err29) - } - errors++ - } - } - var _valid2 = _errs69 === errors - if (_valid2 && valid18) { - valid18 = false - passing2 = [passing2, 1] - } else { - if (_valid2) { - valid18 = true - passing2 = 1 - } - } - if (!valid18) { - const err30 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/properties/examples/additionalProperties/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing2}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err30] - } else { - vErrors.push(err30) - } - errors++ - validate26.errors = vErrors - return false - } else { - errors = _errs58 - if (vErrors !== null) { - if (_errs58) { - vErrors.length = _errs58 - } else { - vErrors = null - } - } - } - var valid17 = _errs57 === errors - if (!valid17) { - break - } - } - } else { - validate26.errors = [ - { - instancePath: instancePath + "/examples", - schemaPath: "#/properties/examples/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid12 = _errs54 === errors - } else { - var valid12 = true - } - } - } - } - } - } - } - } - } - } - } - } else { - validate26.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate26.errors = vErrors - return errors === 0 -} -function validate25( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - const _errs1 = errors - for (const key0 in data) { - if ( - !( - key0 === "contentType" || - key0 === "headers" || - key0 === "style" || - key0 === "explode" || - key0 === "allowReserved" || - pattern0.test(key0) - ) - ) { - validate25.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.contentType !== undefined) { - const _errs2 = errors - if (typeof data.contentType !== "string") { - validate25.errors = [ - { - instancePath: instancePath + "/contentType", - schemaPath: "#/properties/contentType/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.headers !== undefined) { - let data1 = data.headers - const _errs4 = errors - if (errors === _errs4) { - if (data1 && typeof data1 == "object" && !Array.isArray(data1)) { - for (const key1 in data1) { - let data2 = data1[key1] - const _errs7 = errors - const _errs8 = errors - let valid2 = false - let passing0 = null - const _errs9 = errors - if ( - !validate26(data2, { - instancePath: - instancePath + - "/headers/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data1, - parentDataProperty: key1, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate26.errors - : vErrors.concat(validate26.errors) - errors = vErrors.length - } - var _valid0 = _errs9 === errors - if (_valid0) { - valid2 = true - passing0 = 0 - } - const _errs10 = errors - const _errs11 = errors - if (errors === _errs11) { - if ( - data2 && - typeof data2 == "object" && - !Array.isArray(data2) - ) { - let missing0 - if (data2.$ref === undefined && (missing0 = "$ref")) { - const err0 = { - instancePath: - instancePath + - "/headers/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing0}, - message: - "must have required property '" + missing0 + "'", - } - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } else { - var valid4 = true - for (const key2 in data2) { - if (pattern18.test(key2)) { - let data3 = data2[key2] - const _errs13 = errors - if (errors === _errs13) { - if (errors === _errs13) { - if (typeof data3 === "string") { - if (!formats0.test(data3)) { - const err1 = { - instancePath: - instancePath + - "/headers/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - } - } else { - const err2 = { - instancePath: - instancePath + - "/headers/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - } - } - var valid4 = _errs13 === errors - if (!valid4) { - break - } - } - } - } - } else { - const err3 = { - instancePath: - instancePath + - "/headers/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - } - var _valid0 = _errs10 === errors - if (_valid0 && valid2) { - valid2 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid2 = true - passing0 = 1 - } - } - if (!valid2) { - const err4 = { - instancePath: - instancePath + - "/headers/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/properties/headers/additionalProperties/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - validate25.errors = vErrors - return false - } else { - errors = _errs8 - if (vErrors !== null) { - if (_errs8) { - vErrors.length = _errs8 - } else { - vErrors = null - } - } - } - var valid1 = _errs7 === errors - if (!valid1) { - break - } - } - } else { - validate25.errors = [ - { - instancePath: instancePath + "/headers", - schemaPath: "#/properties/headers/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.style !== undefined) { - let data4 = data.style - const _errs15 = errors - if (typeof data4 !== "string") { - validate25.errors = [ - { - instancePath: instancePath + "/style", - schemaPath: "#/properties/style/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - if ( - !( - data4 === "form" || - data4 === "spaceDelimited" || - data4 === "pipeDelimited" || - data4 === "deepObject" - ) - ) { - validate25.errors = [ - { - instancePath: instancePath + "/style", - schemaPath: "#/properties/style/enum", - keyword: "enum", - params: {allowedValues: schema49.properties.style.enum}, - message: "must be equal to one of the allowed values", - }, - ] - return false - } - var valid0 = _errs15 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.explode !== undefined) { - const _errs17 = errors - if (typeof data.explode !== "boolean") { - validate25.errors = [ - { - instancePath: instancePath + "/explode", - schemaPath: "#/properties/explode/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid0 = _errs17 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.allowReserved !== undefined) { - const _errs19 = errors - if (typeof data.allowReserved !== "boolean") { - validate25.errors = [ - { - instancePath: instancePath + "/allowReserved", - schemaPath: "#/properties/allowReserved/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid0 = _errs19 === errors - } else { - var valid0 = true - } - } - } - } - } - } - } else { - validate25.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate25.errors = vErrors - return errors === 0 -} -function validate23( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - const _errs3 = errors - const _errs4 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if ( - (data.example === undefined && (missing0 = "example")) || - (data.examples === undefined && (missing0 = "examples")) - ) { - const err0 = {} - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } - } - var valid2 = _errs4 === errors - if (valid2) { - validate23.errors = [ - { - instancePath, - schemaPath: "#/definitions/ExampleXORExamples/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - }, - ] - return false - } else { - errors = _errs3 - if (vErrors !== null) { - if (_errs3) { - vErrors.length = _errs3 - } else { - vErrors = null - } - } - } - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - const _errs5 = errors - for (const key0 in data) { - if ( - !( - key0 === "schema" || - key0 === "example" || - key0 === "examples" || - key0 === "encoding" || - pattern0.test(key0) - ) - ) { - validate23.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs5 === errors) { - if (data.schema !== undefined) { - let data0 = data.schema - const _errs6 = errors - const _errs7 = errors - let valid4 = false - let passing0 = null - const _errs8 = errors - if ( - !validate21(data0, { - instancePath: instancePath + "/schema", - parentData: data, - parentDataProperty: "schema", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate21.errors - : vErrors.concat(validate21.errors) - errors = vErrors.length - } - var _valid0 = _errs8 === errors - if (_valid0) { - valid4 = true - passing0 = 0 - } - const _errs9 = errors - const _errs10 = errors - if (errors === _errs10) { - if (data0 && typeof data0 == "object" && !Array.isArray(data0)) { - let missing1 - if (data0.$ref === undefined && (missing1 = "$ref")) { - const err1 = { - instancePath: instancePath + "/schema", - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing1}, - message: "must have required property '" + missing1 + "'", - } - if (vErrors === null) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - } else { - var valid6 = true - for (const key1 in data0) { - if (pattern18.test(key1)) { - let data1 = data0[key1] - const _errs12 = errors - if (errors === _errs12) { - if (errors === _errs12) { - if (typeof data1 === "string") { - if (!formats0.test(data1)) { - const err2 = { - instancePath: - instancePath + - "/schema/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + "uri-reference" + '"', - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - } else { - const err3 = { - instancePath: - instancePath + - "/schema/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - } - } - var valid6 = _errs12 === errors - if (!valid6) { - break - } - } - } - } - } else { - const err4 = { - instancePath: instancePath + "/schema", - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - } - } - var _valid0 = _errs9 === errors - if (_valid0 && valid4) { - valid4 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid4 = true - passing0 = 1 - } - } - if (!valid4) { - const err5 = { - instancePath: instancePath + "/schema", - schemaPath: "#/properties/schema/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err5] - } else { - vErrors.push(err5) - } - errors++ - validate23.errors = vErrors - return false - } else { - errors = _errs7 - if (vErrors !== null) { - if (_errs7) { - vErrors.length = _errs7 - } else { - vErrors = null - } - } - } - var valid3 = _errs6 === errors - } else { - var valid3 = true - } - if (valid3) { - if (data.examples !== undefined) { - let data2 = data.examples - const _errs14 = errors - if (errors === _errs14) { - if (data2 && typeof data2 == "object" && !Array.isArray(data2)) { - for (const key2 in data2) { - let data3 = data2[key2] - const _errs17 = errors - const _errs18 = errors - let valid8 = false - let passing1 = null - const _errs19 = errors - const _errs20 = errors - if (errors === _errs20) { - if ( - data3 && - typeof data3 == "object" && - !Array.isArray(data3) - ) { - const _errs22 = errors - for (const key3 in data3) { - if ( - !( - key3 === "summary" || - key3 === "description" || - key3 === "value" || - key3 === "externalValue" || - pattern0.test(key3) - ) - ) { - const err6 = { - instancePath: - instancePath + - "/examples/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/definitions/Example/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key3}, - message: "must NOT have additional properties", - } - if (vErrors === null) { - vErrors = [err6] - } else { - vErrors.push(err6) - } - errors++ - break - } - } - if (_errs22 === errors) { - if (data3.summary !== undefined) { - const _errs23 = errors - if (typeof data3.summary !== "string") { - const err7 = { - instancePath: - instancePath + - "/examples/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1") + - "/summary", - schemaPath: - "#/definitions/Example/properties/summary/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err7] - } else { - vErrors.push(err7) - } - errors++ - } - var valid10 = _errs23 === errors - } else { - var valid10 = true - } - if (valid10) { - if (data3.description !== undefined) { - const _errs25 = errors - if (typeof data3.description !== "string") { - const err8 = { - instancePath: - instancePath + - "/examples/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/description", - schemaPath: - "#/definitions/Example/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err8] - } else { - vErrors.push(err8) - } - errors++ - } - var valid10 = _errs25 === errors - } else { - var valid10 = true - } - if (valid10) { - if (data3.externalValue !== undefined) { - let data6 = data3.externalValue - const _errs27 = errors - if (errors === _errs27) { - if (errors === _errs27) { - if (typeof data6 === "string") { - if (!formats0.test(data6)) { - const err9 = { - instancePath: - instancePath + - "/examples/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/externalValue", - schemaPath: - "#/definitions/Example/properties/externalValue/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err9] - } else { - vErrors.push(err9) - } - errors++ - } - } else { - const err10 = { - instancePath: - instancePath + - "/examples/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/externalValue", - schemaPath: - "#/definitions/Example/properties/externalValue/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err10] - } else { - vErrors.push(err10) - } - errors++ - } - } - } - var valid10 = _errs27 === errors - } else { - var valid10 = true - } - } - } - } - } else { - const err11 = { - instancePath: - instancePath + - "/examples/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Example/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err11] - } else { - vErrors.push(err11) - } - errors++ - } - } - var _valid1 = _errs19 === errors - if (_valid1) { - valid8 = true - passing1 = 0 - } - const _errs29 = errors - const _errs30 = errors - if (errors === _errs30) { - if ( - data3 && - typeof data3 == "object" && - !Array.isArray(data3) - ) { - let missing2 - if (data3.$ref === undefined && (missing2 = "$ref")) { - const err12 = { - instancePath: - instancePath + - "/examples/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing2}, - message: - "must have required property '" + missing2 + "'", - } - if (vErrors === null) { - vErrors = [err12] - } else { - vErrors.push(err12) - } - errors++ - } else { - var valid12 = true - for (const key4 in data3) { - if (pattern18.test(key4)) { - let data7 = data3[key4] - const _errs32 = errors - if (errors === _errs32) { - if (errors === _errs32) { - if (typeof data7 === "string") { - if (!formats0.test(data7)) { - const err13 = { - instancePath: - instancePath + - "/examples/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err13] - } else { - vErrors.push(err13) - } - errors++ - } - } else { - const err14 = { - instancePath: - instancePath + - "/examples/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err14] - } else { - vErrors.push(err14) - } - errors++ - } - } - } - var valid12 = _errs32 === errors - if (!valid12) { - break - } - } - } - } - } else { - const err15 = { - instancePath: - instancePath + - "/examples/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err15] - } else { - vErrors.push(err15) - } - errors++ - } - } - var _valid1 = _errs29 === errors - if (_valid1 && valid8) { - valid8 = false - passing1 = [passing1, 1] - } else { - if (_valid1) { - valid8 = true - passing1 = 1 - } - } - if (!valid8) { - const err16 = { - instancePath: - instancePath + - "/examples/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/properties/examples/additionalProperties/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing1}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err16] - } else { - vErrors.push(err16) - } - errors++ - validate23.errors = vErrors - return false - } else { - errors = _errs18 - if (vErrors !== null) { - if (_errs18) { - vErrors.length = _errs18 - } else { - vErrors = null - } - } - } - var valid7 = _errs17 === errors - if (!valid7) { - break - } - } - } else { - validate23.errors = [ - { - instancePath: instancePath + "/examples", - schemaPath: "#/properties/examples/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid3 = _errs14 === errors - } else { - var valid3 = true - } - if (valid3) { - if (data.encoding !== undefined) { - let data8 = data.encoding - const _errs34 = errors - if (errors === _errs34) { - if ( - data8 && - typeof data8 == "object" && - !Array.isArray(data8) - ) { - for (const key5 in data8) { - const _errs37 = errors - if ( - !validate25(data8[key5], { - instancePath: - instancePath + - "/encoding/" + - key5.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data8, - parentDataProperty: key5, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate25.errors - : vErrors.concat(validate25.errors) - errors = vErrors.length - } - var valid13 = _errs37 === errors - if (!valid13) { - break - } - } - } else { - validate23.errors = [ - { - instancePath: instancePath + "/encoding", - schemaPath: "#/properties/encoding/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid3 = _errs34 === errors - } else { - var valid3 = true - } - } - } - } - } else { - validate23.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate23.errors = vErrors - return errors === 0 -} -function validate20( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - const _errs1 = errors - let valid0 = false - let passing0 = null - const _errs2 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if (data.required === undefined && (missing0 = "required")) { - const err0 = { - instancePath, - schemaPath: "#/definitions/PathParameter/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - } - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } else { - if (data.in !== undefined) { - const _errs4 = errors - if (!(data.in === "path")) { - const err1 = { - instancePath: instancePath + "/in", - schemaPath: "#/definitions/PathParameter/properties/in/enum", - keyword: "enum", - params: {allowedValues: schema26.properties.in.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - } - var valid2 = _errs4 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data.style !== undefined) { - let data1 = data.style - const _errs5 = errors - if ( - !(data1 === "matrix" || data1 === "label" || data1 === "simple") - ) { - const err2 = { - instancePath: instancePath + "/style", - schemaPath: "#/definitions/PathParameter/properties/style/enum", - keyword: "enum", - params: {allowedValues: schema26.properties.style.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - var valid2 = _errs5 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data.required !== undefined) { - const _errs6 = errors - if (!(data.required === true)) { - const err3 = { - instancePath: instancePath + "/required", - schemaPath: - "#/definitions/PathParameter/properties/required/enum", - keyword: "enum", - params: {allowedValues: schema26.properties.required.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - var valid2 = _errs6 === errors - } else { - var valid2 = true - } - } - } - } - } - var _valid0 = _errs2 === errors - if (_valid0) { - valid0 = true - passing0 = 0 - } - const _errs7 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.in !== undefined) { - const _errs9 = errors - if (!(data.in === "query")) { - const err4 = { - instancePath: instancePath + "/in", - schemaPath: "#/definitions/QueryParameter/properties/in/enum", - keyword: "enum", - params: {allowedValues: schema27.properties.in.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - } - var valid4 = _errs9 === errors - } else { - var valid4 = true - } - if (valid4) { - if (data.style !== undefined) { - let data4 = data.style - const _errs10 = errors - if ( - !( - data4 === "form" || - data4 === "spaceDelimited" || - data4 === "pipeDelimited" || - data4 === "deepObject" - ) - ) { - const err5 = { - instancePath: instancePath + "/style", - schemaPath: "#/definitions/QueryParameter/properties/style/enum", - keyword: "enum", - params: {allowedValues: schema27.properties.style.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err5] - } else { - vErrors.push(err5) - } - errors++ - } - var valid4 = _errs10 === errors - } else { - var valid4 = true - } - } - } - var _valid0 = _errs7 === errors - if (_valid0 && valid0) { - valid0 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid0 = true - passing0 = 1 - } - const _errs11 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.in !== undefined) { - const _errs13 = errors - if (!(data.in === "header")) { - const err6 = { - instancePath: instancePath + "/in", - schemaPath: "#/definitions/HeaderParameter/properties/in/enum", - keyword: "enum", - params: {allowedValues: schema28.properties.in.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err6] - } else { - vErrors.push(err6) - } - errors++ - } - var valid6 = _errs13 === errors - } else { - var valid6 = true - } - if (valid6) { - if (data.style !== undefined) { - const _errs14 = errors - if (!(data.style === "simple")) { - const err7 = { - instancePath: instancePath + "/style", - schemaPath: "#/definitions/HeaderParameter/properties/style/enum", - keyword: "enum", - params: {allowedValues: schema28.properties.style.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err7] - } else { - vErrors.push(err7) - } - errors++ - } - var valid6 = _errs14 === errors - } else { - var valid6 = true - } - } - } - var _valid0 = _errs11 === errors - if (_valid0 && valid0) { - valid0 = false - passing0 = [passing0, 2] - } else { - if (_valid0) { - valid0 = true - passing0 = 2 - } - const _errs15 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.in !== undefined) { - const _errs17 = errors - if (!(data.in === "cookie")) { - const err8 = { - instancePath: instancePath + "/in", - schemaPath: "#/definitions/CookieParameter/properties/in/enum", - keyword: "enum", - params: {allowedValues: schema29.properties.in.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err8] - } else { - vErrors.push(err8) - } - errors++ - } - var valid8 = _errs17 === errors - } else { - var valid8 = true - } - if (valid8) { - if (data.style !== undefined) { - const _errs18 = errors - if (!(data.style === "form")) { - const err9 = { - instancePath: instancePath + "/style", - schemaPath: - "#/definitions/CookieParameter/properties/style/enum", - keyword: "enum", - params: {allowedValues: schema29.properties.style.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err9] - } else { - vErrors.push(err9) - } - errors++ - } - var valid8 = _errs18 === errors - } else { - var valid8 = true - } - } - } - var _valid0 = _errs15 === errors - if (_valid0 && valid0) { - valid0 = false - passing0 = [passing0, 3] - } else { - if (_valid0) { - valid0 = true - passing0 = 3 - } - } - } - } - if (!valid0) { - const err10 = { - instancePath, - schemaPath: "#/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err10] - } else { - vErrors.push(err10) - } - errors++ - validate20.errors = vErrors - return false - } else { - errors = _errs1 - if (vErrors !== null) { - if (_errs1) { - vErrors.length = _errs1 - } else { - vErrors = null - } - } - const _errs19 = errors - const _errs21 = errors - const _errs22 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing1 - if ( - (data.example === undefined && (missing1 = "example")) || - (data.examples === undefined && (missing1 = "examples")) - ) { - const err11 = {} - if (vErrors === null) { - vErrors = [err11] - } else { - vErrors.push(err11) - } - errors++ - } - } - var valid11 = _errs22 === errors - if (valid11) { - validate20.errors = [ - { - instancePath, - schemaPath: "#/definitions/ExampleXORExamples/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - }, - ] - return false - } else { - errors = _errs21 - if (vErrors !== null) { - if (_errs21) { - vErrors.length = _errs21 - } else { - vErrors = null - } - } - } - var valid9 = _errs19 === errors - if (valid9) { - const _errs23 = errors - const _errs25 = errors - const _errs26 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing2 - if ( - (data.schema === undefined && (missing2 = "schema")) || - (data.content === undefined && (missing2 = "content")) - ) { - const err12 = {} - if (vErrors === null) { - vErrors = [err12] - } else { - vErrors.push(err12) - } - errors++ - } - } - var valid13 = _errs26 === errors - if (valid13) { - validate20.errors = [ - { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - }, - ] - return false - } else { - errors = _errs25 - if (vErrors !== null) { - if (_errs25) { - vErrors.length = _errs25 - } else { - vErrors = null - } - } - const _errs27 = errors - let valid14 = false - let passing1 = null - const _errs28 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing3 - if (data.schema === undefined && (missing3 = "schema")) { - const err13 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf/0/required", - keyword: "required", - params: {missingProperty: missing3}, - message: "must have required property '" + missing3 + "'", - } - if (vErrors === null) { - vErrors = [err13] - } else { - vErrors.push(err13) - } - errors++ - } - } - var _valid1 = _errs28 === errors - if (_valid1) { - valid14 = true - passing1 = 0 - } - const _errs29 = errors - const _errs30 = errors - const _errs31 = errors - const _errs32 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing4 - if (data.style === undefined && (missing4 = "style")) { - const err14 = {} - if (vErrors === null) { - vErrors = [err14] - } else { - vErrors.push(err14) - } - errors++ - } - } - var valid16 = _errs32 === errors - if (valid16) { - const err15 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf/1/allOf/0/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err15] - } else { - vErrors.push(err15) - } - errors++ - } else { - errors = _errs31 - if (vErrors !== null) { - if (_errs31) { - vErrors.length = _errs31 - } else { - vErrors = null - } - } - } - var valid15 = _errs30 === errors - if (valid15) { - const _errs33 = errors - const _errs34 = errors - const _errs35 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing5 - if (data.explode === undefined && (missing5 = "explode")) { - const err16 = {} - if (vErrors === null) { - vErrors = [err16] - } else { - vErrors.push(err16) - } - errors++ - } - } - var valid17 = _errs35 === errors - if (valid17) { - const err17 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf/1/allOf/1/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err17] - } else { - vErrors.push(err17) - } - errors++ - } else { - errors = _errs34 - if (vErrors !== null) { - if (_errs34) { - vErrors.length = _errs34 - } else { - vErrors = null - } - } - } - var valid15 = _errs33 === errors - if (valid15) { - const _errs36 = errors - const _errs37 = errors - const _errs38 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing6 - if ( - data.allowReserved === undefined && - (missing6 = "allowReserved") - ) { - const err18 = {} - if (vErrors === null) { - vErrors = [err18] - } else { - vErrors.push(err18) - } - errors++ - } - } - var valid18 = _errs38 === errors - if (valid18) { - const err19 = { - instancePath, - schemaPath: - "#/definitions/SchemaXORContent/oneOf/1/allOf/2/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err19] - } else { - vErrors.push(err19) - } - errors++ - } else { - errors = _errs37 - if (vErrors !== null) { - if (_errs37) { - vErrors.length = _errs37 - } else { - vErrors = null - } - } - } - var valid15 = _errs36 === errors - if (valid15) { - const _errs39 = errors - const _errs40 = errors - const _errs41 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing7 - if (data.example === undefined && (missing7 = "example")) { - const err20 = {} - if (vErrors === null) { - vErrors = [err20] - } else { - vErrors.push(err20) - } - errors++ - } - } - var valid19 = _errs41 === errors - if (valid19) { - const err21 = { - instancePath, - schemaPath: - "#/definitions/SchemaXORContent/oneOf/1/allOf/3/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err21] - } else { - vErrors.push(err21) - } - errors++ - } else { - errors = _errs40 - if (vErrors !== null) { - if (_errs40) { - vErrors.length = _errs40 - } else { - vErrors = null - } - } - } - var valid15 = _errs39 === errors - if (valid15) { - const _errs42 = errors - const _errs43 = errors - const _errs44 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing8 - if (data.examples === undefined && (missing8 = "examples")) { - const err22 = {} - if (vErrors === null) { - vErrors = [err22] - } else { - vErrors.push(err22) - } - errors++ - } - } - var valid20 = _errs44 === errors - if (valid20) { - const err23 = { - instancePath, - schemaPath: - "#/definitions/SchemaXORContent/oneOf/1/allOf/4/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err23] - } else { - vErrors.push(err23) - } - errors++ - } else { - errors = _errs43 - if (vErrors !== null) { - if (_errs43) { - vErrors.length = _errs43 - } else { - vErrors = null - } - } - } - var valid15 = _errs42 === errors - } - } - } - } - if (errors === _errs29) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing9 - if (data.content === undefined && (missing9 = "content")) { - const err24 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf/1/required", - keyword: "required", - params: {missingProperty: missing9}, - message: "must have required property '" + missing9 + "'", - } - if (vErrors === null) { - vErrors = [err24] - } else { - vErrors.push(err24) - } - errors++ - } - } - } - var _valid1 = _errs29 === errors - if (_valid1 && valid14) { - valid14 = false - passing1 = [passing1, 1] - } else { - if (_valid1) { - valid14 = true - passing1 = 1 - } - } - if (!valid14) { - const err25 = { - instancePath, - schemaPath: "#/definitions/SchemaXORContent/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing1}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err25] - } else { - vErrors.push(err25) - } - errors++ - validate20.errors = vErrors - return false - } else { - errors = _errs27 - if (vErrors !== null) { - if (_errs27) { - vErrors.length = _errs27 - } else { - vErrors = null - } - } - } - } - var valid9 = _errs23 === errors - } - } - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing10 - if ( - (data.name === undefined && (missing10 = "name")) || - (data.in === undefined && (missing10 = "in")) - ) { - validate20.errors = [ - { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: {missingProperty: missing10}, - message: "must have required property '" + missing10 + "'", - }, - ] - return false - } else { - const _errs45 = errors - for (const key0 in data) { - if (!(func3.call(schema25.properties, key0) || pattern0.test(key0))) { - validate20.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs45 === errors) { - if (data.name !== undefined) { - const _errs46 = errors - if (typeof data.name !== "string") { - validate20.errors = [ - { - instancePath: instancePath + "/name", - schemaPath: "#/properties/name/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid21 = _errs46 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.in !== undefined) { - const _errs48 = errors - if (typeof data.in !== "string") { - validate20.errors = [ - { - instancePath: instancePath + "/in", - schemaPath: "#/properties/in/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid21 = _errs48 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.description !== undefined) { - const _errs50 = errors - if (typeof data.description !== "string") { - validate20.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid21 = _errs50 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.required !== undefined) { - const _errs52 = errors - if (typeof data.required !== "boolean") { - validate20.errors = [ - { - instancePath: instancePath + "/required", - schemaPath: "#/properties/required/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid21 = _errs52 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.deprecated !== undefined) { - const _errs54 = errors - if (typeof data.deprecated !== "boolean") { - validate20.errors = [ - { - instancePath: instancePath + "/deprecated", - schemaPath: "#/properties/deprecated/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid21 = _errs54 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.allowEmptyValue !== undefined) { - const _errs56 = errors - if (typeof data.allowEmptyValue !== "boolean") { - validate20.errors = [ - { - instancePath: instancePath + "/allowEmptyValue", - schemaPath: "#/properties/allowEmptyValue/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid21 = _errs56 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.style !== undefined) { - const _errs58 = errors - if (typeof data.style !== "string") { - validate20.errors = [ - { - instancePath: instancePath + "/style", - schemaPath: "#/properties/style/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid21 = _errs58 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.explode !== undefined) { - const _errs60 = errors - if (typeof data.explode !== "boolean") { - validate20.errors = [ - { - instancePath: instancePath + "/explode", - schemaPath: "#/properties/explode/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid21 = _errs60 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.allowReserved !== undefined) { - const _errs62 = errors - if (typeof data.allowReserved !== "boolean") { - validate20.errors = [ - { - instancePath: instancePath + "/allowReserved", - schemaPath: "#/properties/allowReserved/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid21 = _errs62 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.schema !== undefined) { - let data18 = data.schema - const _errs64 = errors - const _errs65 = errors - let valid22 = false - let passing2 = null - const _errs66 = errors - if ( - !validate21(data18, { - instancePath: instancePath + "/schema", - parentData: data, - parentDataProperty: "schema", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate21.errors - : vErrors.concat(validate21.errors) - errors = vErrors.length - } - var _valid2 = _errs66 === errors - if (_valid2) { - valid22 = true - passing2 = 0 - } - const _errs67 = errors - const _errs68 = errors - if (errors === _errs68) { - if ( - data18 && - typeof data18 == "object" && - !Array.isArray(data18) - ) { - let missing11 - if ( - data18.$ref === undefined && - (missing11 = "$ref") - ) { - const err26 = { - instancePath: instancePath + "/schema", - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing11}, - message: - "must have required property '" + - missing11 + - "'", - } - if (vErrors === null) { - vErrors = [err26] - } else { - vErrors.push(err26) - } - errors++ - } else { - var valid24 = true - for (const key1 in data18) { - if (pattern18.test(key1)) { - let data19 = data18[key1] - const _errs70 = errors - if (errors === _errs70) { - if (errors === _errs70) { - if (typeof data19 === "string") { - if (!formats0.test(data19)) { - const err27 = { - instancePath: - instancePath + - "/schema/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err27] - } else { - vErrors.push(err27) - } - errors++ - } - } else { - const err28 = { - instancePath: - instancePath + - "/schema/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err28] - } else { - vErrors.push(err28) - } - errors++ - } - } - } - var valid24 = _errs70 === errors - if (!valid24) { - break - } - } - } - } - } else { - const err29 = { - instancePath: instancePath + "/schema", - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err29] - } else { - vErrors.push(err29) - } - errors++ - } - } - var _valid2 = _errs67 === errors - if (_valid2 && valid22) { - valid22 = false - passing2 = [passing2, 1] - } else { - if (_valid2) { - valid22 = true - passing2 = 1 - } - } - if (!valid22) { - const err30 = { - instancePath: instancePath + "/schema", - schemaPath: "#/properties/schema/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing2}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err30] - } else { - vErrors.push(err30) - } - errors++ - validate20.errors = vErrors - return false - } else { - errors = _errs65 - if (vErrors !== null) { - if (_errs65) { - vErrors.length = _errs65 - } else { - vErrors = null - } - } - } - var valid21 = _errs64 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.content !== undefined) { - let data20 = data.content - const _errs72 = errors - if (errors === _errs72) { - if ( - data20 && - typeof data20 == "object" && - !Array.isArray(data20) - ) { - if (Object.keys(data20).length > 1) { - validate20.errors = [ - { - instancePath: - instancePath + "/content", - schemaPath: - "#/properties/content/maxProperties", - keyword: "maxProperties", - params: {limit: 1}, - message: - "must NOT have more than 1 properties", - }, - ] - return false - } else { - if (Object.keys(data20).length < 1) { - validate20.errors = [ - { - instancePath: - instancePath + "/content", - schemaPath: - "#/properties/content/minProperties", - keyword: "minProperties", - params: {limit: 1}, - message: - "must NOT have fewer than 1 properties", - }, - ] - return false - } else { - for (const key2 in data20) { - const _errs75 = errors - if ( - !validate23(data20[key2], { - instancePath: - instancePath + - "/content/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - parentData: data20, - parentDataProperty: key2, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate23.errors - : vErrors.concat( - validate23.errors, - ) - errors = vErrors.length - } - var valid25 = _errs75 === errors - if (!valid25) { - break - } - } - } - } - } else { - validate20.errors = [ - { - instancePath: instancePath + "/content", - schemaPath: "#/properties/content/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid21 = _errs72 === errors - } else { - var valid21 = true - } - if (valid21) { - if (data.examples !== undefined) { - let data22 = data.examples - const _errs76 = errors - if (errors === _errs76) { - if ( - data22 && - typeof data22 == "object" && - !Array.isArray(data22) - ) { - for (const key3 in data22) { - let data23 = data22[key3] - const _errs79 = errors - const _errs80 = errors - let valid27 = false - let passing3 = null - const _errs81 = errors - const _errs82 = errors - if (errors === _errs82) { - if ( - data23 && - typeof data23 == "object" && - !Array.isArray(data23) - ) { - const _errs84 = errors - for (const key4 in data23) { - if ( - !( - key4 === "summary" || - key4 === "description" || - key4 === "value" || - key4 === "externalValue" || - pattern0.test(key4) - ) - ) { - const err31 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Example/additionalProperties", - keyword: - "additionalProperties", - params: { - additionalProperty: key4, - }, - message: - "must NOT have additional properties", - } - if (vErrors === null) { - vErrors = [err31] - } else { - vErrors.push(err31) - } - errors++ - break - } - } - if (_errs84 === errors) { - if ( - data23.summary !== undefined - ) { - const _errs85 = errors - if ( - typeof data23.summary !== - "string" - ) { - const err32 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/summary", - schemaPath: - "#/definitions/Example/properties/summary/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err32] - } else { - vErrors.push(err32) - } - errors++ - } - var valid29 = _errs85 === errors - } else { - var valid29 = true - } - if (valid29) { - if ( - data23.description !== - undefined - ) { - const _errs87 = errors - if ( - typeof data23.description !== - "string" - ) { - const err33 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace( - /\//g, - "~1", - ) + - "/description", - schemaPath: - "#/definitions/Example/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err33] - } else { - vErrors.push(err33) - } - errors++ - } - var valid29 = - _errs87 === errors - } else { - var valid29 = true - } - if (valid29) { - if ( - data23.externalValue !== - undefined - ) { - let data26 = - data23.externalValue - const _errs89 = errors - if (errors === _errs89) { - if (errors === _errs89) { - if ( - typeof data26 === - "string" - ) { - if ( - !formats0.test( - data26, - ) - ) { - const err34 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ) + - "/externalValue", - schemaPath: - "#/definitions/Example/properties/externalValue/format", - keyword: "format", - params: { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === null - ) { - vErrors = [err34] - } else { - vErrors.push( - err34, - ) - } - errors++ - } - } else { - const err35 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ) + - "/externalValue", - schemaPath: - "#/definitions/Example/properties/externalValue/type", - keyword: "type", - params: { - type: "string", - }, - message: - "must be string", - } - if ( - vErrors === null - ) { - vErrors = [err35] - } else { - vErrors.push(err35) - } - errors++ - } - } - } - var valid29 = - _errs89 === errors - } else { - var valid29 = true - } - } - } - } - } else { - const err36 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Example/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err36] - } else { - vErrors.push(err36) - } - errors++ - } - } - var _valid3 = _errs81 === errors - if (_valid3) { - valid27 = true - passing3 = 0 - } - const _errs91 = errors - const _errs92 = errors - if (errors === _errs92) { - if ( - data23 && - typeof data23 == "object" && - !Array.isArray(data23) - ) { - let missing12 - if ( - data23.$ref === undefined && - (missing12 = "$ref") - ) { - const err37 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: { - missingProperty: missing12, - }, - message: - "must have required property '" + - missing12 + - "'", - } - if (vErrors === null) { - vErrors = [err37] - } else { - vErrors.push(err37) - } - errors++ - } else { - var valid31 = true - for (const key5 in data23) { - if (pattern18.test(key5)) { - let data27 = data23[key5] - const _errs94 = errors - if (errors === _errs94) { - if (errors === _errs94) { - if ( - typeof data27 === - "string" - ) { - if ( - !formats0.test(data27) - ) { - const err38 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ) + - "/" + - key5 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === null - ) { - vErrors = [err38] - } else { - vErrors.push(err38) - } - errors++ - } - } else { - const err39 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ) + - "/" + - key5 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: { - type: "string", - }, - message: - "must be string", - } - if (vErrors === null) { - vErrors = [err39] - } else { - vErrors.push(err39) - } - errors++ - } - } - } - var valid31 = - _errs94 === errors - if (!valid31) { - break - } - } - } - } - } else { - const err40 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err40] - } else { - vErrors.push(err40) - } - errors++ - } - } - var _valid3 = _errs91 === errors - if (_valid3 && valid27) { - valid27 = false - passing3 = [passing3, 1] - } else { - if (_valid3) { - valid27 = true - passing3 = 1 - } - } - if (!valid27) { - const err41 = { - instancePath: - instancePath + - "/examples/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/properties/examples/additionalProperties/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing3}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err41] - } else { - vErrors.push(err41) - } - errors++ - validate20.errors = vErrors - return false - } else { - errors = _errs80 - if (vErrors !== null) { - if (_errs80) { - vErrors.length = _errs80 - } else { - vErrors = null - } - } - } - var valid26 = _errs79 === errors - if (!valid26) { - break - } - } - } else { - validate20.errors = [ - { - instancePath: - instancePath + "/examples", - schemaPath: - "#/properties/examples/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid21 = _errs76 === errors - } else { - var valid21 = true - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } else { - validate20.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate20.errors = vErrors - return errors === 0 -} -const schema60 = { - type: "object", - required: ["content"], - properties: { - description: {type: "string"}, - content: { - type: "object", - additionalProperties: {$ref: "#/definitions/MediaType"}, - }, - required: {type: "boolean", default: false}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -function validate32( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if (data.content === undefined && (missing0 = "content")) { - validate32.errors = [ - { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - }, - ] - return false - } else { - const _errs1 = errors - for (const key0 in data) { - if ( - !( - key0 === "description" || - key0 === "content" || - key0 === "required" || - pattern0.test(key0) - ) - ) { - validate32.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.description !== undefined) { - const _errs2 = errors - if (typeof data.description !== "string") { - validate32.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.content !== undefined) { - let data1 = data.content - const _errs4 = errors - if (errors === _errs4) { - if ( - data1 && - typeof data1 == "object" && - !Array.isArray(data1) - ) { - for (const key1 in data1) { - const _errs7 = errors - if ( - !validate23(data1[key1], { - instancePath: - instancePath + - "/content/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data1, - parentDataProperty: key1, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate23.errors - : vErrors.concat(validate23.errors) - errors = vErrors.length - } - var valid1 = _errs7 === errors - if (!valid1) { - break - } - } - } else { - validate32.errors = [ - { - instancePath: instancePath + "/content", - schemaPath: "#/properties/content/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.required !== undefined) { - const _errs8 = errors - if (typeof data.required !== "boolean") { - validate32.errors = [ - { - instancePath: instancePath + "/required", - schemaPath: "#/properties/required/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid0 = _errs8 === errors - } else { - var valid0 = true - } - } - } - } - } - } else { - validate32.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate32.errors = vErrors - return errors === 0 -} -const schema62 = { - type: "object", - properties: { - default: { - oneOf: [ - {$ref: "#/definitions/Response"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - patternProperties: { - "^[1-5](?:\\d{2}|XX)$": { - oneOf: [ - {$ref: "#/definitions/Response"}, - {$ref: "#/definitions/Reference"}, - ], - }, - "^x-": {}, - }, - minProperties: 1, - additionalProperties: false, -} -const pattern43 = new RegExp("^[1-5](?:\\d{2}|XX)$", "u") -const schema63 = { - type: "object", - required: ["description"], - properties: { - description: {type: "string"}, - headers: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Header"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - content: { - type: "object", - additionalProperties: {$ref: "#/definitions/MediaType"}, - }, - links: { - type: "object", - additionalProperties: { - oneOf: [ - {$ref: "#/definitions/Link"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema65 = { - type: "object", - properties: { - operationId: {type: "string"}, - operationRef: {type: "string", format: "uri-reference"}, - parameters: {type: "object", additionalProperties: {}}, - requestBody: {}, - description: {type: "string"}, - server: {$ref: "#/definitions/Server"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - not: { - description: "Operation Id and Operation Ref are mutually exclusive", - required: ["operationId", "operationRef"], - }, -} -function validate39( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - const _errs1 = errors - const _errs2 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if ( - (data.operationId === undefined && (missing0 = "operationId")) || - (data.operationRef === undefined && (missing0 = "operationRef")) - ) { - const err0 = {} - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } - } - var valid0 = _errs2 === errors - if (valid0) { - validate39.errors = [ - { - instancePath, - schemaPath: "#/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - }, - ] - return false - } else { - errors = _errs1 - if (vErrors !== null) { - if (_errs1) { - vErrors.length = _errs1 - } else { - vErrors = null - } - } - } - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - const _errs3 = errors - for (const key0 in data) { - if ( - !( - key0 === "operationId" || - key0 === "operationRef" || - key0 === "parameters" || - key0 === "requestBody" || - key0 === "description" || - key0 === "server" || - pattern0.test(key0) - ) - ) { - validate39.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs3 === errors) { - if (data.operationId !== undefined) { - const _errs4 = errors - if (typeof data.operationId !== "string") { - validate39.errors = [ - { - instancePath: instancePath + "/operationId", - schemaPath: "#/properties/operationId/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid1 = _errs4 === errors - } else { - var valid1 = true - } - if (valid1) { - if (data.operationRef !== undefined) { - let data1 = data.operationRef - const _errs6 = errors - if (errors === _errs6) { - if (errors === _errs6) { - if (typeof data1 === "string") { - if (!formats0.test(data1)) { - validate39.errors = [ - { - instancePath: instancePath + "/operationRef", - schemaPath: "#/properties/operationRef/format", - keyword: "format", - params: {format: "uri-reference"}, - message: 'must match format "' + "uri-reference" + '"', - }, - ] - return false - } - } else { - validate39.errors = [ - { - instancePath: instancePath + "/operationRef", - schemaPath: "#/properties/operationRef/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid1 = _errs6 === errors - } else { - var valid1 = true - } - if (valid1) { - if (data.parameters !== undefined) { - let data2 = data.parameters - const _errs8 = errors - if (errors === _errs8) { - if ( - data2 && - typeof data2 == "object" && - !Array.isArray(data2) - ) { - } else { - validate39.errors = [ - { - instancePath: instancePath + "/parameters", - schemaPath: "#/properties/parameters/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid1 = _errs8 === errors - } else { - var valid1 = true - } - if (valid1) { - if (data.description !== undefined) { - const _errs11 = errors - if (typeof data.description !== "string") { - validate39.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid1 = _errs11 === errors - } else { - var valid1 = true - } - if (valid1) { - if (data.server !== undefined) { - const _errs13 = errors - if ( - !validate13(data.server, { - instancePath: instancePath + "/server", - parentData: data, - parentDataProperty: "server", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate13.errors - : vErrors.concat(validate13.errors) - errors = vErrors.length - } - var valid1 = _errs13 === errors - } else { - var valid1 = true - } - } - } - } - } - } - } else { - validate39.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate39.errors = vErrors - return errors === 0 -} -function validate36( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if (data.description === undefined && (missing0 = "description")) { - validate36.errors = [ - { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - }, - ] - return false - } else { - const _errs1 = errors - for (const key0 in data) { - if ( - !( - key0 === "description" || - key0 === "headers" || - key0 === "content" || - key0 === "links" || - pattern0.test(key0) - ) - ) { - validate36.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.description !== undefined) { - const _errs2 = errors - if (typeof data.description !== "string") { - validate36.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.headers !== undefined) { - let data1 = data.headers - const _errs4 = errors - if (errors === _errs4) { - if ( - data1 && - typeof data1 == "object" && - !Array.isArray(data1) - ) { - for (const key1 in data1) { - let data2 = data1[key1] - const _errs7 = errors - const _errs8 = errors - let valid2 = false - let passing0 = null - const _errs9 = errors - if ( - !validate26(data2, { - instancePath: - instancePath + - "/headers/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data1, - parentDataProperty: key1, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate26.errors - : vErrors.concat(validate26.errors) - errors = vErrors.length - } - var _valid0 = _errs9 === errors - if (_valid0) { - valid2 = true - passing0 = 0 - } - const _errs10 = errors - const _errs11 = errors - if (errors === _errs11) { - if ( - data2 && - typeof data2 == "object" && - !Array.isArray(data2) - ) { - let missing1 - if (data2.$ref === undefined && (missing1 = "$ref")) { - const err0 = { - instancePath: - instancePath + - "/headers/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing1}, - message: - "must have required property '" + missing1 + "'", - } - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } else { - var valid4 = true - for (const key2 in data2) { - if (pattern18.test(key2)) { - let data3 = data2[key2] - const _errs13 = errors - if (errors === _errs13) { - if (errors === _errs13) { - if (typeof data3 === "string") { - if (!formats0.test(data3)) { - const err1 = { - instancePath: - instancePath + - "/headers/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - } - } else { - const err2 = { - instancePath: - instancePath + - "/headers/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - } - } - var valid4 = _errs13 === errors - if (!valid4) { - break - } - } - } - } - } else { - const err3 = { - instancePath: - instancePath + - "/headers/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - } - var _valid0 = _errs10 === errors - if (_valid0 && valid2) { - valid2 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid2 = true - passing0 = 1 - } - } - if (!valid2) { - const err4 = { - instancePath: - instancePath + - "/headers/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/properties/headers/additionalProperties/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - validate36.errors = vErrors - return false - } else { - errors = _errs8 - if (vErrors !== null) { - if (_errs8) { - vErrors.length = _errs8 - } else { - vErrors = null - } - } - } - var valid1 = _errs7 === errors - if (!valid1) { - break - } - } - } else { - validate36.errors = [ - { - instancePath: instancePath + "/headers", - schemaPath: "#/properties/headers/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.content !== undefined) { - let data4 = data.content - const _errs15 = errors - if (errors === _errs15) { - if ( - data4 && - typeof data4 == "object" && - !Array.isArray(data4) - ) { - for (const key3 in data4) { - const _errs18 = errors - if ( - !validate23(data4[key3], { - instancePath: - instancePath + - "/content/" + - key3.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data4, - parentDataProperty: key3, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate23.errors - : vErrors.concat(validate23.errors) - errors = vErrors.length - } - var valid5 = _errs18 === errors - if (!valid5) { - break - } - } - } else { - validate36.errors = [ - { - instancePath: instancePath + "/content", - schemaPath: "#/properties/content/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs15 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.links !== undefined) { - let data6 = data.links - const _errs19 = errors - if (errors === _errs19) { - if ( - data6 && - typeof data6 == "object" && - !Array.isArray(data6) - ) { - for (const key4 in data6) { - let data7 = data6[key4] - const _errs22 = errors - const _errs23 = errors - let valid7 = false - let passing1 = null - const _errs24 = errors - if ( - !validate39(data7, { - instancePath: - instancePath + - "/links/" + - key4.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data6, - parentDataProperty: key4, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate39.errors - : vErrors.concat(validate39.errors) - errors = vErrors.length - } - var _valid1 = _errs24 === errors - if (_valid1) { - valid7 = true - passing1 = 0 - } - const _errs25 = errors - const _errs26 = errors - if (errors === _errs26) { - if ( - data7 && - typeof data7 == "object" && - !Array.isArray(data7) - ) { - let missing2 - if ( - data7.$ref === undefined && - (missing2 = "$ref") - ) { - const err5 = { - instancePath: - instancePath + - "/links/" + - key4.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing2}, - message: - "must have required property '" + - missing2 + - "'", - } - if (vErrors === null) { - vErrors = [err5] - } else { - vErrors.push(err5) - } - errors++ - } else { - var valid9 = true - for (const key5 in data7) { - if (pattern18.test(key5)) { - let data8 = data7[key5] - const _errs28 = errors - if (errors === _errs28) { - if (errors === _errs28) { - if (typeof data8 === "string") { - if (!formats0.test(data8)) { - const err6 = { - instancePath: - instancePath + - "/links/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key5 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err6] - } else { - vErrors.push(err6) - } - errors++ - } - } else { - const err7 = { - instancePath: - instancePath + - "/links/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key5 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err7] - } else { - vErrors.push(err7) - } - errors++ - } - } - } - var valid9 = _errs28 === errors - if (!valid9) { - break - } - } - } - } - } else { - const err8 = { - instancePath: - instancePath + - "/links/" + - key4.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err8] - } else { - vErrors.push(err8) - } - errors++ - } - } - var _valid1 = _errs25 === errors - if (_valid1 && valid7) { - valid7 = false - passing1 = [passing1, 1] - } else { - if (_valid1) { - valid7 = true - passing1 = 1 - } - } - if (!valid7) { - const err9 = { - instancePath: - instancePath + - "/links/" + - key4.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/properties/links/additionalProperties/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing1}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err9] - } else { - vErrors.push(err9) - } - errors++ - validate36.errors = vErrors - return false - } else { - errors = _errs23 - if (vErrors !== null) { - if (_errs23) { - vErrors.length = _errs23 - } else { - vErrors = null - } - } - } - var valid6 = _errs22 === errors - if (!valid6) { - break - } - } - } else { - validate36.errors = [ - { - instancePath: instancePath + "/links", - schemaPath: "#/properties/links/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs19 === errors - } else { - var valid0 = true - } - } - } - } - } - } - } else { - validate36.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate36.errors = vErrors - return errors === 0 -} -function validate35( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - if (Object.keys(data).length < 1) { - validate35.errors = [ - { - instancePath, - schemaPath: "#/minProperties", - keyword: "minProperties", - params: {limit: 1}, - message: "must NOT have fewer than 1 properties", - }, - ] - return false - } else { - const _errs1 = errors - for (const key0 in data) { - if ( - !(key0 === "default" || pattern43.test(key0) || pattern0.test(key0)) - ) { - validate35.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.default !== undefined) { - let data0 = data.default - const _errs2 = errors - const _errs3 = errors - let valid1 = false - let passing0 = null - const _errs4 = errors - if ( - !validate36(data0, { - instancePath: instancePath + "/default", - parentData: data, - parentDataProperty: "default", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate36.errors - : vErrors.concat(validate36.errors) - errors = vErrors.length - } - var _valid0 = _errs4 === errors - if (_valid0) { - valid1 = true - passing0 = 0 - } - const _errs5 = errors - const _errs6 = errors - if (errors === _errs6) { - if (data0 && typeof data0 == "object" && !Array.isArray(data0)) { - let missing0 - if (data0.$ref === undefined && (missing0 = "$ref")) { - const err0 = { - instancePath: instancePath + "/default", - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - } - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } else { - var valid3 = true - for (const key1 in data0) { - if (pattern18.test(key1)) { - let data1 = data0[key1] - const _errs8 = errors - if (errors === _errs8) { - if (errors === _errs8) { - if (typeof data1 === "string") { - if (!formats0.test(data1)) { - const err1 = { - instancePath: - instancePath + - "/default/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + "uri-reference" + '"', - } - if (vErrors === null) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - } - } else { - const err2 = { - instancePath: - instancePath + - "/default/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - } - } - var valid3 = _errs8 === errors - if (!valid3) { - break - } - } - } - } - } else { - const err3 = { - instancePath: instancePath + "/default", - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - } - var _valid0 = _errs5 === errors - if (_valid0 && valid1) { - valid1 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid1 = true - passing0 = 1 - } - } - if (!valid1) { - const err4 = { - instancePath: instancePath + "/default", - schemaPath: "#/properties/default/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - validate35.errors = vErrors - return false - } else { - errors = _errs3 - if (vErrors !== null) { - if (_errs3) { - vErrors.length = _errs3 - } else { - vErrors = null - } - } - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - var valid4 = true - for (const key2 in data) { - if (pattern43.test(key2)) { - let data2 = data[key2] - const _errs10 = errors - const _errs11 = errors - let valid5 = false - let passing1 = null - const _errs12 = errors - if ( - !validate36(data2, { - instancePath: - instancePath + - "/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key2, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate36.errors - : vErrors.concat(validate36.errors) - errors = vErrors.length - } - var _valid1 = _errs12 === errors - if (_valid1) { - valid5 = true - passing1 = 0 - } - const _errs13 = errors - const _errs14 = errors - if (errors === _errs14) { - if ( - data2 && - typeof data2 == "object" && - !Array.isArray(data2) - ) { - let missing1 - if (data2.$ref === undefined && (missing1 = "$ref")) { - const err5 = { - instancePath: - instancePath + - "/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing1}, - message: - "must have required property '" + missing1 + "'", - } - if (vErrors === null) { - vErrors = [err5] - } else { - vErrors.push(err5) - } - errors++ - } else { - var valid7 = true - for (const key3 in data2) { - if (pattern18.test(key3)) { - let data3 = data2[key3] - const _errs16 = errors - if (errors === _errs16) { - if (errors === _errs16) { - if (typeof data3 === "string") { - if (!formats0.test(data3)) { - const err6 = { - instancePath: - instancePath + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err6] - } else { - vErrors.push(err6) - } - errors++ - } - } else { - const err7 = { - instancePath: - instancePath + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err7] - } else { - vErrors.push(err7) - } - errors++ - } - } - } - var valid7 = _errs16 === errors - if (!valid7) { - break - } - } - } - } - } else { - const err8 = { - instancePath: - instancePath + - "/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err8] - } else { - vErrors.push(err8) - } - errors++ - } - } - var _valid1 = _errs13 === errors - if (_valid1 && valid5) { - valid5 = false - passing1 = [passing1, 1] - } else { - if (_valid1) { - valid5 = true - passing1 = 1 - } - } - if (!valid5) { - const err9 = { - instancePath: - instancePath + - "/" + - key2.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/patternProperties/%5E%5B1-5%5D(%3F%3A%5Cd%7B2%7D%7CXX)%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing1}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err9] - } else { - vErrors.push(err9) - } - errors++ - validate35.errors = vErrors - return false - } else { - errors = _errs11 - if (vErrors !== null) { - if (_errs11) { - vErrors.length = _errs11 - } else { - vErrors = null - } - } - } - var valid4 = _errs10 === errors - if (!valid4) { - break - } - } - } - if (valid4) { - var valid4 = true - } - } - } - } - } else { - validate35.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate35.errors = vErrors - return errors === 0 -} -const schema69 = { - type: "object", - additionalProperties: {$ref: "#/definitions/PathItem"}, - patternProperties: {"^x-": {}}, -} -const wrapper8 = {validate: validate18} -function validate45( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!pattern0.test(key0)) { - const _errs2 = errors - if ( - !wrapper8.validate(data[key0], { - instancePath: - instancePath + - "/" + - key0.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key0, - rootData, - }) - ) { - vErrors = - vErrors === null - ? wrapper8.validate.errors - : vErrors.concat(wrapper8.validate.errors) - errors = vErrors.length - } - var valid0 = _errs2 === errors - if (!valid0) { - break - } - } - } - } else { - validate45.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate45.errors = vErrors - return errors === 0 -} -function validate19( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if (data.responses === undefined && (missing0 = "responses")) { - validate19.errors = [ - { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - }, - ] - return false - } else { - const _errs1 = errors - for (const key0 in data) { - if (!(func3.call(schema23.properties, key0) || pattern0.test(key0))) { - validate19.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.tags !== undefined) { - let data0 = data.tags - const _errs2 = errors - if (errors === _errs2) { - if (Array.isArray(data0)) { - var valid1 = true - const len0 = data0.length - for (let i0 = 0; i0 < len0; i0++) { - const _errs4 = errors - if (typeof data0[i0] !== "string") { - validate19.errors = [ - { - instancePath: instancePath + "/tags/" + i0, - schemaPath: "#/properties/tags/items/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid1 = _errs4 === errors - if (!valid1) { - break - } - } - } else { - validate19.errors = [ - { - instancePath: instancePath + "/tags", - schemaPath: "#/properties/tags/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.summary !== undefined) { - const _errs6 = errors - if (typeof data.summary !== "string") { - validate19.errors = [ - { - instancePath: instancePath + "/summary", - schemaPath: "#/properties/summary/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs6 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.description !== undefined) { - const _errs8 = errors - if (typeof data.description !== "string") { - validate19.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs8 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.externalDocs !== undefined) { - let data4 = data.externalDocs - const _errs10 = errors - const _errs11 = errors - if (errors === _errs11) { - if ( - data4 && - typeof data4 == "object" && - !Array.isArray(data4) - ) { - let missing1 - if (data4.url === undefined && (missing1 = "url")) { - validate19.errors = [ - { - instancePath: instancePath + "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/required", - keyword: "required", - params: {missingProperty: missing1}, - message: - "must have required property '" + missing1 + "'", - }, - ] - return false - } else { - const _errs13 = errors - for (const key1 in data4) { - if ( - !( - key1 === "description" || - key1 === "url" || - pattern0.test(key1) - ) - ) { - validate19.errors = [ - { - instancePath: instancePath + "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key1}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs13 === errors) { - if (data4.description !== undefined) { - const _errs14 = errors - if (typeof data4.description !== "string") { - validate19.errors = [ - { - instancePath: - instancePath + "/externalDocs/description", - schemaPath: - "#/definitions/ExternalDocumentation/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid3 = _errs14 === errors - } else { - var valid3 = true - } - if (valid3) { - if (data4.url !== undefined) { - let data6 = data4.url - const _errs16 = errors - if (errors === _errs16) { - if (errors === _errs16) { - if (typeof data6 === "string") { - if (!formats0.test(data6)) { - validate19.errors = [ - { - instancePath: - instancePath + "/externalDocs/url", - schemaPath: - "#/definitions/ExternalDocumentation/properties/url/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate19.errors = [ - { - instancePath: - instancePath + "/externalDocs/url", - schemaPath: - "#/definitions/ExternalDocumentation/properties/url/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid3 = _errs16 === errors - } else { - var valid3 = true - } - } - } - } - } else { - validate19.errors = [ - { - instancePath: instancePath + "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs10 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.operationId !== undefined) { - const _errs18 = errors - if (typeof data.operationId !== "string") { - validate19.errors = [ - { - instancePath: instancePath + "/operationId", - schemaPath: "#/properties/operationId/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs18 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.parameters !== undefined) { - let data8 = data.parameters - const _errs20 = errors - if (errors === _errs20) { - if (Array.isArray(data8)) { - var valid4 = true - const len1 = data8.length - for (let i1 = 0; i1 < len1; i1++) { - let data9 = data8[i1] - const _errs22 = errors - const _errs23 = errors - let valid5 = false - let passing0 = null - const _errs24 = errors - if ( - !validate20(data9, { - instancePath: - instancePath + "/parameters/" + i1, - parentData: data8, - parentDataProperty: i1, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate20.errors - : vErrors.concat(validate20.errors) - errors = vErrors.length - } - var _valid0 = _errs24 === errors - if (_valid0) { - valid5 = true - passing0 = 0 - } - const _errs25 = errors - const _errs26 = errors - if (errors === _errs26) { - if ( - data9 && - typeof data9 == "object" && - !Array.isArray(data9) - ) { - let missing2 - if ( - data9.$ref === undefined && - (missing2 = "$ref") - ) { - const err0 = { - instancePath: - instancePath + "/parameters/" + i1, - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing2}, - message: - "must have required property '" + - missing2 + - "'", - } - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } else { - var valid7 = true - for (const key2 in data9) { - if (pattern18.test(key2)) { - let data10 = data9[key2] - const _errs28 = errors - if (errors === _errs28) { - if (errors === _errs28) { - if (typeof data10 === "string") { - if (!formats0.test(data10)) { - const err1 = { - instancePath: - instancePath + - "/parameters/" + - i1 + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - } - } else { - const err2 = { - instancePath: - instancePath + - "/parameters/" + - i1 + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - } - } - var valid7 = _errs28 === errors - if (!valid7) { - break - } - } - } - } - } else { - const err3 = { - instancePath: - instancePath + "/parameters/" + i1, - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - } - var _valid0 = _errs25 === errors - if (_valid0 && valid5) { - valid5 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid5 = true - passing0 = 1 - } - } - if (!valid5) { - const err4 = { - instancePath: - instancePath + "/parameters/" + i1, - schemaPath: - "#/properties/parameters/items/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - validate19.errors = vErrors - return false - } else { - errors = _errs23 - if (vErrors !== null) { - if (_errs23) { - vErrors.length = _errs23 - } else { - vErrors = null - } - } - } - var valid4 = _errs22 === errors - if (!valid4) { - break - } - } - if (valid4) { - let i2 = data8.length - let j0 - if (i2 > 1) { - outer0: for (; i2--; ) { - for (j0 = i2; j0--; ) { - if (func0(data8[i2], data8[j0])) { - validate19.errors = [ - { - instancePath: - instancePath + "/parameters", - schemaPath: - "#/properties/parameters/uniqueItems", - keyword: "uniqueItems", - params: {i: i2, j: j0}, - message: - "must NOT have duplicate items (items ## " + - j0 + - " and " + - i2 + - " are identical)", - }, - ] - return false - break outer0 - } - } - } - } - } - } else { - validate19.errors = [ - { - instancePath: instancePath + "/parameters", - schemaPath: "#/properties/parameters/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs20 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.requestBody !== undefined) { - let data11 = data.requestBody - const _errs30 = errors - const _errs31 = errors - let valid9 = false - let passing1 = null - const _errs32 = errors - if ( - !validate32(data11, { - instancePath: instancePath + "/requestBody", - parentData: data, - parentDataProperty: "requestBody", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate32.errors - : vErrors.concat(validate32.errors) - errors = vErrors.length - } - var _valid1 = _errs32 === errors - if (_valid1) { - valid9 = true - passing1 = 0 - } - const _errs33 = errors - const _errs34 = errors - if (errors === _errs34) { - if ( - data11 && - typeof data11 == "object" && - !Array.isArray(data11) - ) { - let missing3 - if ( - data11.$ref === undefined && - (missing3 = "$ref") - ) { - const err5 = { - instancePath: instancePath + "/requestBody", - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing3}, - message: - "must have required property '" + - missing3 + - "'", - } - if (vErrors === null) { - vErrors = [err5] - } else { - vErrors.push(err5) - } - errors++ - } else { - var valid11 = true - for (const key3 in data11) { - if (pattern18.test(key3)) { - let data12 = data11[key3] - const _errs36 = errors - if (errors === _errs36) { - if (errors === _errs36) { - if (typeof data12 === "string") { - if (!formats0.test(data12)) { - const err6 = { - instancePath: - instancePath + - "/requestBody/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err6] - } else { - vErrors.push(err6) - } - errors++ - } - } else { - const err7 = { - instancePath: - instancePath + - "/requestBody/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err7] - } else { - vErrors.push(err7) - } - errors++ - } - } - } - var valid11 = _errs36 === errors - if (!valid11) { - break - } - } - } - } - } else { - const err8 = { - instancePath: instancePath + "/requestBody", - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err8] - } else { - vErrors.push(err8) - } - errors++ - } - } - var _valid1 = _errs33 === errors - if (_valid1 && valid9) { - valid9 = false - passing1 = [passing1, 1] - } else { - if (_valid1) { - valid9 = true - passing1 = 1 - } - } - if (!valid9) { - const err9 = { - instancePath: instancePath + "/requestBody", - schemaPath: "#/properties/requestBody/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing1}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err9] - } else { - vErrors.push(err9) - } - errors++ - validate19.errors = vErrors - return false - } else { - errors = _errs31 - if (vErrors !== null) { - if (_errs31) { - vErrors.length = _errs31 - } else { - vErrors = null - } - } - } - var valid0 = _errs30 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.responses !== undefined) { - const _errs38 = errors - if ( - !validate35(data.responses, { - instancePath: instancePath + "/responses", - parentData: data, - parentDataProperty: "responses", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate35.errors - : vErrors.concat(validate35.errors) - errors = vErrors.length - } - var valid0 = _errs38 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.callbacks !== undefined) { - let data14 = data.callbacks - const _errs39 = errors - if (errors === _errs39) { - if ( - data14 && - typeof data14 == "object" && - !Array.isArray(data14) - ) { - for (const key4 in data14) { - let data15 = data14[key4] - const _errs42 = errors - const _errs43 = errors - let valid13 = false - let passing2 = null - const _errs44 = errors - if ( - !validate45(data15, { - instancePath: - instancePath + - "/callbacks/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - parentData: data14, - parentDataProperty: key4, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate45.errors - : vErrors.concat(validate45.errors) - errors = vErrors.length - } - var _valid2 = _errs44 === errors - if (_valid2) { - valid13 = true - passing2 = 0 - } - const _errs45 = errors - const _errs46 = errors - if (errors === _errs46) { - if ( - data15 && - typeof data15 == "object" && - !Array.isArray(data15) - ) { - let missing4 - if ( - data15.$ref === undefined && - (missing4 = "$ref") - ) { - const err10 = { - instancePath: - instancePath + - "/callbacks/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing4}, - message: - "must have required property '" + - missing4 + - "'", - } - if (vErrors === null) { - vErrors = [err10] - } else { - vErrors.push(err10) - } - errors++ - } else { - var valid15 = true - for (const key5 in data15) { - if (pattern18.test(key5)) { - let data16 = data15[key5] - const _errs48 = errors - if (errors === _errs48) { - if (errors === _errs48) { - if ( - typeof data16 === "string" - ) { - if (!formats0.test(data16)) { - const err11 = { - instancePath: - instancePath + - "/callbacks/" + - key4 - .replace(/~/g, "~0") - .replace( - /\//g, - "~1", - ) + - "/" + - key5 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err11] - } else { - vErrors.push(err11) - } - errors++ - } - } else { - const err12 = { - instancePath: - instancePath + - "/callbacks/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key5 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err12] - } else { - vErrors.push(err12) - } - errors++ - } - } - } - var valid15 = _errs48 === errors - if (!valid15) { - break - } - } - } - } - } else { - const err13 = { - instancePath: - instancePath + - "/callbacks/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err13] - } else { - vErrors.push(err13) - } - errors++ - } - } - var _valid2 = _errs45 === errors - if (_valid2 && valid13) { - valid13 = false - passing2 = [passing2, 1] - } else { - if (_valid2) { - valid13 = true - passing2 = 1 - } - } - if (!valid13) { - const err14 = { - instancePath: - instancePath + - "/callbacks/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/properties/callbacks/additionalProperties/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing2}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err14] - } else { - vErrors.push(err14) - } - errors++ - validate19.errors = vErrors - return false - } else { - errors = _errs43 - if (vErrors !== null) { - if (_errs43) { - vErrors.length = _errs43 - } else { - vErrors = null - } - } - } - var valid12 = _errs42 === errors - if (!valid12) { - break - } - } - } else { - validate19.errors = [ - { - instancePath: instancePath + "/callbacks", - schemaPath: "#/properties/callbacks/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs39 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.deprecated !== undefined) { - const _errs50 = errors - if (typeof data.deprecated !== "boolean") { - validate19.errors = [ - { - instancePath: instancePath + "/deprecated", - schemaPath: "#/properties/deprecated/type", - keyword: "type", - params: {type: "boolean"}, - message: "must be boolean", - }, - ] - return false - } - var valid0 = _errs50 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.security !== undefined) { - let data18 = data.security - const _errs52 = errors - if (errors === _errs52) { - if (Array.isArray(data18)) { - var valid16 = true - const len2 = data18.length - for (let i3 = 0; i3 < len2; i3++) { - let data19 = data18[i3] - const _errs54 = errors - const _errs55 = errors - if (errors === _errs55) { - if ( - data19 && - typeof data19 == "object" && - !Array.isArray(data19) - ) { - for (const key6 in data19) { - let data20 = data19[key6] - const _errs58 = errors - if (errors === _errs58) { - if (Array.isArray(data20)) { - var valid19 = true - const len3 = data20.length - for ( - let i4 = 0; - i4 < len3; - i4++ - ) { - const _errs60 = errors - if ( - typeof data20[i4] !== - "string" - ) { - validate19.errors = [ - { - instancePath: - instancePath + - "/security/" + - i3 + - "/" + - key6 - .replace(/~/g, "~0") - .replace( - /\//g, - "~1", - ) + - "/" + - i4, - schemaPath: - "#/definitions/SecurityRequirement/additionalProperties/items/type", - keyword: "type", - params: { - type: "string", - }, - message: - "must be string", - }, - ] - return false - } - var valid19 = - _errs60 === errors - if (!valid19) { - break - } - } - } else { - validate19.errors = [ - { - instancePath: - instancePath + - "/security/" + - i3 + - "/" + - key6 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/SecurityRequirement/additionalProperties/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid18 = _errs58 === errors - if (!valid18) { - break - } - } - } else { - validate19.errors = [ - { - instancePath: - instancePath + - "/security/" + - i3, - schemaPath: - "#/definitions/SecurityRequirement/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid16 = _errs54 === errors - if (!valid16) { - break - } - } - } else { - validate19.errors = [ - { - instancePath: - instancePath + "/security", - schemaPath: - "#/properties/security/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs52 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.servers !== undefined) { - let data22 = data.servers - const _errs62 = errors - if (errors === _errs62) { - if (Array.isArray(data22)) { - var valid20 = true - const len4 = data22.length - for (let i5 = 0; i5 < len4; i5++) { - const _errs64 = errors - if ( - !validate13(data22[i5], { - instancePath: - instancePath + "/servers/" + i5, - parentData: data22, - parentDataProperty: i5, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate13.errors - : vErrors.concat( - validate13.errors, - ) - errors = vErrors.length - } - var valid20 = _errs64 === errors - if (!valid20) { - break - } - } - } else { - validate19.errors = [ - { - instancePath: - instancePath + "/servers", - schemaPath: - "#/properties/servers/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs62 === errors - } else { - var valid0 = true - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } else { - validate19.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate19.errors = vErrors - return errors === 0 -} -function validate18( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - const _errs1 = errors - for (const key0 in data) { - if (!(func3.call(schema22.properties, key0) || pattern0.test(key0))) { - validate18.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.$ref !== undefined) { - const _errs2 = errors - if (typeof data.$ref !== "string") { - validate18.errors = [ - { - instancePath: instancePath + "/$ref", - schemaPath: "#/properties/%24ref/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.summary !== undefined) { - const _errs4 = errors - if (typeof data.summary !== "string") { - validate18.errors = [ - { - instancePath: instancePath + "/summary", - schemaPath: "#/properties/summary/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.description !== undefined) { - const _errs6 = errors - if (typeof data.description !== "string") { - validate18.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs6 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.get !== undefined) { - const _errs8 = errors - if ( - !validate19(data.get, { - instancePath: instancePath + "/get", - parentData: data, - parentDataProperty: "get", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate19.errors - : vErrors.concat(validate19.errors) - errors = vErrors.length - } - var valid0 = _errs8 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.put !== undefined) { - const _errs9 = errors - if ( - !validate19(data.put, { - instancePath: instancePath + "/put", - parentData: data, - parentDataProperty: "put", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate19.errors - : vErrors.concat(validate19.errors) - errors = vErrors.length - } - var valid0 = _errs9 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.post !== undefined) { - const _errs10 = errors - if ( - !validate19(data.post, { - instancePath: instancePath + "/post", - parentData: data, - parentDataProperty: "post", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate19.errors - : vErrors.concat(validate19.errors) - errors = vErrors.length - } - var valid0 = _errs10 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.delete !== undefined) { - const _errs11 = errors - if ( - !validate19(data.delete, { - instancePath: instancePath + "/delete", - parentData: data, - parentDataProperty: "delete", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate19.errors - : vErrors.concat(validate19.errors) - errors = vErrors.length - } - var valid0 = _errs11 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.options !== undefined) { - const _errs12 = errors - if ( - !validate19(data.options, { - instancePath: instancePath + "/options", - parentData: data, - parentDataProperty: "options", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate19.errors - : vErrors.concat(validate19.errors) - errors = vErrors.length - } - var valid0 = _errs12 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.head !== undefined) { - const _errs13 = errors - if ( - !validate19(data.head, { - instancePath: instancePath + "/head", - parentData: data, - parentDataProperty: "head", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate19.errors - : vErrors.concat(validate19.errors) - errors = vErrors.length - } - var valid0 = _errs13 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.patch !== undefined) { - const _errs14 = errors - if ( - !validate19(data.patch, { - instancePath: instancePath + "/patch", - parentData: data, - parentDataProperty: "patch", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate19.errors - : vErrors.concat(validate19.errors) - errors = vErrors.length - } - var valid0 = _errs14 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.trace !== undefined) { - const _errs15 = errors - if ( - !validate19(data.trace, { - instancePath: instancePath + "/trace", - parentData: data, - parentDataProperty: "trace", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate19.errors - : vErrors.concat(validate19.errors) - errors = vErrors.length - } - var valid0 = _errs15 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.servers !== undefined) { - let data11 = data.servers - const _errs16 = errors - if (errors === _errs16) { - if (Array.isArray(data11)) { - var valid1 = true - const len0 = data11.length - for (let i0 = 0; i0 < len0; i0++) { - const _errs18 = errors - if ( - !validate13(data11[i0], { - instancePath: - instancePath + "/servers/" + i0, - parentData: data11, - parentDataProperty: i0, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate13.errors - : vErrors.concat(validate13.errors) - errors = vErrors.length - } - var valid1 = _errs18 === errors - if (!valid1) { - break - } - } - } else { - validate18.errors = [ - { - instancePath: instancePath + "/servers", - schemaPath: "#/properties/servers/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs16 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.parameters !== undefined) { - let data13 = data.parameters - const _errs19 = errors - if (errors === _errs19) { - if (Array.isArray(data13)) { - var valid2 = true - const len1 = data13.length - for (let i1 = 0; i1 < len1; i1++) { - let data14 = data13[i1] - const _errs21 = errors - const _errs22 = errors - let valid3 = false - let passing0 = null - const _errs23 = errors - if ( - !validate20(data14, { - instancePath: - instancePath + - "/parameters/" + - i1, - parentData: data13, - parentDataProperty: i1, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate20.errors - : vErrors.concat( - validate20.errors, - ) - errors = vErrors.length - } - var _valid0 = _errs23 === errors - if (_valid0) { - valid3 = true - passing0 = 0 - } - const _errs24 = errors - const _errs25 = errors - if (errors === _errs25) { - if ( - data14 && - typeof data14 == "object" && - !Array.isArray(data14) - ) { - let missing0 - if ( - data14.$ref === undefined && - (missing0 = "$ref") - ) { - const err0 = { - instancePath: - instancePath + - "/parameters/" + - i1, - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: { - missingProperty: missing0, - }, - message: - "must have required property '" + - missing0 + - "'", - } - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } else { - var valid5 = true - for (const key1 in data14) { - if (pattern18.test(key1)) { - let data15 = data14[key1] - const _errs27 = errors - if (errors === _errs27) { - if (errors === _errs27) { - if ( - typeof data15 === - "string" - ) { - if ( - !formats0.test(data15) - ) { - const err1 = { - instancePath: - instancePath + - "/parameters/" + - i1 + - "/" + - key1 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: - "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if ( - vErrors === null - ) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - } - } else { - const err2 = { - instancePath: - instancePath + - "/parameters/" + - i1 + - "/" + - key1 - .replace( - /~/g, - "~0", - ) - .replace( - /\//g, - "~1", - ), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: { - type: "string", - }, - message: - "must be string", - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - } - } - var valid5 = - _errs27 === errors - if (!valid5) { - break - } - } - } - } - } else { - const err3 = { - instancePath: - instancePath + - "/parameters/" + - i1, - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - } - var _valid0 = _errs24 === errors - if (_valid0 && valid3) { - valid3 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid3 = true - passing0 = 1 - } - } - if (!valid3) { - const err4 = { - instancePath: - instancePath + - "/parameters/" + - i1, - schemaPath: - "#/properties/parameters/items/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - validate18.errors = vErrors - return false - } else { - errors = _errs22 - if (vErrors !== null) { - if (_errs22) { - vErrors.length = _errs22 - } else { - vErrors = null - } - } - } - var valid2 = _errs21 === errors - if (!valid2) { - break - } - } - if (valid2) { - let i2 = data13.length - let j0 - if (i2 > 1) { - outer0: for (; i2--; ) { - for (j0 = i2; j0--; ) { - if ( - func0(data13[i2], data13[j0]) - ) { - validate18.errors = [ - { - instancePath: - instancePath + - "/parameters", - schemaPath: - "#/properties/parameters/uniqueItems", - keyword: "uniqueItems", - params: {i: i2, j: j0}, - message: - "must NOT have duplicate items (items ## " + - j0 + - " and " + - i2 + - " are identical)", - }, - ] - return false - break outer0 - } - } - } - } - } - } else { - validate18.errors = [ - { - instancePath: - instancePath + "/parameters", - schemaPath: - "#/properties/parameters/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs19 === errors - } else { - var valid0 = true - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } else { - validate18.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate18.errors = vErrors - return errors === 0 -} -function validate17( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - const _errs1 = errors - for (const key0 in data) { - if (!(pattern10.test(key0) || pattern0.test(key0))) { - validate17.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - var valid0 = true - for (const key1 in data) { - if (pattern10.test(key1)) { - const _errs2 = errors - if ( - !validate18(data[key1], { - instancePath: - instancePath + - "/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key1, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate18.errors - : vErrors.concat(validate18.errors) - errors = vErrors.length - } - var valid0 = _errs2 === errors - if (!valid0) { - break - } - } - } - if (valid0) { - var valid0 = true - } - } - } else { - validate17.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate17.errors = vErrors - return errors === 0 -} -const schema73 = { - type: "object", - properties: { - schemas: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Schema"}, - {$ref: "#/definitions/Reference"}, - ], - }, - }, - }, - responses: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Response"}, - ], - }, - }, - }, - parameters: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Parameter"}, - ], - }, - }, - }, - examples: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Example"}, - ], - }, - }, - }, - requestBodies: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/RequestBody"}, - ], - }, - }, - }, - headers: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Header"}, - ], - }, - }, - }, - securitySchemes: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/SecurityScheme"}, - ], - }, - }, - }, - links: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Link"}, - ], - }, - }, - }, - callbacks: { - type: "object", - patternProperties: { - "^[a-zA-Z0-9\\.\\-_]+$": { - oneOf: [ - {$ref: "#/definitions/Reference"}, - {$ref: "#/definitions/Callback"}, - ], - }, - }, - }, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const pattern58 = new RegExp("^[a-zA-Z0-9\\.\\-_]+$", "u") -const schema82 = { - oneOf: [ - {$ref: "#/definitions/APIKeySecurityScheme"}, - {$ref: "#/definitions/HTTPSecurityScheme"}, - {$ref: "#/definitions/OAuth2SecurityScheme"}, - {$ref: "#/definitions/OpenIdConnectSecurityScheme"}, - ], -} -const schema83 = { - type: "object", - required: ["type", "name", "in"], - properties: { - type: {type: "string", enum: ["apiKey"]}, - name: {type: "string"}, - in: {type: "string", enum: ["header", "query", "cookie"]}, - description: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema84 = { - type: "object", - required: ["scheme", "type"], - properties: { - scheme: {type: "string"}, - bearerFormat: {type: "string"}, - description: {type: "string"}, - type: {type: "string", enum: ["http"]}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, - oneOf: [ - { - description: "Bearer", - properties: { - scheme: {type: "string", pattern: "^[Bb][Ee][Aa][Rr][Ee][Rr]$"}, - }, - }, - { - description: "Non Bearer", - not: {required: ["bearerFormat"]}, - properties: { - scheme: {not: {type: "string", pattern: "^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}, - }, - }, - ], -} -const schema91 = { - type: "object", - required: ["type", "openIdConnectUrl"], - properties: { - type: {type: "string", enum: ["openIdConnect"]}, - openIdConnectUrl: {type: "string", format: "uri-reference"}, - description: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const pattern74 = new RegExp("^[Bb][Ee][Aa][Rr][Ee][Rr]$", "u") -const schema85 = { - type: "object", - required: ["type", "flows"], - properties: { - type: {type: "string", enum: ["oauth2"]}, - flows: {$ref: "#/definitions/OAuthFlows"}, - description: {type: "string"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema86 = { - type: "object", - properties: { - implicit: {$ref: "#/definitions/ImplicitOAuthFlow"}, - password: {$ref: "#/definitions/PasswordOAuthFlow"}, - clientCredentials: {$ref: "#/definitions/ClientCredentialsFlow"}, - authorizationCode: {$ref: "#/definitions/AuthorizationCodeOAuthFlow"}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema87 = { - type: "object", - required: ["authorizationUrl", "scopes"], - properties: { - authorizationUrl: {type: "string", format: "uri-reference"}, - refreshUrl: {type: "string", format: "uri-reference"}, - scopes: {type: "object", additionalProperties: {type: "string"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema88 = { - type: "object", - required: ["tokenUrl", "scopes"], - properties: { - tokenUrl: {type: "string", format: "uri-reference"}, - refreshUrl: {type: "string", format: "uri-reference"}, - scopes: {type: "object", additionalProperties: {type: "string"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema89 = { - type: "object", - required: ["tokenUrl", "scopes"], - properties: { - tokenUrl: {type: "string", format: "uri-reference"}, - refreshUrl: {type: "string", format: "uri-reference"}, - scopes: {type: "object", additionalProperties: {type: "string"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -const schema90 = { - type: "object", - required: ["authorizationUrl", "tokenUrl", "scopes"], - properties: { - authorizationUrl: {type: "string", format: "uri-reference"}, - tokenUrl: {type: "string", format: "uri-reference"}, - refreshUrl: {type: "string", format: "uri-reference"}, - scopes: {type: "object", additionalProperties: {type: "string"}}, - }, - patternProperties: {"^x-": {}}, - additionalProperties: false, -} -function validate68( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - const _errs1 = errors - for (const key0 in data) { - if ( - !( - key0 === "implicit" || - key0 === "password" || - key0 === "clientCredentials" || - key0 === "authorizationCode" || - pattern0.test(key0) - ) - ) { - validate68.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.implicit !== undefined) { - let data0 = data.implicit - const _errs2 = errors - const _errs3 = errors - if (errors === _errs3) { - if (data0 && typeof data0 == "object" && !Array.isArray(data0)) { - let missing0 - if ( - (data0.authorizationUrl === undefined && - (missing0 = "authorizationUrl")) || - (data0.scopes === undefined && (missing0 = "scopes")) - ) { - validate68.errors = [ - { - instancePath: instancePath + "/implicit", - schemaPath: "#/definitions/ImplicitOAuthFlow/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - }, - ] - return false - } else { - const _errs5 = errors - for (const key1 in data0) { - if ( - !( - key1 === "authorizationUrl" || - key1 === "refreshUrl" || - key1 === "scopes" || - pattern0.test(key1) - ) - ) { - validate68.errors = [ - { - instancePath: instancePath + "/implicit", - schemaPath: - "#/definitions/ImplicitOAuthFlow/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key1}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs5 === errors) { - if (data0.authorizationUrl !== undefined) { - let data1 = data0.authorizationUrl - const _errs6 = errors - if (errors === _errs6) { - if (errors === _errs6) { - if (typeof data1 === "string") { - if (!formats0.test(data1)) { - validate68.errors = [ - { - instancePath: - instancePath + "/implicit/authorizationUrl", - schemaPath: - "#/definitions/ImplicitOAuthFlow/properties/authorizationUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + "uri-reference" + '"', - }, - ] - return false - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + "/implicit/authorizationUrl", - schemaPath: - "#/definitions/ImplicitOAuthFlow/properties/authorizationUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid2 = _errs6 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data0.refreshUrl !== undefined) { - let data2 = data0.refreshUrl - const _errs8 = errors - if (errors === _errs8) { - if (errors === _errs8) { - if (typeof data2 === "string") { - if (!formats0.test(data2)) { - validate68.errors = [ - { - instancePath: - instancePath + "/implicit/refreshUrl", - schemaPath: - "#/definitions/ImplicitOAuthFlow/properties/refreshUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + "/implicit/refreshUrl", - schemaPath: - "#/definitions/ImplicitOAuthFlow/properties/refreshUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid2 = _errs8 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data0.scopes !== undefined) { - let data3 = data0.scopes - const _errs10 = errors - if (errors === _errs10) { - if ( - data3 && - typeof data3 == "object" && - !Array.isArray(data3) - ) { - for (const key2 in data3) { - const _errs13 = errors - if (typeof data3[key2] !== "string") { - validate68.errors = [ - { - instancePath: - instancePath + - "/implicit/scopes/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/ImplicitOAuthFlow/properties/scopes/additionalProperties/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid3 = _errs13 === errors - if (!valid3) { - break - } - } - } else { - validate68.errors = [ - { - instancePath: instancePath + "/implicit/scopes", - schemaPath: - "#/definitions/ImplicitOAuthFlow/properties/scopes/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid2 = _errs10 === errors - } else { - var valid2 = true - } - } - } - } - } - } else { - validate68.errors = [ - { - instancePath: instancePath + "/implicit", - schemaPath: "#/definitions/ImplicitOAuthFlow/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.password !== undefined) { - let data5 = data.password - const _errs15 = errors - const _errs16 = errors - if (errors === _errs16) { - if (data5 && typeof data5 == "object" && !Array.isArray(data5)) { - let missing1 - if ( - (data5.tokenUrl === undefined && (missing1 = "tokenUrl")) || - (data5.scopes === undefined && (missing1 = "scopes")) - ) { - validate68.errors = [ - { - instancePath: instancePath + "/password", - schemaPath: "#/definitions/PasswordOAuthFlow/required", - keyword: "required", - params: {missingProperty: missing1}, - message: "must have required property '" + missing1 + "'", - }, - ] - return false - } else { - const _errs18 = errors - for (const key3 in data5) { - if ( - !( - key3 === "tokenUrl" || - key3 === "refreshUrl" || - key3 === "scopes" || - pattern0.test(key3) - ) - ) { - validate68.errors = [ - { - instancePath: instancePath + "/password", - schemaPath: - "#/definitions/PasswordOAuthFlow/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key3}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs18 === errors) { - if (data5.tokenUrl !== undefined) { - let data6 = data5.tokenUrl - const _errs19 = errors - if (errors === _errs19) { - if (errors === _errs19) { - if (typeof data6 === "string") { - if (!formats0.test(data6)) { - validate68.errors = [ - { - instancePath: - instancePath + "/password/tokenUrl", - schemaPath: - "#/definitions/PasswordOAuthFlow/properties/tokenUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + "/password/tokenUrl", - schemaPath: - "#/definitions/PasswordOAuthFlow/properties/tokenUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid5 = _errs19 === errors - } else { - var valid5 = true - } - if (valid5) { - if (data5.refreshUrl !== undefined) { - let data7 = data5.refreshUrl - const _errs21 = errors - if (errors === _errs21) { - if (errors === _errs21) { - if (typeof data7 === "string") { - if (!formats0.test(data7)) { - validate68.errors = [ - { - instancePath: - instancePath + "/password/refreshUrl", - schemaPath: - "#/definitions/PasswordOAuthFlow/properties/refreshUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + "/password/refreshUrl", - schemaPath: - "#/definitions/PasswordOAuthFlow/properties/refreshUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid5 = _errs21 === errors - } else { - var valid5 = true - } - if (valid5) { - if (data5.scopes !== undefined) { - let data8 = data5.scopes - const _errs23 = errors - if (errors === _errs23) { - if ( - data8 && - typeof data8 == "object" && - !Array.isArray(data8) - ) { - for (const key4 in data8) { - const _errs26 = errors - if (typeof data8[key4] !== "string") { - validate68.errors = [ - { - instancePath: - instancePath + - "/password/scopes/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/PasswordOAuthFlow/properties/scopes/additionalProperties/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid6 = _errs26 === errors - if (!valid6) { - break - } - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + "/password/scopes", - schemaPath: - "#/definitions/PasswordOAuthFlow/properties/scopes/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid5 = _errs23 === errors - } else { - var valid5 = true - } - } - } - } - } - } else { - validate68.errors = [ - { - instancePath: instancePath + "/password", - schemaPath: "#/definitions/PasswordOAuthFlow/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs15 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.clientCredentials !== undefined) { - let data10 = data.clientCredentials - const _errs28 = errors - const _errs29 = errors - if (errors === _errs29) { - if ( - data10 && - typeof data10 == "object" && - !Array.isArray(data10) - ) { - let missing2 - if ( - (data10.tokenUrl === undefined && - (missing2 = "tokenUrl")) || - (data10.scopes === undefined && (missing2 = "scopes")) - ) { - validate68.errors = [ - { - instancePath: instancePath + "/clientCredentials", - schemaPath: - "#/definitions/ClientCredentialsFlow/required", - keyword: "required", - params: {missingProperty: missing2}, - message: - "must have required property '" + missing2 + "'", - }, - ] - return false - } else { - const _errs31 = errors - for (const key5 in data10) { - if ( - !( - key5 === "tokenUrl" || - key5 === "refreshUrl" || - key5 === "scopes" || - pattern0.test(key5) - ) - ) { - validate68.errors = [ - { - instancePath: instancePath + "/clientCredentials", - schemaPath: - "#/definitions/ClientCredentialsFlow/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key5}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs31 === errors) { - if (data10.tokenUrl !== undefined) { - let data11 = data10.tokenUrl - const _errs32 = errors - if (errors === _errs32) { - if (errors === _errs32) { - if (typeof data11 === "string") { - if (!formats0.test(data11)) { - validate68.errors = [ - { - instancePath: - instancePath + - "/clientCredentials/tokenUrl", - schemaPath: - "#/definitions/ClientCredentialsFlow/properties/tokenUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + - "/clientCredentials/tokenUrl", - schemaPath: - "#/definitions/ClientCredentialsFlow/properties/tokenUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid8 = _errs32 === errors - } else { - var valid8 = true - } - if (valid8) { - if (data10.refreshUrl !== undefined) { - let data12 = data10.refreshUrl - const _errs34 = errors - if (errors === _errs34) { - if (errors === _errs34) { - if (typeof data12 === "string") { - if (!formats0.test(data12)) { - validate68.errors = [ - { - instancePath: - instancePath + - "/clientCredentials/refreshUrl", - schemaPath: - "#/definitions/ClientCredentialsFlow/properties/refreshUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + - "/clientCredentials/refreshUrl", - schemaPath: - "#/definitions/ClientCredentialsFlow/properties/refreshUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid8 = _errs34 === errors - } else { - var valid8 = true - } - if (valid8) { - if (data10.scopes !== undefined) { - let data13 = data10.scopes - const _errs36 = errors - if (errors === _errs36) { - if ( - data13 && - typeof data13 == "object" && - !Array.isArray(data13) - ) { - for (const key6 in data13) { - const _errs39 = errors - if (typeof data13[key6] !== "string") { - validate68.errors = [ - { - instancePath: - instancePath + - "/clientCredentials/scopes/" + - key6 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/ClientCredentialsFlow/properties/scopes/additionalProperties/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid9 = _errs39 === errors - if (!valid9) { - break - } - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + - "/clientCredentials/scopes", - schemaPath: - "#/definitions/ClientCredentialsFlow/properties/scopes/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid8 = _errs36 === errors - } else { - var valid8 = true - } - } - } - } - } - } else { - validate68.errors = [ - { - instancePath: instancePath + "/clientCredentials", - schemaPath: "#/definitions/ClientCredentialsFlow/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs28 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.authorizationCode !== undefined) { - let data15 = data.authorizationCode - const _errs41 = errors - const _errs42 = errors - if (errors === _errs42) { - if ( - data15 && - typeof data15 == "object" && - !Array.isArray(data15) - ) { - let missing3 - if ( - (data15.authorizationUrl === undefined && - (missing3 = "authorizationUrl")) || - (data15.tokenUrl === undefined && - (missing3 = "tokenUrl")) || - (data15.scopes === undefined && (missing3 = "scopes")) - ) { - validate68.errors = [ - { - instancePath: instancePath + "/authorizationCode", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/required", - keyword: "required", - params: {missingProperty: missing3}, - message: - "must have required property '" + missing3 + "'", - }, - ] - return false - } else { - const _errs44 = errors - for (const key7 in data15) { - if ( - !( - key7 === "authorizationUrl" || - key7 === "tokenUrl" || - key7 === "refreshUrl" || - key7 === "scopes" || - pattern0.test(key7) - ) - ) { - validate68.errors = [ - { - instancePath: instancePath + "/authorizationCode", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key7}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs44 === errors) { - if (data15.authorizationUrl !== undefined) { - let data16 = data15.authorizationUrl - const _errs45 = errors - if (errors === _errs45) { - if (errors === _errs45) { - if (typeof data16 === "string") { - if (!formats0.test(data16)) { - validate68.errors = [ - { - instancePath: - instancePath + - "/authorizationCode/authorizationUrl", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/properties/authorizationUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + - "/authorizationCode/authorizationUrl", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/properties/authorizationUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid11 = _errs45 === errors - } else { - var valid11 = true - } - if (valid11) { - if (data15.tokenUrl !== undefined) { - let data17 = data15.tokenUrl - const _errs47 = errors - if (errors === _errs47) { - if (errors === _errs47) { - if (typeof data17 === "string") { - if (!formats0.test(data17)) { - validate68.errors = [ - { - instancePath: - instancePath + - "/authorizationCode/tokenUrl", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/properties/tokenUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + - "/authorizationCode/tokenUrl", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/properties/tokenUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid11 = _errs47 === errors - } else { - var valid11 = true - } - if (valid11) { - if (data15.refreshUrl !== undefined) { - let data18 = data15.refreshUrl - const _errs49 = errors - if (errors === _errs49) { - if (errors === _errs49) { - if (typeof data18 === "string") { - if (!formats0.test(data18)) { - validate68.errors = [ - { - instancePath: - instancePath + - "/authorizationCode/refreshUrl", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/properties/refreshUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + - "/authorizationCode/refreshUrl", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/properties/refreshUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid11 = _errs49 === errors - } else { - var valid11 = true - } - if (valid11) { - if (data15.scopes !== undefined) { - let data19 = data15.scopes - const _errs51 = errors - if (errors === _errs51) { - if ( - data19 && - typeof data19 == "object" && - !Array.isArray(data19) - ) { - for (const key8 in data19) { - const _errs54 = errors - if (typeof data19[key8] !== "string") { - validate68.errors = [ - { - instancePath: - instancePath + - "/authorizationCode/scopes/" + - key8 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/properties/scopes/additionalProperties/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid12 = _errs54 === errors - if (!valid12) { - break - } - } - } else { - validate68.errors = [ - { - instancePath: - instancePath + - "/authorizationCode/scopes", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/properties/scopes/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid11 = _errs51 === errors - } else { - var valid11 = true - } - } - } - } - } - } - } else { - validate68.errors = [ - { - instancePath: instancePath + "/authorizationCode", - schemaPath: - "#/definitions/AuthorizationCodeOAuthFlow/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs41 === errors - } else { - var valid0 = true - } - } - } - } - } - } else { - validate68.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate68.errors = vErrors - return errors === 0 -} -function validate67( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if ( - (data.type === undefined && (missing0 = "type")) || - (data.flows === undefined && (missing0 = "flows")) - ) { - validate67.errors = [ - { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - }, - ] - return false - } else { - const _errs1 = errors - for (const key0 in data) { - if ( - !( - key0 === "type" || - key0 === "flows" || - key0 === "description" || - pattern0.test(key0) - ) - ) { - validate67.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.type !== undefined) { - let data0 = data.type - const _errs2 = errors - if (typeof data0 !== "string") { - validate67.errors = [ - { - instancePath: instancePath + "/type", - schemaPath: "#/properties/type/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - if (!(data0 === "oauth2")) { - validate67.errors = [ - { - instancePath: instancePath + "/type", - schemaPath: "#/properties/type/enum", - keyword: "enum", - params: {allowedValues: schema85.properties.type.enum}, - message: "must be equal to one of the allowed values", - }, - ] - return false - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.flows !== undefined) { - const _errs4 = errors - if ( - !validate68(data.flows, { - instancePath: instancePath + "/flows", - parentData: data, - parentDataProperty: "flows", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate68.errors - : vErrors.concat(validate68.errors) - errors = vErrors.length - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.description !== undefined) { - const _errs5 = errors - if (typeof data.description !== "string") { - validate67.errors = [ - { - instancePath: instancePath + "/description", - schemaPath: "#/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid0 = _errs5 === errors - } else { - var valid0 = true - } - } - } - } - } - } else { - validate67.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate67.errors = vErrors - return errors === 0 -} -function validate66( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - const _errs0 = errors - let valid0 = false - let passing0 = null - const _errs1 = errors - const _errs2 = errors - if (errors === _errs2) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if ( - (data.type === undefined && (missing0 = "type")) || - (data.name === undefined && (missing0 = "name")) || - (data.in === undefined && (missing0 = "in")) - ) { - const err0 = { - instancePath, - schemaPath: "#/definitions/APIKeySecurityScheme/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - } - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } else { - const _errs4 = errors - for (const key0 in data) { - if ( - !( - key0 === "type" || - key0 === "name" || - key0 === "in" || - key0 === "description" || - pattern0.test(key0) - ) - ) { - const err1 = { - instancePath, - schemaPath: - "#/definitions/APIKeySecurityScheme/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - } - if (vErrors === null) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - break - } - } - if (_errs4 === errors) { - if (data.type !== undefined) { - let data0 = data.type - const _errs5 = errors - if (typeof data0 !== "string") { - const err2 = { - instancePath: instancePath + "/type", - schemaPath: - "#/definitions/APIKeySecurityScheme/properties/type/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - if (!(data0 === "apiKey")) { - const err3 = { - instancePath: instancePath + "/type", - schemaPath: - "#/definitions/APIKeySecurityScheme/properties/type/enum", - keyword: "enum", - params: {allowedValues: schema83.properties.type.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - var valid2 = _errs5 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data.name !== undefined) { - const _errs7 = errors - if (typeof data.name !== "string") { - const err4 = { - instancePath: instancePath + "/name", - schemaPath: - "#/definitions/APIKeySecurityScheme/properties/name/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - } - var valid2 = _errs7 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data.in !== undefined) { - let data2 = data.in - const _errs9 = errors - if (typeof data2 !== "string") { - const err5 = { - instancePath: instancePath + "/in", - schemaPath: - "#/definitions/APIKeySecurityScheme/properties/in/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err5] - } else { - vErrors.push(err5) - } - errors++ - } - if ( - !( - data2 === "header" || - data2 === "query" || - data2 === "cookie" - ) - ) { - const err6 = { - instancePath: instancePath + "/in", - schemaPath: - "#/definitions/APIKeySecurityScheme/properties/in/enum", - keyword: "enum", - params: {allowedValues: schema83.properties.in.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err6] - } else { - vErrors.push(err6) - } - errors++ - } - var valid2 = _errs9 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data.description !== undefined) { - const _errs11 = errors - if (typeof data.description !== "string") { - const err7 = { - instancePath: instancePath + "/description", - schemaPath: - "#/definitions/APIKeySecurityScheme/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err7] - } else { - vErrors.push(err7) - } - errors++ - } - var valid2 = _errs11 === errors - } else { - var valid2 = true - } - } - } - } - } - } - } else { - const err8 = { - instancePath, - schemaPath: "#/definitions/APIKeySecurityScheme/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err8] - } else { - vErrors.push(err8) - } - errors++ - } - } - var _valid0 = _errs1 === errors - if (_valid0) { - valid0 = true - passing0 = 0 - } - const _errs13 = errors - const _errs14 = errors - const _errs16 = errors - let valid4 = false - let passing1 = null - const _errs17 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.scheme !== undefined) { - let data4 = data.scheme - const _errs18 = errors - if (errors === _errs18) { - if (typeof data4 === "string") { - if (!pattern74.test(data4)) { - const err9 = { - instancePath: instancePath + "/scheme", - schemaPath: - "#/definitions/HTTPSecurityScheme/oneOf/0/properties/scheme/pattern", - keyword: "pattern", - params: {pattern: "^[Bb][Ee][Aa][Rr][Ee][Rr]$"}, - message: - 'must match pattern "' + "^[Bb][Ee][Aa][Rr][Ee][Rr]$" + '"', - } - if (vErrors === null) { - vErrors = [err9] - } else { - vErrors.push(err9) - } - errors++ - } - } else { - const err10 = { - instancePath: instancePath + "/scheme", - schemaPath: - "#/definitions/HTTPSecurityScheme/oneOf/0/properties/scheme/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err10] - } else { - vErrors.push(err10) - } - errors++ - } - } - } - } - var _valid1 = _errs17 === errors - if (_valid1) { - valid4 = true - passing1 = 0 - } - const _errs20 = errors - const _errs21 = errors - const _errs22 = errors - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing1 - if (data.bearerFormat === undefined && (missing1 = "bearerFormat")) { - const err11 = {} - if (vErrors === null) { - vErrors = [err11] - } else { - vErrors.push(err11) - } - errors++ - } - } - var valid6 = _errs22 === errors - if (valid6) { - const err12 = { - instancePath, - schemaPath: "#/definitions/HTTPSecurityScheme/oneOf/1/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err12] - } else { - vErrors.push(err12) - } - errors++ - } else { - errors = _errs21 - if (vErrors !== null) { - if (_errs21) { - vErrors.length = _errs21 - } else { - vErrors = null - } - } - } - if (errors === _errs20) { - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.scheme !== undefined) { - let data5 = data.scheme - const _errs24 = errors - const _errs25 = errors - if (errors === _errs25) { - if (typeof data5 === "string") { - if (!pattern74.test(data5)) { - const err13 = {} - if (vErrors === null) { - vErrors = [err13] - } else { - vErrors.push(err13) - } - errors++ - } - } else { - const err14 = {} - if (vErrors === null) { - vErrors = [err14] - } else { - vErrors.push(err14) - } - errors++ - } - } - var valid8 = _errs25 === errors - if (valid8) { - const err15 = { - instancePath: instancePath + "/scheme", - schemaPath: - "#/definitions/HTTPSecurityScheme/oneOf/1/properties/scheme/not", - keyword: "not", - params: {}, - message: "must NOT be valid", - } - if (vErrors === null) { - vErrors = [err15] - } else { - vErrors.push(err15) - } - errors++ - } else { - errors = _errs24 - if (vErrors !== null) { - if (_errs24) { - vErrors.length = _errs24 - } else { - vErrors = null - } - } - } - } - } - } - var _valid1 = _errs20 === errors - if (_valid1 && valid4) { - valid4 = false - passing1 = [passing1, 1] - } else { - if (_valid1) { - valid4 = true - passing1 = 1 - } - } - if (!valid4) { - const err16 = { - instancePath, - schemaPath: "#/definitions/HTTPSecurityScheme/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing1}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err16] - } else { - vErrors.push(err16) - } - errors++ - } else { - errors = _errs16 - if (vErrors !== null) { - if (_errs16) { - vErrors.length = _errs16 - } else { - vErrors = null - } - } - } - if (errors === _errs14) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing2 - if ( - (data.scheme === undefined && (missing2 = "scheme")) || - (data.type === undefined && (missing2 = "type")) - ) { - const err17 = { - instancePath, - schemaPath: "#/definitions/HTTPSecurityScheme/required", - keyword: "required", - params: {missingProperty: missing2}, - message: "must have required property '" + missing2 + "'", - } - if (vErrors === null) { - vErrors = [err17] - } else { - vErrors.push(err17) - } - errors++ - } else { - const _errs27 = errors - for (const key1 in data) { - if ( - !( - key1 === "scheme" || - key1 === "bearerFormat" || - key1 === "description" || - key1 === "type" || - pattern0.test(key1) - ) - ) { - const err18 = { - instancePath, - schemaPath: - "#/definitions/HTTPSecurityScheme/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key1}, - message: "must NOT have additional properties", - } - if (vErrors === null) { - vErrors = [err18] - } else { - vErrors.push(err18) - } - errors++ - break - } - } - if (_errs27 === errors) { - if (data.scheme !== undefined) { - const _errs28 = errors - if (typeof data.scheme !== "string") { - const err19 = { - instancePath: instancePath + "/scheme", - schemaPath: - "#/definitions/HTTPSecurityScheme/properties/scheme/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err19] - } else { - vErrors.push(err19) - } - errors++ - } - var valid9 = _errs28 === errors - } else { - var valid9 = true - } - if (valid9) { - if (data.bearerFormat !== undefined) { - const _errs30 = errors - if (typeof data.bearerFormat !== "string") { - const err20 = { - instancePath: instancePath + "/bearerFormat", - schemaPath: - "#/definitions/HTTPSecurityScheme/properties/bearerFormat/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err20] - } else { - vErrors.push(err20) - } - errors++ - } - var valid9 = _errs30 === errors - } else { - var valid9 = true - } - if (valid9) { - if (data.description !== undefined) { - const _errs32 = errors - if (typeof data.description !== "string") { - const err21 = { - instancePath: instancePath + "/description", - schemaPath: - "#/definitions/HTTPSecurityScheme/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err21] - } else { - vErrors.push(err21) - } - errors++ - } - var valid9 = _errs32 === errors - } else { - var valid9 = true - } - if (valid9) { - if (data.type !== undefined) { - let data9 = data.type - const _errs34 = errors - if (typeof data9 !== "string") { - const err22 = { - instancePath: instancePath + "/type", - schemaPath: - "#/definitions/HTTPSecurityScheme/properties/type/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err22] - } else { - vErrors.push(err22) - } - errors++ - } - if (!(data9 === "http")) { - const err23 = { - instancePath: instancePath + "/type", - schemaPath: - "#/definitions/HTTPSecurityScheme/properties/type/enum", - keyword: "enum", - params: {allowedValues: schema84.properties.type.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err23] - } else { - vErrors.push(err23) - } - errors++ - } - var valid9 = _errs34 === errors - } else { - var valid9 = true - } - } - } - } - } - } - } else { - const err24 = { - instancePath, - schemaPath: "#/definitions/HTTPSecurityScheme/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err24] - } else { - vErrors.push(err24) - } - errors++ - } - } - var _valid0 = _errs13 === errors - if (_valid0 && valid0) { - valid0 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid0 = true - passing0 = 1 - } - const _errs36 = errors - if ( - !validate67(data, { - instancePath, - parentData, - parentDataProperty, - rootData, - }) - ) { - vErrors = - vErrors === null ? validate67.errors : vErrors.concat(validate67.errors) - errors = vErrors.length - } - var _valid0 = _errs36 === errors - if (_valid0 && valid0) { - valid0 = false - passing0 = [passing0, 2] - } else { - if (_valid0) { - valid0 = true - passing0 = 2 - } - const _errs37 = errors - const _errs38 = errors - if (errors === _errs38) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing3 - if ( - (data.type === undefined && (missing3 = "type")) || - (data.openIdConnectUrl === undefined && - (missing3 = "openIdConnectUrl")) - ) { - const err25 = { - instancePath, - schemaPath: "#/definitions/OpenIdConnectSecurityScheme/required", - keyword: "required", - params: {missingProperty: missing3}, - message: "must have required property '" + missing3 + "'", - } - if (vErrors === null) { - vErrors = [err25] - } else { - vErrors.push(err25) - } - errors++ - } else { - const _errs40 = errors - for (const key2 in data) { - if ( - !( - key2 === "type" || - key2 === "openIdConnectUrl" || - key2 === "description" || - pattern0.test(key2) - ) - ) { - const err26 = { - instancePath, - schemaPath: - "#/definitions/OpenIdConnectSecurityScheme/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key2}, - message: "must NOT have additional properties", - } - if (vErrors === null) { - vErrors = [err26] - } else { - vErrors.push(err26) - } - errors++ - break - } - } - if (_errs40 === errors) { - if (data.type !== undefined) { - let data10 = data.type - const _errs41 = errors - if (typeof data10 !== "string") { - const err27 = { - instancePath: instancePath + "/type", - schemaPath: - "#/definitions/OpenIdConnectSecurityScheme/properties/type/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err27] - } else { - vErrors.push(err27) - } - errors++ - } - if (!(data10 === "openIdConnect")) { - const err28 = { - instancePath: instancePath + "/type", - schemaPath: - "#/definitions/OpenIdConnectSecurityScheme/properties/type/enum", - keyword: "enum", - params: {allowedValues: schema91.properties.type.enum}, - message: "must be equal to one of the allowed values", - } - if (vErrors === null) { - vErrors = [err28] - } else { - vErrors.push(err28) - } - errors++ - } - var valid11 = _errs41 === errors - } else { - var valid11 = true - } - if (valid11) { - if (data.openIdConnectUrl !== undefined) { - let data11 = data.openIdConnectUrl - const _errs43 = errors - if (errors === _errs43) { - if (errors === _errs43) { - if (typeof data11 === "string") { - if (!formats0.test(data11)) { - const err29 = { - instancePath: instancePath + "/openIdConnectUrl", - schemaPath: - "#/definitions/OpenIdConnectSecurityScheme/properties/openIdConnectUrl/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + "uri-reference" + '"', - } - if (vErrors === null) { - vErrors = [err29] - } else { - vErrors.push(err29) - } - errors++ - } - } else { - const err30 = { - instancePath: instancePath + "/openIdConnectUrl", - schemaPath: - "#/definitions/OpenIdConnectSecurityScheme/properties/openIdConnectUrl/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err30] - } else { - vErrors.push(err30) - } - errors++ - } - } - } - var valid11 = _errs43 === errors - } else { - var valid11 = true - } - if (valid11) { - if (data.description !== undefined) { - const _errs45 = errors - if (typeof data.description !== "string") { - const err31 = { - instancePath: instancePath + "/description", - schemaPath: - "#/definitions/OpenIdConnectSecurityScheme/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err31] - } else { - vErrors.push(err31) - } - errors++ - } - var valid11 = _errs45 === errors - } else { - var valid11 = true - } - } - } - } - } - } else { - const err32 = { - instancePath, - schemaPath: "#/definitions/OpenIdConnectSecurityScheme/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err32] - } else { - vErrors.push(err32) - } - errors++ - } - } - var _valid0 = _errs37 === errors - if (_valid0 && valid0) { - valid0 = false - passing0 = [passing0, 3] - } else { - if (_valid0) { - valid0 = true - passing0 = 3 - } - } - } - } - if (!valid0) { - const err33 = { - instancePath, - schemaPath: "#/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err33] - } else { - vErrors.push(err33) - } - errors++ - validate66.errors = vErrors - return false - } else { - errors = _errs0 - if (vErrors !== null) { - if (_errs0) { - vErrors.length = _errs0 - } else { - vErrors = null - } - } - } - validate66.errors = vErrors - return errors === 0 -} -function validate60( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - const _errs1 = errors - for (const key0 in data) { - if (!(func3.call(schema73.properties, key0) || pattern0.test(key0))) { - validate60.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.schemas !== undefined) { - let data0 = data.schemas - const _errs2 = errors - if (errors === _errs2) { - if (data0 && typeof data0 == "object" && !Array.isArray(data0)) { - var valid1 = true - for (const key1 in data0) { - if (pattern58.test(key1)) { - let data1 = data0[key1] - const _errs4 = errors - const _errs5 = errors - let valid2 = false - let passing0 = null - const _errs6 = errors - if ( - !validate21(data1, { - instancePath: - instancePath + - "/schemas/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data0, - parentDataProperty: key1, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate21.errors - : vErrors.concat(validate21.errors) - errors = vErrors.length - } - var _valid0 = _errs6 === errors - if (_valid0) { - valid2 = true - passing0 = 0 - } - const _errs7 = errors - const _errs8 = errors - if (errors === _errs8) { - if ( - data1 && - typeof data1 == "object" && - !Array.isArray(data1) - ) { - let missing0 - if (data1.$ref === undefined && (missing0 = "$ref")) { - const err0 = { - instancePath: - instancePath + - "/schemas/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing0}, - message: - "must have required property '" + missing0 + "'", - } - if (vErrors === null) { - vErrors = [err0] - } else { - vErrors.push(err0) - } - errors++ - } else { - var valid4 = true - for (const key2 in data1) { - if (pattern18.test(key2)) { - let data2 = data1[key2] - const _errs10 = errors - if (errors === _errs10) { - if (errors === _errs10) { - if (typeof data2 === "string") { - if (!formats0.test(data2)) { - const err1 = { - instancePath: - instancePath + - "/schemas/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err1] - } else { - vErrors.push(err1) - } - errors++ - } - } else { - const err2 = { - instancePath: - instancePath + - "/schemas/" + - key1 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err2] - } else { - vErrors.push(err2) - } - errors++ - } - } - } - var valid4 = _errs10 === errors - if (!valid4) { - break - } - } - } - } - } else { - const err3 = { - instancePath: - instancePath + - "/schemas/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err3] - } else { - vErrors.push(err3) - } - errors++ - } - } - var _valid0 = _errs7 === errors - if (_valid0 && valid2) { - valid2 = false - passing0 = [passing0, 1] - } else { - if (_valid0) { - valid2 = true - passing0 = 1 - } - } - if (!valid2) { - const err4 = { - instancePath: - instancePath + - "/schemas/" + - key1.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/properties/schemas/patternProperties/%5E%5Ba-zA-Z0-9%5C.%5C-_%5D%2B%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing0}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err4] - } else { - vErrors.push(err4) - } - errors++ - validate60.errors = vErrors - return false - } else { - errors = _errs5 - if (vErrors !== null) { - if (_errs5) { - vErrors.length = _errs5 - } else { - vErrors = null - } - } - } - var valid1 = _errs4 === errors - if (!valid1) { - break - } - } - } - } else { - validate60.errors = [ - { - instancePath: instancePath + "/schemas", - schemaPath: "#/properties/schemas/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.responses !== undefined) { - let data3 = data.responses - const _errs12 = errors - if (errors === _errs12) { - if (data3 && typeof data3 == "object" && !Array.isArray(data3)) { - var valid5 = true - for (const key3 in data3) { - if (pattern58.test(key3)) { - let data4 = data3[key3] - const _errs14 = errors - const _errs15 = errors - let valid6 = false - let passing1 = null - const _errs16 = errors - const _errs17 = errors - if (errors === _errs17) { - if ( - data4 && - typeof data4 == "object" && - !Array.isArray(data4) - ) { - let missing1 - if (data4.$ref === undefined && (missing1 = "$ref")) { - const err5 = { - instancePath: - instancePath + - "/responses/" + - key3.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing1}, - message: - "must have required property '" + missing1 + "'", - } - if (vErrors === null) { - vErrors = [err5] - } else { - vErrors.push(err5) - } - errors++ - } else { - var valid8 = true - for (const key4 in data4) { - if (pattern18.test(key4)) { - let data5 = data4[key4] - const _errs19 = errors - if (errors === _errs19) { - if (errors === _errs19) { - if (typeof data5 === "string") { - if (!formats0.test(data5)) { - const err6 = { - instancePath: - instancePath + - "/responses/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err6] - } else { - vErrors.push(err6) - } - errors++ - } - } else { - const err7 = { - instancePath: - instancePath + - "/responses/" + - key3 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key4 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err7] - } else { - vErrors.push(err7) - } - errors++ - } - } - } - var valid8 = _errs19 === errors - if (!valid8) { - break - } - } - } - } - } else { - const err8 = { - instancePath: - instancePath + - "/responses/" + - key3.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err8] - } else { - vErrors.push(err8) - } - errors++ - } - } - var _valid1 = _errs16 === errors - if (_valid1) { - valid6 = true - passing1 = 0 - } - const _errs21 = errors - if ( - !validate36(data4, { - instancePath: - instancePath + - "/responses/" + - key3.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data3, - parentDataProperty: key3, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate36.errors - : vErrors.concat(validate36.errors) - errors = vErrors.length - } - var _valid1 = _errs21 === errors - if (_valid1 && valid6) { - valid6 = false - passing1 = [passing1, 1] - } else { - if (_valid1) { - valid6 = true - passing1 = 1 - } - } - if (!valid6) { - const err9 = { - instancePath: - instancePath + - "/responses/" + - key3.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/properties/responses/patternProperties/%5E%5Ba-zA-Z0-9%5C.%5C-_%5D%2B%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing1}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err9] - } else { - vErrors.push(err9) - } - errors++ - validate60.errors = vErrors - return false - } else { - errors = _errs15 - if (vErrors !== null) { - if (_errs15) { - vErrors.length = _errs15 - } else { - vErrors = null - } - } - } - var valid5 = _errs14 === errors - if (!valid5) { - break - } - } - } - } else { - validate60.errors = [ - { - instancePath: instancePath + "/responses", - schemaPath: "#/properties/responses/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs12 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.parameters !== undefined) { - let data6 = data.parameters - const _errs22 = errors - if (errors === _errs22) { - if ( - data6 && - typeof data6 == "object" && - !Array.isArray(data6) - ) { - var valid9 = true - for (const key5 in data6) { - if (pattern58.test(key5)) { - let data7 = data6[key5] - const _errs24 = errors - const _errs25 = errors - let valid10 = false - let passing2 = null - const _errs26 = errors - const _errs27 = errors - if (errors === _errs27) { - if ( - data7 && - typeof data7 == "object" && - !Array.isArray(data7) - ) { - let missing2 - if (data7.$ref === undefined && (missing2 = "$ref")) { - const err10 = { - instancePath: - instancePath + - "/parameters/" + - key5.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing2}, - message: - "must have required property '" + - missing2 + - "'", - } - if (vErrors === null) { - vErrors = [err10] - } else { - vErrors.push(err10) - } - errors++ - } else { - var valid12 = true - for (const key6 in data7) { - if (pattern18.test(key6)) { - let data8 = data7[key6] - const _errs29 = errors - if (errors === _errs29) { - if (errors === _errs29) { - if (typeof data8 === "string") { - if (!formats0.test(data8)) { - const err11 = { - instancePath: - instancePath + - "/parameters/" + - key5 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key6 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err11] - } else { - vErrors.push(err11) - } - errors++ - } - } else { - const err12 = { - instancePath: - instancePath + - "/parameters/" + - key5 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key6 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err12] - } else { - vErrors.push(err12) - } - errors++ - } - } - } - var valid12 = _errs29 === errors - if (!valid12) { - break - } - } - } - } - } else { - const err13 = { - instancePath: - instancePath + - "/parameters/" + - key5.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err13] - } else { - vErrors.push(err13) - } - errors++ - } - } - var _valid2 = _errs26 === errors - if (_valid2) { - valid10 = true - passing2 = 0 - } - const _errs31 = errors - if ( - !validate20(data7, { - instancePath: - instancePath + - "/parameters/" + - key5.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data6, - parentDataProperty: key5, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate20.errors - : vErrors.concat(validate20.errors) - errors = vErrors.length - } - var _valid2 = _errs31 === errors - if (_valid2 && valid10) { - valid10 = false - passing2 = [passing2, 1] - } else { - if (_valid2) { - valid10 = true - passing2 = 1 - } - } - if (!valid10) { - const err14 = { - instancePath: - instancePath + - "/parameters/" + - key5.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/properties/parameters/patternProperties/%5E%5Ba-zA-Z0-9%5C.%5C-_%5D%2B%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing2}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err14] - } else { - vErrors.push(err14) - } - errors++ - validate60.errors = vErrors - return false - } else { - errors = _errs25 - if (vErrors !== null) { - if (_errs25) { - vErrors.length = _errs25 - } else { - vErrors = null - } - } - } - var valid9 = _errs24 === errors - if (!valid9) { - break - } - } - } - } else { - validate60.errors = [ - { - instancePath: instancePath + "/parameters", - schemaPath: "#/properties/parameters/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs22 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.examples !== undefined) { - let data9 = data.examples - const _errs32 = errors - if (errors === _errs32) { - if ( - data9 && - typeof data9 == "object" && - !Array.isArray(data9) - ) { - var valid13 = true - for (const key7 in data9) { - if (pattern58.test(key7)) { - let data10 = data9[key7] - const _errs34 = errors - const _errs35 = errors - let valid14 = false - let passing3 = null - const _errs36 = errors - const _errs37 = errors - if (errors === _errs37) { - if ( - data10 && - typeof data10 == "object" && - !Array.isArray(data10) - ) { - let missing3 - if ( - data10.$ref === undefined && - (missing3 = "$ref") - ) { - const err15 = { - instancePath: - instancePath + - "/examples/" + - key7.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing3}, - message: - "must have required property '" + - missing3 + - "'", - } - if (vErrors === null) { - vErrors = [err15] - } else { - vErrors.push(err15) - } - errors++ - } else { - var valid16 = true - for (const key8 in data10) { - if (pattern18.test(key8)) { - let data11 = data10[key8] - const _errs39 = errors - if (errors === _errs39) { - if (errors === _errs39) { - if (typeof data11 === "string") { - if (!formats0.test(data11)) { - const err16 = { - instancePath: - instancePath + - "/examples/" + - key7 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key8 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err16] - } else { - vErrors.push(err16) - } - errors++ - } - } else { - const err17 = { - instancePath: - instancePath + - "/examples/" + - key7 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key8 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err17] - } else { - vErrors.push(err17) - } - errors++ - } - } - } - var valid16 = _errs39 === errors - if (!valid16) { - break - } - } - } - } - } else { - const err18 = { - instancePath: - instancePath + - "/examples/" + - key7.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err18] - } else { - vErrors.push(err18) - } - errors++ - } - } - var _valid3 = _errs36 === errors - if (_valid3) { - valid14 = true - passing3 = 0 - } - const _errs41 = errors - const _errs42 = errors - if (errors === _errs42) { - if ( - data10 && - typeof data10 == "object" && - !Array.isArray(data10) - ) { - const _errs44 = errors - for (const key9 in data10) { - if ( - !( - key9 === "summary" || - key9 === "description" || - key9 === "value" || - key9 === "externalValue" || - pattern0.test(key9) - ) - ) { - const err19 = { - instancePath: - instancePath + - "/examples/" + - key7 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Example/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key9}, - message: - "must NOT have additional properties", - } - if (vErrors === null) { - vErrors = [err19] - } else { - vErrors.push(err19) - } - errors++ - break - } - } - if (_errs44 === errors) { - if (data10.summary !== undefined) { - const _errs45 = errors - if (typeof data10.summary !== "string") { - const err20 = { - instancePath: - instancePath + - "/examples/" + - key7 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/summary", - schemaPath: - "#/definitions/Example/properties/summary/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err20] - } else { - vErrors.push(err20) - } - errors++ - } - var valid18 = _errs45 === errors - } else { - var valid18 = true - } - if (valid18) { - if (data10.description !== undefined) { - const _errs47 = errors - if (typeof data10.description !== "string") { - const err21 = { - instancePath: - instancePath + - "/examples/" + - key7 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/description", - schemaPath: - "#/definitions/Example/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err21] - } else { - vErrors.push(err21) - } - errors++ - } - var valid18 = _errs47 === errors - } else { - var valid18 = true - } - if (valid18) { - if (data10.externalValue !== undefined) { - let data14 = data10.externalValue - const _errs49 = errors - if (errors === _errs49) { - if (errors === _errs49) { - if (typeof data14 === "string") { - if (!formats0.test(data14)) { - const err22 = { - instancePath: - instancePath + - "/examples/" + - key7 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/externalValue", - schemaPath: - "#/definitions/Example/properties/externalValue/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err22] - } else { - vErrors.push(err22) - } - errors++ - } - } else { - const err23 = { - instancePath: - instancePath + - "/examples/" + - key7 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/externalValue", - schemaPath: - "#/definitions/Example/properties/externalValue/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err23] - } else { - vErrors.push(err23) - } - errors++ - } - } - } - var valid18 = _errs49 === errors - } else { - var valid18 = true - } - } - } - } - } else { - const err24 = { - instancePath: - instancePath + - "/examples/" + - key7.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: "#/definitions/Example/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err24] - } else { - vErrors.push(err24) - } - errors++ - } - } - var _valid3 = _errs41 === errors - if (_valid3 && valid14) { - valid14 = false - passing3 = [passing3, 1] - } else { - if (_valid3) { - valid14 = true - passing3 = 1 - } - } - if (!valid14) { - const err25 = { - instancePath: - instancePath + - "/examples/" + - key7.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/properties/examples/patternProperties/%5E%5Ba-zA-Z0-9%5C.%5C-_%5D%2B%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing3}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err25] - } else { - vErrors.push(err25) - } - errors++ - validate60.errors = vErrors - return false - } else { - errors = _errs35 - if (vErrors !== null) { - if (_errs35) { - vErrors.length = _errs35 - } else { - vErrors = null - } - } - } - var valid13 = _errs34 === errors - if (!valid13) { - break - } - } - } - } else { - validate60.errors = [ - { - instancePath: instancePath + "/examples", - schemaPath: "#/properties/examples/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs32 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.requestBodies !== undefined) { - let data15 = data.requestBodies - const _errs51 = errors - if (errors === _errs51) { - if ( - data15 && - typeof data15 == "object" && - !Array.isArray(data15) - ) { - var valid19 = true - for (const key10 in data15) { - if (pattern58.test(key10)) { - let data16 = data15[key10] - const _errs53 = errors - const _errs54 = errors - let valid20 = false - let passing4 = null - const _errs55 = errors - const _errs56 = errors - if (errors === _errs56) { - if ( - data16 && - typeof data16 == "object" && - !Array.isArray(data16) - ) { - let missing4 - if ( - data16.$ref === undefined && - (missing4 = "$ref") - ) { - const err26 = { - instancePath: - instancePath + - "/requestBodies/" + - key10 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing4}, - message: - "must have required property '" + - missing4 + - "'", - } - if (vErrors === null) { - vErrors = [err26] - } else { - vErrors.push(err26) - } - errors++ - } else { - var valid22 = true - for (const key11 in data16) { - if (pattern18.test(key11)) { - let data17 = data16[key11] - const _errs58 = errors - if (errors === _errs58) { - if (errors === _errs58) { - if (typeof data17 === "string") { - if (!formats0.test(data17)) { - const err27 = { - instancePath: - instancePath + - "/requestBodies/" + - key10 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key11 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err27] - } else { - vErrors.push(err27) - } - errors++ - } - } else { - const err28 = { - instancePath: - instancePath + - "/requestBodies/" + - key10 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key11 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err28] - } else { - vErrors.push(err28) - } - errors++ - } - } - } - var valid22 = _errs58 === errors - if (!valid22) { - break - } - } - } - } - } else { - const err29 = { - instancePath: - instancePath + - "/requestBodies/" + - key10 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err29] - } else { - vErrors.push(err29) - } - errors++ - } - } - var _valid4 = _errs55 === errors - if (_valid4) { - valid20 = true - passing4 = 0 - } - const _errs60 = errors - if ( - !validate32(data16, { - instancePath: - instancePath + - "/requestBodies/" + - key10.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data15, - parentDataProperty: key10, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate32.errors - : vErrors.concat(validate32.errors) - errors = vErrors.length - } - var _valid4 = _errs60 === errors - if (_valid4 && valid20) { - valid20 = false - passing4 = [passing4, 1] - } else { - if (_valid4) { - valid20 = true - passing4 = 1 - } - } - if (!valid20) { - const err30 = { - instancePath: - instancePath + - "/requestBodies/" + - key10.replace(/~/g, "~0").replace(/\//g, "~1"), - schemaPath: - "#/properties/requestBodies/patternProperties/%5E%5Ba-zA-Z0-9%5C.%5C-_%5D%2B%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing4}, - message: "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err30] - } else { - vErrors.push(err30) - } - errors++ - validate60.errors = vErrors - return false - } else { - errors = _errs54 - if (vErrors !== null) { - if (_errs54) { - vErrors.length = _errs54 - } else { - vErrors = null - } - } - } - var valid19 = _errs53 === errors - if (!valid19) { - break - } - } - } - } else { - validate60.errors = [ - { - instancePath: instancePath + "/requestBodies", - schemaPath: "#/properties/requestBodies/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs51 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.headers !== undefined) { - let data18 = data.headers - const _errs61 = errors - if (errors === _errs61) { - if ( - data18 && - typeof data18 == "object" && - !Array.isArray(data18) - ) { - var valid23 = true - for (const key12 in data18) { - if (pattern58.test(key12)) { - let data19 = data18[key12] - const _errs63 = errors - const _errs64 = errors - let valid24 = false - let passing5 = null - const _errs65 = errors - const _errs66 = errors - if (errors === _errs66) { - if ( - data19 && - typeof data19 == "object" && - !Array.isArray(data19) - ) { - let missing5 - if ( - data19.$ref === undefined && - (missing5 = "$ref") - ) { - const err31 = { - instancePath: - instancePath + - "/headers/" + - key12 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing5}, - message: - "must have required property '" + - missing5 + - "'", - } - if (vErrors === null) { - vErrors = [err31] - } else { - vErrors.push(err31) - } - errors++ - } else { - var valid26 = true - for (const key13 in data19) { - if (pattern18.test(key13)) { - let data20 = data19[key13] - const _errs68 = errors - if (errors === _errs68) { - if (errors === _errs68) { - if (typeof data20 === "string") { - if (!formats0.test(data20)) { - const err32 = { - instancePath: - instancePath + - "/headers/" + - key12 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key13 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err32] - } else { - vErrors.push(err32) - } - errors++ - } - } else { - const err33 = { - instancePath: - instancePath + - "/headers/" + - key12 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key13 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err33] - } else { - vErrors.push(err33) - } - errors++ - } - } - } - var valid26 = _errs68 === errors - if (!valid26) { - break - } - } - } - } - } else { - const err34 = { - instancePath: - instancePath + - "/headers/" + - key12 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err34] - } else { - vErrors.push(err34) - } - errors++ - } - } - var _valid5 = _errs65 === errors - if (_valid5) { - valid24 = true - passing5 = 0 - } - const _errs70 = errors - if ( - !validate26(data19, { - instancePath: - instancePath + - "/headers/" + - key12 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - parentData: data18, - parentDataProperty: key12, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate26.errors - : vErrors.concat(validate26.errors) - errors = vErrors.length - } - var _valid5 = _errs70 === errors - if (_valid5 && valid24) { - valid24 = false - passing5 = [passing5, 1] - } else { - if (_valid5) { - valid24 = true - passing5 = 1 - } - } - if (!valid24) { - const err35 = { - instancePath: - instancePath + - "/headers/" + - key12 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/properties/headers/patternProperties/%5E%5Ba-zA-Z0-9%5C.%5C-_%5D%2B%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing5}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err35] - } else { - vErrors.push(err35) - } - errors++ - validate60.errors = vErrors - return false - } else { - errors = _errs64 - if (vErrors !== null) { - if (_errs64) { - vErrors.length = _errs64 - } else { - vErrors = null - } - } - } - var valid23 = _errs63 === errors - if (!valid23) { - break - } - } - } - } else { - validate60.errors = [ - { - instancePath: instancePath + "/headers", - schemaPath: "#/properties/headers/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs61 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.securitySchemes !== undefined) { - let data21 = data.securitySchemes - const _errs71 = errors - if (errors === _errs71) { - if ( - data21 && - typeof data21 == "object" && - !Array.isArray(data21) - ) { - var valid27 = true - for (const key14 in data21) { - if (pattern58.test(key14)) { - let data22 = data21[key14] - const _errs73 = errors - const _errs74 = errors - let valid28 = false - let passing6 = null - const _errs75 = errors - const _errs76 = errors - if (errors === _errs76) { - if ( - data22 && - typeof data22 == "object" && - !Array.isArray(data22) - ) { - let missing6 - if ( - data22.$ref === undefined && - (missing6 = "$ref") - ) { - const err36 = { - instancePath: - instancePath + - "/securitySchemes/" + - key14 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing6}, - message: - "must have required property '" + - missing6 + - "'", - } - if (vErrors === null) { - vErrors = [err36] - } else { - vErrors.push(err36) - } - errors++ - } else { - var valid30 = true - for (const key15 in data22) { - if (pattern18.test(key15)) { - let data23 = data22[key15] - const _errs78 = errors - if (errors === _errs78) { - if (errors === _errs78) { - if (typeof data23 === "string") { - if (!formats0.test(data23)) { - const err37 = { - instancePath: - instancePath + - "/securitySchemes/" + - key14 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key15 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err37] - } else { - vErrors.push(err37) - } - errors++ - } - } else { - const err38 = { - instancePath: - instancePath + - "/securitySchemes/" + - key14 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key15 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err38] - } else { - vErrors.push(err38) - } - errors++ - } - } - } - var valid30 = _errs78 === errors - if (!valid30) { - break - } - } - } - } - } else { - const err39 = { - instancePath: - instancePath + - "/securitySchemes/" + - key14 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err39] - } else { - vErrors.push(err39) - } - errors++ - } - } - var _valid6 = _errs75 === errors - if (_valid6) { - valid28 = true - passing6 = 0 - } - const _errs80 = errors - if ( - !validate66(data22, { - instancePath: - instancePath + - "/securitySchemes/" + - key14 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - parentData: data21, - parentDataProperty: key14, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate66.errors - : vErrors.concat(validate66.errors) - errors = vErrors.length - } - var _valid6 = _errs80 === errors - if (_valid6 && valid28) { - valid28 = false - passing6 = [passing6, 1] - } else { - if (_valid6) { - valid28 = true - passing6 = 1 - } - } - if (!valid28) { - const err40 = { - instancePath: - instancePath + - "/securitySchemes/" + - key14 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/properties/securitySchemes/patternProperties/%5E%5Ba-zA-Z0-9%5C.%5C-_%5D%2B%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing6}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err40] - } else { - vErrors.push(err40) - } - errors++ - validate60.errors = vErrors - return false - } else { - errors = _errs74 - if (vErrors !== null) { - if (_errs74) { - vErrors.length = _errs74 - } else { - vErrors = null - } - } - } - var valid27 = _errs73 === errors - if (!valid27) { - break - } - } - } - } else { - validate60.errors = [ - { - instancePath: instancePath + "/securitySchemes", - schemaPath: "#/properties/securitySchemes/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs71 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.links !== undefined) { - let data24 = data.links - const _errs81 = errors - if (errors === _errs81) { - if ( - data24 && - typeof data24 == "object" && - !Array.isArray(data24) - ) { - var valid31 = true - for (const key16 in data24) { - if (pattern58.test(key16)) { - let data25 = data24[key16] - const _errs83 = errors - const _errs84 = errors - let valid32 = false - let passing7 = null - const _errs85 = errors - const _errs86 = errors - if (errors === _errs86) { - if ( - data25 && - typeof data25 == "object" && - !Array.isArray(data25) - ) { - let missing7 - if ( - data25.$ref === undefined && - (missing7 = "$ref") - ) { - const err41 = { - instancePath: - instancePath + - "/links/" + - key16 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing7}, - message: - "must have required property '" + - missing7 + - "'", - } - if (vErrors === null) { - vErrors = [err41] - } else { - vErrors.push(err41) - } - errors++ - } else { - var valid34 = true - for (const key17 in data25) { - if (pattern18.test(key17)) { - let data26 = data25[key17] - const _errs88 = errors - if (errors === _errs88) { - if (errors === _errs88) { - if (typeof data26 === "string") { - if (!formats0.test(data26)) { - const err42 = { - instancePath: - instancePath + - "/links/" + - key16 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key17 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err42] - } else { - vErrors.push(err42) - } - errors++ - } - } else { - const err43 = { - instancePath: - instancePath + - "/links/" + - key16 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key17 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err43] - } else { - vErrors.push(err43) - } - errors++ - } - } - } - var valid34 = _errs88 === errors - if (!valid34) { - break - } - } - } - } - } else { - const err44 = { - instancePath: - instancePath + - "/links/" + - key16 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err44] - } else { - vErrors.push(err44) - } - errors++ - } - } - var _valid7 = _errs85 === errors - if (_valid7) { - valid32 = true - passing7 = 0 - } - const _errs90 = errors - if ( - !validate39(data25, { - instancePath: - instancePath + - "/links/" + - key16 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - parentData: data24, - parentDataProperty: key16, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate39.errors - : vErrors.concat(validate39.errors) - errors = vErrors.length - } - var _valid7 = _errs90 === errors - if (_valid7 && valid32) { - valid32 = false - passing7 = [passing7, 1] - } else { - if (_valid7) { - valid32 = true - passing7 = 1 - } - } - if (!valid32) { - const err45 = { - instancePath: - instancePath + - "/links/" + - key16 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/properties/links/patternProperties/%5E%5Ba-zA-Z0-9%5C.%5C-_%5D%2B%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing7}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err45] - } else { - vErrors.push(err45) - } - errors++ - validate60.errors = vErrors - return false - } else { - errors = _errs84 - if (vErrors !== null) { - if (_errs84) { - vErrors.length = _errs84 - } else { - vErrors = null - } - } - } - var valid31 = _errs83 === errors - if (!valid31) { - break - } - } - } - } else { - validate60.errors = [ - { - instancePath: instancePath + "/links", - schemaPath: "#/properties/links/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs81 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.callbacks !== undefined) { - let data27 = data.callbacks - const _errs91 = errors - if (errors === _errs91) { - if ( - data27 && - typeof data27 == "object" && - !Array.isArray(data27) - ) { - var valid35 = true - for (const key18 in data27) { - if (pattern58.test(key18)) { - let data28 = data27[key18] - const _errs93 = errors - const _errs94 = errors - let valid36 = false - let passing8 = null - const _errs95 = errors - const _errs96 = errors - if (errors === _errs96) { - if ( - data28 && - typeof data28 == "object" && - !Array.isArray(data28) - ) { - let missing8 - if ( - data28.$ref === undefined && - (missing8 = "$ref") - ) { - const err46 = { - instancePath: - instancePath + - "/callbacks/" + - key18 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/required", - keyword: "required", - params: {missingProperty: missing8}, - message: - "must have required property '" + - missing8 + - "'", - } - if (vErrors === null) { - vErrors = [err46] - } else { - vErrors.push(err46) - } - errors++ - } else { - var valid38 = true - for (const key19 in data28) { - if (pattern18.test(key19)) { - let data29 = data28[key19] - const _errs98 = errors - if (errors === _errs98) { - if (errors === _errs98) { - if ( - typeof data29 === "string" - ) { - if (!formats0.test(data29)) { - const err47 = { - instancePath: - instancePath + - "/callbacks/" + - key18 - .replace(/~/g, "~0") - .replace( - /\//g, - "~1", - ) + - "/" + - key19 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/format", - keyword: "format", - params: { - format: "uri-reference", - }, - message: - 'must match format "' + - "uri-reference" + - '"', - } - if (vErrors === null) { - vErrors = [err47] - } else { - vErrors.push(err47) - } - errors++ - } - } else { - const err48 = { - instancePath: - instancePath + - "/callbacks/" + - key18 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - key19 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/patternProperties/%5E%5C%24ref%24/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - } - if (vErrors === null) { - vErrors = [err48] - } else { - vErrors.push(err48) - } - errors++ - } - } - } - var valid38 = _errs98 === errors - if (!valid38) { - break - } - } - } - } - } else { - const err49 = { - instancePath: - instancePath + - "/callbacks/" + - key18 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/Reference/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - } - if (vErrors === null) { - vErrors = [err49] - } else { - vErrors.push(err49) - } - errors++ - } - } - var _valid8 = _errs95 === errors - if (_valid8) { - valid36 = true - passing8 = 0 - } - const _errs100 = errors - if ( - !validate45(data28, { - instancePath: - instancePath + - "/callbacks/" + - key18 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - parentData: data27, - parentDataProperty: key18, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate45.errors - : vErrors.concat(validate45.errors) - errors = vErrors.length - } - var _valid8 = _errs100 === errors - if (_valid8 && valid36) { - valid36 = false - passing8 = [passing8, 1] - } else { - if (_valid8) { - valid36 = true - passing8 = 1 - } - } - if (!valid36) { - const err50 = { - instancePath: - instancePath + - "/callbacks/" + - key18 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/properties/callbacks/patternProperties/%5E%5Ba-zA-Z0-9%5C.%5C-_%5D%2B%24/oneOf", - keyword: "oneOf", - params: {passingSchemas: passing8}, - message: - "must match exactly one schema in oneOf", - } - if (vErrors === null) { - vErrors = [err50] - } else { - vErrors.push(err50) - } - errors++ - validate60.errors = vErrors - return false - } else { - errors = _errs94 - if (vErrors !== null) { - if (_errs94) { - vErrors.length = _errs94 - } else { - vErrors = null - } - } - } - var valid35 = _errs93 === errors - if (!valid35) { - break - } - } - } - } else { - validate60.errors = [ - { - instancePath: instancePath + "/callbacks", - schemaPath: "#/properties/callbacks/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs91 === errors - } else { - var valid0 = true - } - } - } - } - } - } - } - } - } - } - } else { - validate60.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate60.errors = vErrors - return errors === 0 -} -function validate10( - data, - {instancePath = "", parentData, parentDataProperty, rootData = data} = {}, -) { - /*# sourceURL="https://spec.openapis.org/oas/3.0/schema/2024-10-18" */ - let vErrors = null - let errors = 0 - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0 - if ( - (data.openapi === undefined && (missing0 = "openapi")) || - (data.info === undefined && (missing0 = "info")) || - (data.paths === undefined && (missing0 = "paths")) - ) { - validate10.errors = [ - { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: {missingProperty: missing0}, - message: "must have required property '" + missing0 + "'", - }, - ] - return false - } else { - const _errs1 = errors - for (const key0 in data) { - if ( - !( - key0 === "openapi" || - key0 === "info" || - key0 === "externalDocs" || - key0 === "servers" || - key0 === "security" || - key0 === "tags" || - key0 === "paths" || - key0 === "components" || - pattern0.test(key0) - ) - ) { - validate10.errors = [ - { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key0}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs1 === errors) { - if (data.openapi !== undefined) { - let data0 = data.openapi - const _errs2 = errors - if (errors === _errs2) { - if (typeof data0 === "string") { - if (!pattern1.test(data0)) { - validate10.errors = [ - { - instancePath: instancePath + "/openapi", - schemaPath: "#/properties/openapi/pattern", - keyword: "pattern", - params: {pattern: "^3\\.0\\.\\d(-.+)?$"}, - message: - 'must match pattern "' + "^3\\.0\\.\\d(-.+)?$" + '"', - }, - ] - return false - } - } else { - validate10.errors = [ - { - instancePath: instancePath + "/openapi", - schemaPath: "#/properties/openapi/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - var valid0 = _errs2 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.info !== undefined) { - const _errs4 = errors - if ( - !validate11(data.info, { - instancePath: instancePath + "/info", - parentData: data, - parentDataProperty: "info", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate11.errors - : vErrors.concat(validate11.errors) - errors = vErrors.length - } - var valid0 = _errs4 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.externalDocs !== undefined) { - let data2 = data.externalDocs - const _errs5 = errors - const _errs6 = errors - if (errors === _errs6) { - if ( - data2 && - typeof data2 == "object" && - !Array.isArray(data2) - ) { - let missing1 - if (data2.url === undefined && (missing1 = "url")) { - validate10.errors = [ - { - instancePath: instancePath + "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/required", - keyword: "required", - params: {missingProperty: missing1}, - message: - "must have required property '" + missing1 + "'", - }, - ] - return false - } else { - const _errs8 = errors - for (const key1 in data2) { - if ( - !( - key1 === "description" || - key1 === "url" || - pattern0.test(key1) - ) - ) { - validate10.errors = [ - { - instancePath: instancePath + "/externalDocs", - schemaPath: - "#/definitions/ExternalDocumentation/additionalProperties", - keyword: "additionalProperties", - params: {additionalProperty: key1}, - message: "must NOT have additional properties", - }, - ] - return false - break - } - } - if (_errs8 === errors) { - if (data2.description !== undefined) { - const _errs9 = errors - if (typeof data2.description !== "string") { - validate10.errors = [ - { - instancePath: - instancePath + "/externalDocs/description", - schemaPath: - "#/definitions/ExternalDocumentation/properties/description/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid2 = _errs9 === errors - } else { - var valid2 = true - } - if (valid2) { - if (data2.url !== undefined) { - let data4 = data2.url - const _errs11 = errors - if (errors === _errs11) { - if (errors === _errs11) { - if (typeof data4 === "string") { - if (!formats0.test(data4)) { - validate10.errors = [ - { - instancePath: - instancePath + "/externalDocs/url", - schemaPath: - "#/definitions/ExternalDocumentation/properties/url/format", - keyword: "format", - params: {format: "uri-reference"}, - message: - 'must match format "' + - "uri-reference" + - '"', - }, - ] - return false - } - } else { - validate10.errors = [ - { - instancePath: - instancePath + "/externalDocs/url", - schemaPath: - "#/definitions/ExternalDocumentation/properties/url/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - } - } - var valid2 = _errs11 === errors - } else { - var valid2 = true - } - } - } - } - } else { - validate10.errors = [ - { - instancePath: instancePath + "/externalDocs", - schemaPath: "#/definitions/ExternalDocumentation/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid0 = _errs5 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.servers !== undefined) { - let data5 = data.servers - const _errs13 = errors - if (errors === _errs13) { - if (Array.isArray(data5)) { - var valid3 = true - const len0 = data5.length - for (let i0 = 0; i0 < len0; i0++) { - const _errs15 = errors - if ( - !validate13(data5[i0], { - instancePath: instancePath + "/servers/" + i0, - parentData: data5, - parentDataProperty: i0, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate13.errors - : vErrors.concat(validate13.errors) - errors = vErrors.length - } - var valid3 = _errs15 === errors - if (!valid3) { - break - } - } - } else { - validate10.errors = [ - { - instancePath: instancePath + "/servers", - schemaPath: "#/properties/servers/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs13 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.security !== undefined) { - let data7 = data.security - const _errs16 = errors - if (errors === _errs16) { - if (Array.isArray(data7)) { - var valid4 = true - const len1 = data7.length - for (let i1 = 0; i1 < len1; i1++) { - let data8 = data7[i1] - const _errs18 = errors - const _errs19 = errors - if (errors === _errs19) { - if ( - data8 && - typeof data8 == "object" && - !Array.isArray(data8) - ) { - for (const key2 in data8) { - let data9 = data8[key2] - const _errs22 = errors - if (errors === _errs22) { - if (Array.isArray(data9)) { - var valid7 = true - const len2 = data9.length - for (let i2 = 0; i2 < len2; i2++) { - const _errs24 = errors - if (typeof data9[i2] !== "string") { - validate10.errors = [ - { - instancePath: - instancePath + - "/security/" + - i1 + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1") + - "/" + - i2, - schemaPath: - "#/definitions/SecurityRequirement/additionalProperties/items/type", - keyword: "type", - params: {type: "string"}, - message: "must be string", - }, - ] - return false - } - var valid7 = _errs24 === errors - if (!valid7) { - break - } - } - } else { - validate10.errors = [ - { - instancePath: - instancePath + - "/security/" + - i1 + - "/" + - key2 - .replace(/~/g, "~0") - .replace(/\//g, "~1"), - schemaPath: - "#/definitions/SecurityRequirement/additionalProperties/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid6 = _errs22 === errors - if (!valid6) { - break - } - } - } else { - validate10.errors = [ - { - instancePath: - instancePath + "/security/" + i1, - schemaPath: - "#/definitions/SecurityRequirement/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - var valid4 = _errs18 === errors - if (!valid4) { - break - } - } - } else { - validate10.errors = [ - { - instancePath: instancePath + "/security", - schemaPath: "#/properties/security/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs16 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.tags !== undefined) { - let data11 = data.tags - const _errs26 = errors - if (errors === _errs26) { - if (Array.isArray(data11)) { - var valid8 = true - const len3 = data11.length - for (let i3 = 0; i3 < len3; i3++) { - const _errs28 = errors - if ( - !validate15(data11[i3], { - instancePath: instancePath + "/tags/" + i3, - parentData: data11, - parentDataProperty: i3, - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate15.errors - : vErrors.concat(validate15.errors) - errors = vErrors.length - } - var valid8 = _errs28 === errors - if (!valid8) { - break - } - } - if (valid8) { - let i4 = data11.length - let j0 - if (i4 > 1) { - outer0: for (; i4--; ) { - for (j0 = i4; j0--; ) { - if (func0(data11[i4], data11[j0])) { - validate10.errors = [ - { - instancePath: instancePath + "/tags", - schemaPath: - "#/properties/tags/uniqueItems", - keyword: "uniqueItems", - params: {i: i4, j: j0}, - message: - "must NOT have duplicate items (items ## " + - j0 + - " and " + - i4 + - " are identical)", - }, - ] - return false - break outer0 - } - } - } - } - } - } else { - validate10.errors = [ - { - instancePath: instancePath + "/tags", - schemaPath: "#/properties/tags/type", - keyword: "type", - params: {type: "array"}, - message: "must be array", - }, - ] - return false - } - } - var valid0 = _errs26 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.paths !== undefined) { - const _errs29 = errors - if ( - !validate17(data.paths, { - instancePath: instancePath + "/paths", - parentData: data, - parentDataProperty: "paths", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate17.errors - : vErrors.concat(validate17.errors) - errors = vErrors.length - } - var valid0 = _errs29 === errors - } else { - var valid0 = true - } - if (valid0) { - if (data.components !== undefined) { - const _errs30 = errors - if ( - !validate60(data.components, { - instancePath: instancePath + "/components", - parentData: data, - parentDataProperty: "components", - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate60.errors - : vErrors.concat(validate60.errors) - errors = vErrors.length - } - var valid0 = _errs30 === errors - } else { - var valid0 = true - } - } - } - } - } - } - } - } - } - } - } else { - validate10.errors = [ - { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: {type: "object"}, - message: "must be object", - }, - ] - return false - } - } - validate10.errors = vErrors - return errors === 0 -} -/* c8 ignore end */ diff --git a/packages/openapi-code-generator/src/core/schemas/openapi-3.1-specification-validator.ts b/packages/openapi-code-generator/src/core/schemas/openapi-3.1-specification-validator.ts deleted file mode 100644 index d8612c3a1..000000000 --- a/packages/openapi-code-generator/src/core/schemas/openapi-3.1-specification-validator.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** AUTOGENERATED - DO NOT EDIT **/ -// @ts-nocheck -/* istanbul ignore file */ -/* c8 ignore start */ - -import {logger} from "../logger.ts" - -export default function validate() { - logger.warn( - "Skipping validation due to https://github.com/mnahkies/openapi-code-generator/issues/103", - ) - return true -} - -/* c8 ignore end */ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4fc8b2d3c..d3a19d321 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,6 +60,9 @@ catalogs: '@commander-js/extra-typings': specifier: ^15.0.0 version: 15.0.0 + '@hyperjump/json-schema': + specifier: ^1.17.6 + version: 1.17.6 '@koa/router': specifier: ^15.6.0 version: 15.6.0 @@ -179,15 +182,6 @@ importers: '@vitest/coverage-v8': specifier: 'catalog:' version: 4.1.9(vitest@4.1.9) - ajv: - specifier: ^8.20.0 - version: 8.20.0 - ajv-draft-04: - specifier: ^1.0.0 - version: 1.0.0(ajv@8.20.0) - ajv-formats: - specifier: ^3.0.1 - version: 3.0.1(ajv@8.20.0) commander: specifier: 'catalog:' version: 15.0.0 @@ -489,15 +483,12 @@ importers: '@commander-js/extra-typings': specifier: 'catalog:' version: 15.0.0(commander@15.0.0) - ajv: - specifier: ^8.20.0 - version: 8.20.0 - ajv-draft-04: - specifier: ^1.0.0 - version: 1.0.0(ajv@8.20.0) - ajv-formats: - specifier: ^3.0.1 - version: 3.0.1(ajv@8.20.0) + '@hyperjump/json-schema': + specifier: 'catalog:' + version: 1.17.6(@hyperjump/browser@1.4.0) + '@hyperjump/json-schema-errors': + specifier: github:hyperjump-io/json-schema-errors#429b18eb914fa1e01b23f38519e4da240e4113d8 + version: https://codeload.github.com/hyperjump-io/json-schema-errors/tar.gz/429b18eb914fa1e01b23f38519e4da240e4113d8(@hyperjump/browser@1.4.0) commander: specifier: 'catalog:' version: 15.0.0 @@ -1600,6 +1591,10 @@ packages: '@floating-ui/utils@0.2.11': resolution: {integrity: sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==} + '@fluent/bundle@0.19.1': + resolution: {integrity: sha512-SWJLZrPamDPsJlFFOW1nkgN0j0rbPbmSdmK0XAoXlyqKieLtMVl4vzng3aR5pwKoUx0scug8+YY2oct3fdfy9A==} + engines: {node: '>=18.0.0', npm: '>=7.0.0'} + '@formatjs/intl-localematcher@0.6.2': resolution: {integrity: sha512-XOMO2Hupl0wdd172Y06h6kLpBz6Dv+J4okPLl4LPtzbr8f66WbIoy4ev98EBuZ6ZK4h5ydTN6XneT4QVpD7cdA==} @@ -1651,6 +1646,31 @@ packages: peerDependencies: react-hook-form: ^7.55.0 + '@hyperjump/browser@1.4.0': + resolution: {integrity: sha512-AbtynPyALR2wkN3ngYIiMEc21cZhP170zb5y3YIje4kTZ0J515GDgxeCK8D+PjyMhER7idU2Q3d0Zk0z/W1QLQ==} + engines: {node: '>=18.0.0'} + + '@hyperjump/json-pointer@1.1.2': + resolution: {integrity: sha512-zPNgu1zdhtjQHFNLGzvEsLDsLOEvhRj6u6ktIQmlz7YPESv5uF8SnAe3Dq0oL6gZ6OGWSLq2n7pphRNF6Hpg6w==} + + '@hyperjump/json-schema-errors@https://codeload.github.com/hyperjump-io/json-schema-errors/tar.gz/429b18eb914fa1e01b23f38519e4da240e4113d8': + resolution: {gitHosted: true, integrity: sha512-U1aw7XzAPjeGDJzFBa/3PxP5bwn7INj4usufrZNiNRaYr2EtKmGBEz57FrhRL0ugHdImCLLR23SRsGVnmwmyjw==, tarball: https://codeload.github.com/hyperjump-io/json-schema-errors/tar.gz/429b18eb914fa1e01b23f38519e4da240e4113d8} + version: 0.1.0 + + '@hyperjump/json-schema-formats@1.0.2': + resolution: {integrity: sha512-LwV7YMBst77SCvZJS/Fq5od/2dWvefU+a7RF9/MOo9mVXEcA7PJ0Ax6zgoL2x69f6PmEfFXTp3l1vGdtyziW6w==} + + '@hyperjump/json-schema@1.17.6': + resolution: {integrity: sha512-m0QggWCn58IACqLi3fqI9cuUrFju79DVAxjkDENo+xgE26963rudPMwKwwlkZkB+JqAgu+OGvJAMfE1toevfGw==} + peerDependencies: + '@hyperjump/browser': ^1.1.0 + + '@hyperjump/pact@1.4.0': + resolution: {integrity: sha512-01Q7VY6BcAkp9W31Fv+ciiZycxZHGlR2N6ba9BifgyclHYHdbaZgITo0U6QMhYRlem4k8pf8J31/tApxvqAz8A==} + + '@hyperjump/uri@1.3.4': + resolution: {integrity: sha512-aUVWwu2GtC/cU4DwdTM+b+5jjboM6wft6vNg1+7pUTk/nNRNaBYcYhaEnCir9eRLBbkcGPkiEO7XRUlcDkxj4Q==} + '@iconify/types@2.0.0': resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} @@ -5063,6 +5083,9 @@ packages: resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} engines: {node: '>=0.10.0'} + idn-hostname@15.1.10: + resolution: {integrity: sha512-/mSXWRhVasTJ7Z4z18523rTA6CmStYN29yDt+oXi9fe1/M0SO2Un1BgUr3v28aAZG5hWicyUtIamC/juXt3nZQ==} + ignore-walk@8.0.0: resolution: {integrity: sha512-FCeMZT4NiRQGh+YkeKMtWrOmBgWjHjMJ26WQWrRQyoyzqevdaGSakUaJW5xQYmjLlUVk2qUnCjYVBax9EKKg8A==} engines: {node: ^20.17.0 || >=22.9.0} @@ -5278,6 +5301,10 @@ packages: json-schema-typed@8.0.2: resolution: {integrity: sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==} + json-stringify-deterministic@1.0.14: + resolution: {integrity: sha512-aP0bu09AgPQ0siVLg+64SVR9jXRCxwM+fW8pheDCoMKc3fipsVojQtsKyuUdoy1319v/Bgm978q2Il6brzPTFg==} + engines: {node: '>= 4'} + json-stringify-nice@1.1.4: resolution: {integrity: sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw==} @@ -5303,6 +5330,9 @@ packages: resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} engines: {node: '>=0.10.0'} + just-curry-it@5.3.0: + resolution: {integrity: sha512-silMIRiFjUWlfaDhkgSzpuAyQ6EX/o09Eu8ZBfmFwQMbax7+LQzeIU2CBrICT6Ne4l86ITCGvUCBpCubWYy0Yw==} + just-diff-apply@5.5.0: resolution: {integrity: sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw==} @@ -7885,6 +7915,8 @@ snapshots: '@floating-ui/utils@0.2.11': {} + '@fluent/bundle@0.19.1': {} + '@formatjs/intl-localematcher@0.6.2': dependencies: tslib: 2.8.1 @@ -7931,6 +7963,47 @@ snapshots: '@standard-schema/utils': 0.3.0 react-hook-form: 7.80.0(react@19.2.7) + '@hyperjump/browser@1.4.0': + dependencies: + '@hyperjump/json-pointer': 1.1.2 + '@hyperjump/uri': 1.3.4 + content-type: 1.0.5 + just-curry-it: 5.3.0 + + '@hyperjump/json-pointer@1.1.2': {} + + '@hyperjump/json-schema-errors@https://codeload.github.com/hyperjump-io/json-schema-errors/tar.gz/429b18eb914fa1e01b23f38519e4da240e4113d8(@hyperjump/browser@1.4.0)': + dependencies: + '@fluent/bundle': 0.19.1 + '@hyperjump/json-pointer': 1.1.2 + '@hyperjump/json-schema': 1.17.6(@hyperjump/browser@1.4.0) + '@hyperjump/pact': 1.4.0 + '@hyperjump/uri': 1.3.4 + json-stringify-deterministic: 1.0.14 + transitivePeerDependencies: + - '@hyperjump/browser' + + '@hyperjump/json-schema-formats@1.0.2': + dependencies: + '@hyperjump/uri': 1.3.4 + idn-hostname: 15.1.10 + + '@hyperjump/json-schema@1.17.6(@hyperjump/browser@1.4.0)': + dependencies: + '@hyperjump/browser': 1.4.0 + '@hyperjump/json-pointer': 1.1.2 + '@hyperjump/json-schema-formats': 1.0.2 + '@hyperjump/pact': 1.4.0 + '@hyperjump/uri': 1.3.4 + content-type: 1.0.5 + json-stringify-deterministic: 1.0.14 + just-curry-it: 5.3.0 + uuid: 14.0.1 + + '@hyperjump/pact@1.4.0': {} + + '@hyperjump/uri@1.3.4': {} + '@iconify/types@2.0.0': {} '@iconify/utils@3.1.3': @@ -11286,6 +11359,10 @@ snapshots: dependencies: safer-buffer: 2.1.2 + idn-hostname@15.1.10: + dependencies: + punycode: 2.3.1 + ignore-walk@8.0.0: dependencies: minimatch: 10.2.5 @@ -11491,6 +11568,8 @@ snapshots: json-schema-typed@8.0.2: {} + json-stringify-deterministic@1.0.14: {} + json-stringify-nice@1.1.4: {} json-with-bigint@3.5.8: {} @@ -11509,6 +11588,8 @@ snapshots: jsonpointer@5.0.1: {} + just-curry-it@5.3.0: {} + just-diff-apply@5.5.0: {} just-diff@6.0.2: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 32c4adbe6..8771d7573 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -17,6 +17,7 @@ catalog: '@biomejs/js-api': 6.0.0 '@biomejs/wasm-nodejs': 2.5.2 '@commander-js/extra-typings': ^15.0.0 + '@hyperjump/json-schema': ^1.17.6 '@koa/router': ^15.6.0 '@lerna-lite/cli': ^5.4.0 '@lerna-lite/publish': ^5.4.0 diff --git a/scripts/ci-pipeline.sh b/scripts/ci-pipeline.sh index 925729241..a63fc0a13 100755 --- a/scripts/ci-pipeline.sh +++ b/scripts/ci-pipeline.sh @@ -16,8 +16,6 @@ pnpm run build pnpm run build:docs pnpm run ci-test -pnpm run lint - for SCHEMA_BUILDER in "${SCHEMA_BUILDERS[@]}"; do pnpm run integration:clean pnpm run integration:generate --schema-builder "$SCHEMA_BUILDER" @@ -31,3 +29,5 @@ fi SCHEMA_BUILDER=zod-v4 pnpm run e2e:generate pnpm run e2e:validate + +pnpm run lint diff --git a/scripts/generate-ajv-validator.js b/scripts/generate-ajv-validator.js deleted file mode 100755 index 1f6e0905f..000000000 --- a/scripts/generate-ajv-validator.js +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/env node - -const fs = require("node:fs/promises") -const path = require("node:path") - -const AjvDraft04 = require("ajv-draft-04") -const Ajv2020 = require("ajv/dist/2020") -const standaloneCode = require("ajv/dist/standalone").default -const addFormats = require("ajv-formats") -const {Biome, Distribution} = require("@biomejs/js-api") -const json5 = require("json5") - -const openapi30Path = path.join( - __dirname, - "../schemas/openapi-3.0-specification.json", -) -const openapi31Path = path.join( - __dirname, - "../schemas/openapi-3.1-specification.json", -) - -const outputDir = path.join( - __dirname, - "../packages/openapi-code-generator/src/core/schemas", -) - -const loadYamlFile = async (filepath) => { - const content = await fs.readFile(filepath, "utf-8") - return JSON.parse(content) -} - -const writeOutput = async (filepath, moduleCode) => { - const raw = ` - /** AUTOGENERATED - DO NOT EDIT **/ - // @ts-nocheck - /* istanbul ignore file */ - /* c8 ignore start */ - ${moduleCode} - /* c8 ignore end */ - ` - - const biome = await Biome.create({ - distribution: Distribution.NODE, - }) - - const {projectKey} = biome.openProject( - path.resolve(path.join(__dirname, "..")), - ) - - const biomeConfig = json5.parse( - await fs.readFile(path.join(__dirname, "../biome.jsonc"), "utf-8"), - ) - biome.applyConfiguration(projectKey, biomeConfig) - - const formatted = biome.formatContent(projectKey, raw, { - filePath: filepath, - }) - - await fs.writeFile(filepath, formatted.content, "utf-8") -} - -const loadSchema = async (uri) => { - const res = await fetch(uri) - return res.json() -} - -const compileOpenapi30Standalone = async () => { - const spec = await loadYamlFile(openapi30Path) - const ajv4 = new AjvDraft04({ - code: {source: true, esm: true}, - strict: false, - loadSchema, - }) - addFormats(ajv4) - - const validate = ajv4.compile(spec) - return standaloneCode(ajv4, validate) -} - -const compileOpenapi31Standalone = async (strict) => { - try { - const spec = await loadYamlFile(openapi31Path) - - const ajv2020 = new Ajv2020({ - code: {source: true, esm: true}, - strict: false, - verbose: true, - loadSchema, - }) - addFormats(ajv2020) - ajv2020.addFormat("media-range", true) - - const validate = ajv2020.compile(spec) - - // TODO: it spits out a validator, but it doesn't actually work due to $dynamicAnchor not being supported - if ( - !validate({ - openapi: "3.1.0", - info: { - title: "Valid Specification", - version: "1.0.0", - }, - paths: { - "/something": { - get: { - responses: {default: {description: "whatever"}}, - }, - }, - }, - components: { - schemas: { - Something: { - type: ["object", "null"], - properties: { - name: {type: "string"}, - }, - }, - }, - }, - }) - ) { - const messages = - validate.errors?.map((err) => { - return [`-> ${err.message} at path '${err.instancePath}'`, err.params] - }) ?? [] - - if (strict) { - throw new Error( - `Validation failed: ${messages - .map((it) => `${it[0]} (${JSON.stringify(it[1])})`) - .join("\n")}`, - ) - } - } - - return standaloneCode(ajv2020, validate) - } catch (err) { - // TODO: MissingRefError: can't resolve reference https://spec.openapis.org/oas/3.1/schema/2022-10-07 from id https://spec.openapis.org/oas/3.1/schema-base/2022-10-07 - console.warn(err.message) - console.warn( - "WARNING: failed to compile openapi 3.1 validator - using noop shim", - ) - - return ` -import {logger} from '../logger.ts' - -export default function validate(){ - logger.warn( - "Skipping validation due to https://github.com/mnahkies/openapi-code-generator/issues/103", - ) - return true -} -` - } -} - -compileOpenapi30Standalone().then((output) => - writeOutput( - path.join(outputDir, "openapi-3.0-specification-validator.ts"), - output, - ), -) - -compileOpenapi31Standalone(true).then((output) => - writeOutput( - path.join(outputDir, "openapi-3.1-specification-validator.ts"), - output, - ), -) diff --git a/scripts/generate-webstorm-runconfigs.mjs b/scripts/generate-webstorm-runconfigs.mjs new file mode 100755 index 000000000..68ce26c8f --- /dev/null +++ b/scripts/generate-webstorm-runconfigs.mjs @@ -0,0 +1,93 @@ +#!/usr/bin/env node + +import {execSync} from "node:child_process" +import fs from "node:fs" +import path from "node:path" +import {Command, Option} from "@commander-js/extra-typings" + +const program = new Command() + .addOption(new Option("-t --template ", "filter to a single template")) + .addOption(new Option("-s --spec ", "filter to a single spec")) + .addOption( + new Option( + "--schema-builder ", + "(typescript) runtime schema parsing library to use", + ) + .env("OPENAPI_SCHEMA_BUILDER") + .choices(["zod", "zod-v3", "zod-v4", "joi"]) + .default("zod-v4"), + ) + .showHelpAfterError() + +const templates = execSync( + "find ./integration-tests -mindepth 1 -maxdepth 1 -type d", +) + .toString("utf-8") + .split("\n") + .map((it) => it.trim()) + .filter(Boolean) + +const definitions = execSync("find ./integration-tests-definitions -type f") + .toString("utf-8") + .split("\n") + .map((it) => it.trim()) + .filter(Boolean) + +const config = program.parse().opts() + +const schemaBuilder = config.schemaBuilder + +const filteredTemplate = config.template +const filteredSpec = config.spec ? path.normalize(config.spec) : undefined + +console.info("filters", {filteredTemplate, filteredSpec}) +Promise.all( + templates + .filter((it) => !filteredTemplate || it.includes(filteredTemplate)) + .flatMap((templatePath) => + definitions + .filter( + (it) => !filteredSpec || path.normalize(it).includes(filteredSpec), + ) + .map((definition) => runSingle(templatePath, definition)), + ), +) + .then(() => { + console.log("success!") + process.exit(0) + }) + .catch((err) => { + console.error(err) + process.exit(1) + }) + +async function runSingle(templatePath, input) { + const inputType = input.endsWith(".tsp") ? "typespec" : "openapi3" + const filename = path.basename(input) + const template = path.basename(templatePath) + + const args = [ + `--input="${input}"`, + `--input-type=${inputType}`, + `--output="integration-tests/${template}/src/generated/${filename}"`, + `--template="${template}"`, + `--schema-builder=${schemaBuilder}`, + ] + const name = `${filename} - ${template}` + + fs.writeFileSync( + `.run/${name}.run.xml`, + ` + + + + +`, + "utf-8", + ) +} From bb1ead0677a3ab11b0b11d4de7fedbd1d7b3c787 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Sun, 12 Jul 2026 13:11:19 +0100 Subject: [PATCH 2/2] fix: adjust --- packages/documentation/next.config.mjs | 3 +-- .../openapi-code-generator/src/core/openapi-validator.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/documentation/next.config.mjs b/packages/documentation/next.config.mjs index 2c2fa56c7..b2b2638b4 100644 --- a/packages/documentation/next.config.mjs +++ b/packages/documentation/next.config.mjs @@ -11,8 +11,7 @@ const nextConfig = { turbopack: { resolveAlias: { "next-mdx-import-source-file": "./src/mdx-components.tsx", - // todo: ajv validator uses `require` in esm context, causing `node:module` to be used - // https://github.com/ajv-validator/ajv/issues/2598 should solve upstream + // todo: @hyperjump/json-schema isn't playing nice in the esm build "@nahkies/openapi-code-generator/web": "./node_modules/@nahkies/openapi-code-generator/dist/cjs/web.cjs", }, diff --git a/packages/openapi-code-generator/src/core/openapi-validator.ts b/packages/openapi-code-generator/src/core/openapi-validator.ts index ea454dfe8..ac6463391 100644 --- a/packages/openapi-code-generator/src/core/openapi-validator.ts +++ b/packages/openapi-code-generator/src/core/openapi-validator.ts @@ -1,9 +1,8 @@ -import type {Json} from "@hyperjump/json-pointer" import type { Output, OutputFormat, ValidationOptions, -} from "@hyperjump/json-schema/lib/index.d.ts" +} from "@hyperjump/json-schema" import {validate as validate3_0} from "@hyperjump/json-schema/openapi-3-0" import {validate as validate3_1} from "@hyperjump/json-schema/openapi-3-1" import { @@ -109,7 +108,8 @@ export class OpenapiValidator implements IOpenapiValidator { function wrapHyperjump( validate: ( url: string, - value: Json, + // biome-ignore lint/suspicious/noExplicitAny: unknown input + value: any, options?: OutputFormat | ValidationOptions, ) => Promise, uri: string,