UNPKG

@furystack/rest

Version:
1,264 lines (1,263 loc) 31.3 kB
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://schemas.sourcemeta.com/openapi/v3.1/schema/2022-10-07.json", "description": "The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0", "$ref": "#/$defs/specification-extensions", "type": "object", "anyOf": [ { "required": ["paths"] }, { "required": ["components"] }, { "required": ["webhooks"] } ], "required": ["openapi", "info"], "properties": { "components": { "$ref": "#/$defs/components" }, "externalDocs": { "$ref": "#/$defs/external-documentation" }, "info": { "$ref": "#/$defs/info" }, "jsonSchemaDialect": { "default": "https://spec.openapis.org/oas/3.1/dialect/base", "type": "string", "format": "uri" }, "openapi": { "type": "string", "pattern": "^3\\.1\\.\\d+(-.+)?$" }, "paths": { "$ref": "#/$defs/paths" }, "security": { "type": "array", "items": { "$ref": "#/$defs/security-requirement" } }, "servers": { "default": [ { "url": "/" } ], "type": "array", "items": { "$ref": "#/$defs/server" } }, "tags": { "type": "array", "items": { "$ref": "#/$defs/tag" } }, "webhooks": { "type": "object", "additionalProperties": { "$ref": "#/$defs/path-item" } } }, "unevaluatedProperties": false, "$defs": { "examples": { "properties": { "examples": { "type": "object", "additionalProperties": { "$ref": "#/$defs/example-or-reference" } }, "example": true } }, "callbacks": { "$comment": "https://spec.openapis.org/oas/v3.1.0#callback-object", "$ref": "#/$defs/specification-extensions", "type": "object", "additionalProperties": { "$ref": "#/$defs/path-item" } }, "callbacks-or-reference": { "if": { "type": "object", "required": ["$ref"] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/callbacks" } }, "components": { "$comment": "https://spec.openapis.org/oas/v3.1.0#components-object", "$ref": "#/$defs/specification-extensions", "type": "object", "properties": { "examples": { "type": "object", "additionalProperties": { "$ref": "#/$defs/example-or-reference" } }, "callbacks": { "type": "object", "additionalProperties": { "$ref": "#/$defs/callbacks-or-reference" } }, "headers": { "type": "object", "additionalProperties": { "$ref": "#/$defs/header-or-reference" } }, "links": { "type": "object", "additionalProperties": { "$ref": "#/$defs/link-or-reference" } }, "parameters": { "type": "object", "additionalProperties": { "$ref": "#/$defs/parameter-or-reference" } }, "pathItems": { "type": "object", "additionalProperties": { "$ref": "#/$defs/path-item" } }, "requestBodies": { "type": "object", "additionalProperties": { "$ref": "#/$defs/request-body-or-reference" } }, "responses": { "type": "object", "additionalProperties": { "$ref": "#/$defs/response-or-reference" } }, "schemas": { "type": "object", "additionalProperties": { "$dynamicRef": "#meta" } }, "securitySchemes": { "type": "object", "additionalProperties": { "$ref": "#/$defs/security-scheme-or-reference" } } }, "patternProperties": { "^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$": { "$comment": "Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected", "propertyNames": { "pattern": "^[a-zA-Z0-9._-]+$" } } }, "unevaluatedProperties": false }, "contact": { "$comment": "https://spec.openapis.org/oas/v3.1.0#contact-object", "$ref": "#/$defs/specification-extensions", "type": "object", "properties": { "email": { "type": "string", "format": "email" }, "name": { "type": "string" }, "url": { "type": "string", "format": "uri" } }, "unevaluatedProperties": false }, "content": { "$comment": "https://spec.openapis.org/oas/v3.1.0#fixed-fields-10", "type": "object", "propertyNames": { "format": "media-range" }, "additionalProperties": { "$ref": "#/$defs/media-type" } }, "encoding": { "$comment": "https://spec.openapis.org/oas/v3.1.0#encoding-object", "type": "object", "allOf": [ { "$ref": "#/$defs/specification-extensions" }, { "$ref": "#/$defs/styles-for-form" } ], "properties": { "allowReserved": { "default": false, "type": "boolean" }, "contentType": { "type": "string", "format": "media-range" }, "explode": { "type": "boolean" }, "headers": { "type": "object", "additionalProperties": { "$ref": "#/$defs/header-or-reference" } }, "style": { "default": "form", "enum": ["form", "spaceDelimited", "pipeDelimited", "deepObject"] } }, "unevaluatedProperties": false }, "example": { "$comment": "https://spec.openapis.org/oas/v3.1.0#example-object", "$ref": "#/$defs/specification-extensions", "type": "object", "not": { "required": ["value", "externalValue"] }, "properties": { "description": { "type": "string" }, "externalValue": { "type": "string", "format": "uri" }, "summary": { "type": "string" }, "value": true }, "unevaluatedProperties": false }, "example-or-reference": { "if": { "type": "object", "required": ["$ref"] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/example" } }, "external-documentation": { "$comment": "https://spec.openapis.org/oas/v3.1.0#external-documentation-object", "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["url"], "properties": { "description": { "type": "string" }, "url": { "type": "string", "format": "uri" } }, "unevaluatedProperties": false }, "header": { "$comment": "https://spec.openapis.org/oas/v3.1.0#header-object", "$ref": "#/$defs/specification-extensions", "type": "object", "oneOf": [ { "required": ["schema"] }, { "required": ["content"] } ], "properties": { "description": { "type": "string" }, "deprecated": { "default": false, "type": "boolean" }, "required": { "default": false, "type": "boolean" }, "content": { "$ref": "#/$defs/content", "maxProperties": 1, "minProperties": 1 }, "schema": { "$dynamicRef": "#meta" } }, "unevaluatedProperties": false, "dependentSchemas": { "schema": { "$ref": "#/$defs/examples", "properties": { "explode": { "default": false, "type": "boolean" }, "style": { "default": "simple", "const": "simple" } } } } }, "header-or-reference": { "if": { "type": "object", "required": ["$ref"] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/header" } }, "info": { "$comment": "https://spec.openapis.org/oas/v3.1.0#info-object", "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["title", "version"], "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "contact": { "$ref": "#/$defs/contact" }, "license": { "$ref": "#/$defs/license" }, "summary": { "type": "string" }, "termsOfService": { "type": "string", "format": "uri" }, "version": { "type": "string" } }, "unevaluatedProperties": false }, "license": { "$comment": "https://spec.openapis.org/oas/v3.1.0#license-object", "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["name"], "properties": { "identifier": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string", "format": "uri" } }, "unevaluatedProperties": false, "dependentSchemas": { "identifier": { "not": { "required": ["url"] } } } }, "link": { "$comment": "https://spec.openapis.org/oas/v3.1.0#link-object", "$ref": "#/$defs/specification-extensions", "type": "object", "oneOf": [ { "required": ["operationRef"] }, { "required": ["operationId"] } ], "properties": { "description": { "type": "string" }, "body": { "$ref": "#/$defs/server" }, "operationId": { "type": "string" }, "operationRef": { "type": "string", "format": "uri-reference" }, "parameters": { "$ref": "#/$defs/map-of-strings" }, "requestBody": true }, "unevaluatedProperties": false }, "link-or-reference": { "if": { "type": "object", "required": ["$ref"] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/link" } }, "map-of-strings": { "type": "object", "additionalProperties": { "type": "string" } }, "media-type": { "$comment": "https://spec.openapis.org/oas/v3.1.0#media-type-object", "type": "object", "allOf": [ { "$ref": "#/$defs/specification-extensions" }, { "$ref": "#/$defs/examples" } ], "properties": { "encoding": { "type": "object", "additionalProperties": { "$ref": "#/$defs/encoding" } }, "schema": { "$dynamicRef": "#meta" } }, "unevaluatedProperties": false }, "oauth-flows": { "$ref": "#/$defs/specification-extensions", "type": "object", "properties": { "authorizationCode": { "$ref": "#/$defs/oauth-flows/$defs/authorization-code" }, "clientCredentials": { "$ref": "#/$defs/oauth-flows/$defs/client-credentials" }, "implicit": { "$ref": "#/$defs/oauth-flows/$defs/implicit" }, "password": { "$ref": "#/$defs/oauth-flows/$defs/password" } }, "unevaluatedProperties": false, "$defs": { "authorization-code": { "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["authorizationUrl", "tokenUrl", "scopes"], "properties": { "authorizationUrl": { "type": "string", "format": "uri" }, "refreshUrl": { "type": "string", "format": "uri" }, "scopes": { "$ref": "#/$defs/map-of-strings" }, "tokenUrl": { "type": "string", "format": "uri" } }, "unevaluatedProperties": false }, "client-credentials": { "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["tokenUrl", "scopes"], "properties": { "refreshUrl": { "type": "string", "format": "uri" }, "scopes": { "$ref": "#/$defs/map-of-strings" }, "tokenUrl": { "type": "string", "format": "uri" } }, "unevaluatedProperties": false }, "implicit": { "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["authorizationUrl", "scopes"], "properties": { "authorizationUrl": { "type": "string", "format": "uri" }, "refreshUrl": { "type": "string", "format": "uri" }, "scopes": { "$ref": "#/$defs/map-of-strings" } }, "unevaluatedProperties": false }, "password": { "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["tokenUrl", "scopes"], "properties": { "refreshUrl": { "type": "string", "format": "uri" }, "scopes": { "$ref": "#/$defs/map-of-strings" }, "tokenUrl": { "type": "string", "format": "uri" } }, "unevaluatedProperties": false } } }, "operation": { "$comment": "https://spec.openapis.org/oas/v3.1.0#operation-object", "$ref": "#/$defs/specification-extensions", "type": "object", "properties": { "description": { "type": "string" }, "deprecated": { "default": false, "type": "boolean" }, "callbacks": { "type": "object", "additionalProperties": { "$ref": "#/$defs/callbacks-or-reference" } }, "externalDocs": { "$ref": "#/$defs/external-documentation" }, "operationId": { "type": "string" }, "parameters": { "type": "array", "items": { "$ref": "#/$defs/parameter-or-reference" } }, "requestBody": { "$ref": "#/$defs/request-body-or-reference" }, "responses": { "$ref": "#/$defs/responses" }, "security": { "type": "array", "items": { "$ref": "#/$defs/security-requirement" } }, "servers": { "type": "array", "items": { "$ref": "#/$defs/server" } }, "summary": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "unevaluatedProperties": false }, "parameter": { "$comment": "https://spec.openapis.org/oas/v3.1.0#parameter-object", "$ref": "#/$defs/specification-extensions", "type": "object", "oneOf": [ { "required": ["schema"] }, { "required": ["content"] } ], "if": { "required": ["in"], "properties": { "in": { "const": "query" } } }, "then": { "properties": { "allowEmptyValue": { "default": false, "type": "boolean" } } }, "required": ["name", "in"], "properties": { "description": { "type": "string" }, "deprecated": { "default": false, "type": "boolean" }, "required": { "default": false, "type": "boolean" }, "content": { "$ref": "#/$defs/content", "maxProperties": 1, "minProperties": 1 }, "in": { "enum": ["query", "header", "path", "cookie"] }, "name": { "type": "string" }, "schema": { "$dynamicRef": "#meta" } }, "unevaluatedProperties": false, "dependentSchemas": { "schema": { "allOf": [ { "$ref": "#/$defs/examples" }, { "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path" }, { "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header" }, { "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query" }, { "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie" }, { "$ref": "#/$defs/styles-for-form" } ], "properties": { "explode": { "type": "boolean" }, "style": { "type": "string" } }, "$defs": { "styles-for-cookie": { "if": { "required": ["in"], "properties": { "in": { "const": "cookie" } } }, "then": { "properties": { "style": { "default": "form", "const": "form" } } } }, "styles-for-header": { "if": { "required": ["in"], "properties": { "in": { "const": "header" } } }, "then": { "properties": { "style": { "default": "simple", "const": "simple" } } } }, "styles-for-path": { "if": { "required": ["in"], "properties": { "in": { "const": "path" } } }, "then": { "required": ["required"], "properties": { "required": { "const": true }, "style": { "default": "simple", "enum": ["matrix", "label", "simple"] } } } }, "styles-for-query": { "if": { "required": ["in"], "properties": { "in": { "const": "query" } } }, "then": { "properties": { "allowReserved": { "default": false, "type": "boolean" }, "style": { "default": "form", "enum": ["form", "spaceDelimited", "pipeDelimited", "deepObject"] } } } } } } } }, "parameter-or-reference": { "if": { "type": "object", "required": ["$ref"] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/parameter" } }, "path-item": { "$comment": "https://spec.openapis.org/oas/v3.1.0#path-item-object", "$ref": "#/$defs/specification-extensions", "type": "object", "properties": { "description": { "type": "string" }, "$ref": { "type": "string", "format": "uri-reference" }, "delete": { "$ref": "#/$defs/operation" }, "get": { "$ref": "#/$defs/operation" }, "head": { "$ref": "#/$defs/operation" }, "options": { "$ref": "#/$defs/operation" }, "parameters": { "type": "array", "items": { "$ref": "#/$defs/parameter-or-reference" } }, "patch": { "$ref": "#/$defs/operation" }, "post": { "$ref": "#/$defs/operation" }, "put": { "$ref": "#/$defs/operation" }, "servers": { "type": "array", "items": { "$ref": "#/$defs/server" } }, "summary": { "type": "string" }, "trace": { "$ref": "#/$defs/operation" } }, "unevaluatedProperties": false }, "paths": { "$comment": "https://spec.openapis.org/oas/v3.1.0#paths-object", "$ref": "#/$defs/specification-extensions", "type": "object", "patternProperties": { "^/": { "$ref": "#/$defs/path-item" } }, "unevaluatedProperties": false }, "reference": { "$comment": "https://spec.openapis.org/oas/v3.1.0#reference-object", "type": "object", "properties": { "description": { "type": "string" }, "$ref": { "type": "string", "format": "uri-reference" }, "summary": { "type": "string" } } }, "request-body": { "$comment": "https://spec.openapis.org/oas/v3.1.0#request-body-object", "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["content"], "properties": { "description": { "type": "string" }, "required": { "default": false, "type": "boolean" }, "content": { "$ref": "#/$defs/content" } }, "unevaluatedProperties": false }, "request-body-or-reference": { "if": { "type": "object", "required": ["$ref"] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/request-body" } }, "response": { "$comment": "https://spec.openapis.org/oas/v3.1.0#response-object", "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["description"], "properties": { "description": { "type": "string" }, "content": { "$ref": "#/$defs/content" }, "headers": { "type": "object", "additionalProperties": { "$ref": "#/$defs/header-or-reference" } }, "links": { "type": "object", "additionalProperties": { "$ref": "#/$defs/link-or-reference" } } }, "unevaluatedProperties": false }, "response-or-reference": { "if": { "type": "object", "required": ["$ref"] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/response" } }, "responses": { "$comment": "https://spec.openapis.org/oas/v3.1.0#responses-object", "$ref": "#/$defs/specification-extensions", "type": "object", "if": { "$comment": "either default, or at least one response code property must exist", "patternProperties": { "^[1-5](?:[0-9]{2}|XX)$": false } }, "then": { "required": ["default"] }, "minProperties": 1, "properties": { "default": { "$ref": "#/$defs/response-or-reference" } }, "patternProperties": { "^[1-5](?:[0-9]{2}|XX)$": { "$ref": "#/$defs/response-or-reference" } }, "unevaluatedProperties": false }, "schema": { "$dynamicAnchor": "meta", "$comment": "https://spec.openapis.org/oas/v3.1.0#schema-object", "type": ["object", "boolean"] }, "security-requirement": { "$comment": "https://spec.openapis.org/oas/v3.1.0#security-requirement-object", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "security-scheme": { "$comment": "https://spec.openapis.org/oas/v3.1.0#security-scheme-object", "type": "object", "allOf": [ { "$ref": "#/$defs/specification-extensions" }, { "$ref": "#/$defs/security-scheme/$defs/type-apikey" }, { "$ref": "#/$defs/security-scheme/$defs/type-http" }, { "$ref": "#/$defs/security-scheme/$defs/type-http-bearer" }, { "$ref": "#/$defs/security-scheme/$defs/type-oauth2" }, { "$ref": "#/$defs/security-scheme/$defs/type-oidc" } ], "required": ["type"], "properties": { "description": { "type": "string" }, "type": { "enum": ["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"] } }, "unevaluatedProperties": false, "$defs": { "type-apikey": { "if": { "required": ["type"], "properties": { "type": { "const": "apiKey" } } }, "then": { "required": ["name", "in"], "properties": { "in": { "enum": ["query", "header", "cookie"] }, "name": { "type": "string" } } } }, "type-http": { "if": { "required": ["type"], "properties": { "type": { "const": "http" } } }, "then": { "required": ["scheme"], "properties": { "scheme": { "type": "string" } } } }, "type-http-bearer": { "if": { "required": ["type", "scheme"], "properties": { "type": { "const": "http" }, "scheme": { "type": "string", "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" } } }, "then": { "properties": { "bearerFormat": { "type": "string" } } } }, "type-oauth2": { "if": { "required": ["type"], "properties": { "type": { "const": "oauth2" } } }, "then": { "required": ["flows"], "properties": { "flows": { "$ref": "#/$defs/oauth-flows" } } } }, "type-oidc": { "if": { "required": ["type"], "properties": { "type": { "const": "openIdConnect" } } }, "then": { "required": ["openIdConnectUrl"], "properties": { "openIdConnectUrl": { "type": "string", "format": "uri" } } } } } }, "security-scheme-or-reference": { "if": { "type": "object", "required": ["$ref"] }, "then": { "$ref": "#/$defs/reference" }, "else": { "$ref": "#/$defs/security-scheme" } }, "server": { "$comment": "https://spec.openapis.org/oas/v3.1.0#server-object", "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["url"], "properties": { "description": { "type": "string" }, "url": { "type": "string" }, "variables": { "type": "object", "additionalProperties": { "$ref": "#/$defs/server-variable" } } }, "unevaluatedProperties": false }, "server-variable": { "$comment": "https://spec.openapis.org/oas/v3.1.0#server-variable-object", "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["default"], "properties": { "description": { "type": "string" }, "default": { "type": "string" }, "enum": { "type": "array", "minItems": 1, "items": { "type": "string" } } }, "unevaluatedProperties": false }, "specification-extensions": { "$comment": "https://spec.openapis.org/oas/v3.1.0#specification-extensions", "patternProperties": { "^x-": true } }, "styles-for-form": { "if": { "required": ["style"], "properties": { "style": { "const": "form" } } }, "then": { "properties": { "explode": { "default": true } } }, "else": { "properties": { "explode": { "default": false } } } }, "tag": { "$comment": "https://spec.openapis.org/oas/v3.1.0#tag-object", "$ref": "#/$defs/specification-extensions", "type": "object", "required": ["name"], "properties": { "description": { "type": "string" }, "externalDocs": { "$ref": "#/$defs/external-documentation" }, "name": { "type": "string" } }, "unevaluatedProperties": false } } }