diff --git a/src/api/json/catalog.json b/src/api/json/catalog.json index 43af501290a..9a21cdef090 100644 --- a/src/api/json/catalog.json +++ b/src/api/json/catalog.json @@ -4424,13 +4424,7 @@ "name": "openapi.json", "description": "An OpenAPI documentation file", "fileMatch": ["openapi.json", "openapi.yml", "openapi.yaml"], - "url": "https://spec.openapis.org/oas/3.1/schema/2025-09-15", - "versions": { - "2.0": "https://spec.openapis.org/oas/2.0/schema/2017-08-27", - "3.0": "https://spec.openapis.org/oas/3.0/schema/2024-10-18", - "3.1": "https://spec.openapis.org/oas/3.1/schema/2025-09-15", - "3.2": "https://spec.openapis.org/oas/3.2/schema/2025-09-17" - } + "url": "https://www.schemastore.org/openapi-3.X.json" }, { "name": "openrpc.json", @@ -6045,7 +6039,7 @@ "name": "Swagger API 2.0", "description": "Swagger API 2.0", "fileMatch": ["swagger.json"], - "url": "https://www.schemastore.org/swagger-2.0.json" + "url": "https://spec.openapis.org/oas/2.0/schema/2017-08-27" }, { "name": "Synadia Connect Component", diff --git a/src/schema-validation.jsonc b/src/schema-validation.jsonc index 19a993c9ece..a6b6196296c 100644 --- a/src/schema-validation.jsonc +++ b/src/schema-validation.jsonc @@ -277,7 +277,6 @@ "schema-org-place.json", "servicehub.config.schema.json", "starlake.json", - "swagger-2.0.json", "vega.json", "metaschema-draft-07-unofficial-strict.json", "glazewm.json", @@ -392,7 +391,8 @@ "gitversion.json", "lazygit.json", "circleciconfig.json", - "ogen.json" + "ogen.json", + "openapi-3.X.json" // uses external references ], "catalogEntryNoLintNameOrDescription": [ "https://json-schema.org/draft-04/schema", @@ -1277,9 +1277,6 @@ "staticwebapp.config.json": { "unknownKeywords": ["examples"] }, - "swagger-2.0.json": { - "externalSchema": ["base-04.json"] - }, "template.json": { "unknownKeywords": ["deprecationMessage", "sources"] }, diff --git a/src/schemas/json/openapi-3.X.json b/src/schemas/json/openapi-3.X.json new file mode 100644 index 00000000000..dcceb6e4ec6 --- /dev/null +++ b/src/schemas/json/openapi-3.X.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://www.schemastore.org/openapi-3.X.json", + "title": "OpenAPI Document v3.X", + "type": "object", + "required": ["openapi"], + "properties": { + "openapi": { + "pattern": "^3\\.[0-2]\\.", + "type": "string" + } + }, + "allOf": [ + { + "if": { + "properties": { + "openapi": { + "pattern": "^3\\.0\\.", + "type": "string" + } + } + }, + "then": { + "$ref": "https://spec.openapis.org/oas/3.0/schema/2024-10-18" + } + }, + { + "if": { + "properties": { + "openapi": { + "pattern": "^3\\.1\\.", + "type": "string" + } + } + }, + "then": { + "$ref": "https://spec.openapis.org/oas/3.1/schema/2025-09-15" + } + }, + { + "if": { + "properties": { + "openapi": { + "pattern": "^3\\.2\\.", + "type": "string" + } + } + }, + "then": { + "$ref": "https://spec.openapis.org/oas/3.2/schema/2025-09-17" + } + } + ] +} diff --git a/src/schemas/json/swagger-2.0.json b/src/schemas/json/swagger-2.0.json deleted file mode 100644 index 5c395378c41..00000000000 --- a/src/schemas/json/swagger-2.0.json +++ /dev/null @@ -1,1456 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "additionalProperties": false, - "definitions": { - "info": { - "type": "object", - "description": "General information about the API.", - "required": ["version", "title"], - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "title": { - "type": "string", - "description": "A unique and precise title of the API." - }, - "version": { - "type": "string", - "description": "A semantic version number of the API." - }, - "description": { - "type": "string", - "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed." - }, - "termsOfService": { - "type": "string", - "description": "The terms of service for the API." - }, - "contact": { - "$ref": "#/definitions/contact" - }, - "license": { - "$ref": "#/definitions/license" - } - } - }, - "contact": { - "type": "object", - "description": "Contact information for the owners of the API.", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "description": "The identifying name of the contact person/organization." - }, - "url": { - "type": "string", - "description": "The URL pointing to the contact information.", - "format": "uri" - }, - "email": { - "type": "string", - "description": "The email address of the contact person/organization.", - "format": "email" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "license": { - "type": "object", - "required": ["name"], - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "description": "The name of the license type. It's encouraged to use an OSI compatible license." - }, - "url": { - "type": "string", - "description": "The URL pointing to the license.", - "format": "uri" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "paths": { - "type": "object", - "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - }, - "^/": { - "$ref": "#/definitions/pathItem" - } - }, - "additionalProperties": false - }, - "definitions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schema" - }, - "description": "One or more JSON objects describing the schemas being consumed and produced by the API." - }, - "parameterDefinitions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/parameter" - }, - "description": "One or more JSON representations for parameters" - }, - "responseDefinitions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/response" - }, - "description": "One or more JSON representations for responses" - }, - "externalDocs": { - "type": "object", - "additionalProperties": false, - "description": "information about external documentation", - "required": ["url"], - "properties": { - "description": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "examples": { - "type": "object", - "additionalProperties": true - }, - "mimeType": { - "type": "string", - "description": "The MIME type of the HTTP message." - }, - "operation": { - "type": "object", - "required": ["responses"], - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - }, - "summary": { - "type": "string", - "description": "A brief summary of the operation." - }, - "description": { - "type": "string", - "description": "A longer description of the operation, GitHub Flavored Markdown is allowed." - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - }, - "operationId": { - "type": "string", - "description": "A unique identifier of the operation." - }, - "produces": { - "description": "A list of MIME types the API can produce.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "consumes": { - "description": "A list of MIME types the API can consume.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "parameters": { - "$ref": "#/definitions/parametersList" - }, - "responses": { - "$ref": "#/definitions/responses" - }, - "schemes": { - "$ref": "#/definitions/schemesList" - }, - "deprecated": { - "type": "boolean", - "default": false - }, - "security": { - "$ref": "#/definitions/security" - } - } - }, - "pathItem": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "$ref": { - "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" - }, - "parameters": { - "$ref": "#/definitions/parametersList" - } - } - }, - "responses": { - "type": "object", - "description": "Response objects names can either be any valid HTTP status code or 'default'.", - "minProperties": 1, - "additionalProperties": false, - "patternProperties": { - "^([0-9]{3})$|^(default)$": { - "$ref": "#/definitions/responseValue" - }, - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "not": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - } - }, - "responseValue": { - "oneOf": [ - { - "$ref": "#/definitions/response" - }, - { - "$ref": "#/definitions/jsonReference" - } - ] - }, - "response": { - "type": "object", - "required": ["description"], - "properties": { - "description": { - "type": "string" - }, - "schema": { - "oneOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "$ref": "#/definitions/fileSchema" - } - ] - }, - "headers": { - "$ref": "#/definitions/headers" - }, - "examples": { - "$ref": "#/definitions/examples" - } - }, - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "headers": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/header" - } - }, - "header": { - "type": "object", - "additionalProperties": false, - "required": ["type"], - "properties": { - "type": { - "type": "string", - "enum": ["string", "number", "integer", "boolean", "array"] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "vendorExtension": { - "description": "Any property starting with x- is valid." - }, - "bodyParameter": { - "type": "object", - "required": ["name", "in", "schema"], - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": ["body"] - }, - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "schema": { - "$ref": "#/definitions/schema" - } - }, - "additionalProperties": false - }, - "headerParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": ["header"] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "type": { - "type": "string", - "enum": ["string", "number", "boolean", "integer", "array"] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "queryParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": ["query"] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "allowEmptyValue": { - "type": "boolean", - "default": false, - "description": "allows sending a parameter by name only or with an empty value." - }, - "type": { - "type": "string", - "enum": ["string", "number", "boolean", "integer", "array"] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormatWithMulti" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "formDataParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": ["formData"] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "allowEmptyValue": { - "type": "boolean", - "default": false, - "description": "allows sending a parameter by name only or with an empty value." - }, - "type": { - "type": "string", - "enum": ["string", "number", "boolean", "integer", "array", "file"] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormatWithMulti" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "pathParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "required": ["required"], - "properties": { - "required": { - "type": "boolean", - "enum": [true], - "description": "Determines whether or not this parameter is required or optional." - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": ["path"] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "type": { - "type": "string", - "enum": ["string", "number", "boolean", "integer", "array"] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "nonBodyParameter": { - "type": "object", - "required": ["name", "in", "type"], - "oneOf": [ - { - "$ref": "#/definitions/headerParameterSubSchema" - }, - { - "$ref": "#/definitions/formDataParameterSubSchema" - }, - { - "$ref": "#/definitions/queryParameterSubSchema" - }, - { - "$ref": "#/definitions/pathParameterSubSchema" - } - ] - }, - "parameter": { - "oneOf": [ - { - "$ref": "#/definitions/bodyParameter" - }, - { - "$ref": "#/definitions/nonBodyParameter" - } - ] - }, - "schema": { - "type": "object", - "description": "A deterministic version of a JSON Schema object.", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "$ref": { - "type": "string" - }, - "format": { - "type": "string" - }, - "title": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/title" - }, - "description": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/description" - }, - "default": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/default" - }, - "multipleOf": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" - }, - "maximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" - }, - "exclusiveMaximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" - }, - "minimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" - }, - "exclusiveMinimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" - }, - "maxLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "pattern": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" - }, - "maxItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "uniqueItems": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" - }, - "maxProperties": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minProperties": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "required": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" - }, - "enum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" - }, - "additionalProperties": { - "anyOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "type": "boolean" - } - ], - "default": {} - }, - "type": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/type" - }, - "items": { - "anyOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/schema" - } - } - ], - "default": {} - }, - "allOf": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/schema" - } - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schema" - }, - "default": {} - }, - "discriminator": { - "type": "string" - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "xml": { - "$ref": "#/definitions/xml" - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - }, - "example": {} - }, - "additionalProperties": false - }, - "fileSchema": { - "type": "object", - "description": "A deterministic version of a JSON Schema object.", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "required": ["type"], - "properties": { - "format": { - "type": "string" - }, - "title": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/title" - }, - "description": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/description" - }, - "default": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/default" - }, - "required": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" - }, - "type": { - "type": "string", - "enum": ["file"] - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - }, - "example": {} - }, - "additionalProperties": false - }, - "primitivesItems": { - "type": "object", - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "enum": ["string", "number", "integer", "boolean", "array"] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "security": { - "type": "array", - "items": { - "$ref": "#/definitions/securityRequirement" - }, - "uniqueItems": true - }, - "securityRequirement": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - } - }, - "xml": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "prefix": { - "type": "string" - }, - "attribute": { - "type": "boolean", - "default": false - }, - "wrapped": { - "type": "boolean", - "default": false - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "tag": { - "type": "object", - "additionalProperties": false, - "required": ["name"], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "securityDefinitions": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/basicAuthenticationSecurity" - }, - { - "$ref": "#/definitions/apiKeySecurity" - }, - { - "$ref": "#/definitions/oauth2ImplicitSecurity" - }, - { - "$ref": "#/definitions/oauth2PasswordSecurity" - }, - { - "$ref": "#/definitions/oauth2ApplicationSecurity" - }, - { - "$ref": "#/definitions/oauth2AccessCodeSecurity" - } - ] - } - }, - "basicAuthenticationSecurity": { - "type": "object", - "additionalProperties": false, - "required": ["type"], - "properties": { - "type": { - "type": "string", - "enum": ["basic"] - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "apiKeySecurity": { - "type": "object", - "additionalProperties": false, - "required": ["type", "name", "in"], - "properties": { - "type": { - "type": "string", - "enum": ["apiKey"] - }, - "name": { - "type": "string" - }, - "in": { - "type": "string", - "enum": ["header", "query"] - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2ImplicitSecurity": { - "type": "object", - "additionalProperties": false, - "required": ["type", "flow", "authorizationUrl"], - "properties": { - "type": { - "type": "string", - "enum": ["oauth2"] - }, - "flow": { - "type": "string", - "enum": ["implicit"] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "authorizationUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2PasswordSecurity": { - "type": "object", - "additionalProperties": false, - "required": ["type", "flow", "tokenUrl"], - "properties": { - "type": { - "type": "string", - "enum": ["oauth2"] - }, - "flow": { - "type": "string", - "enum": ["password"] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2ApplicationSecurity": { - "type": "object", - "additionalProperties": false, - "required": ["type", "flow", "tokenUrl"], - "properties": { - "type": { - "type": "string", - "enum": ["oauth2"] - }, - "flow": { - "type": "string", - "enum": ["application"] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2AccessCodeSecurity": { - "type": "object", - "additionalProperties": false, - "required": ["type", "flow", "authorizationUrl", "tokenUrl"], - "properties": { - "type": { - "type": "string", - "enum": ["oauth2"] - }, - "flow": { - "type": "string", - "enum": ["accessCode"] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "authorizationUrl": { - "type": "string", - "format": "uri" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2Scopes": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mediaTypeList": { - "type": "array", - "items": { - "$ref": "#/definitions/mimeType" - }, - "uniqueItems": true - }, - "parametersList": { - "type": "array", - "description": "The parameters needed to send a valid API call.", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/parameter" - }, - { - "$ref": "#/definitions/jsonReference" - } - ] - }, - "uniqueItems": true - }, - "schemesList": { - "type": "array", - "description": "The transfer protocol of the API.", - "items": { - "type": "string", - "enum": ["http", "https", "ws", "wss"] - }, - "uniqueItems": true - }, - "collectionFormat": { - "type": "string", - "enum": ["csv", "ssv", "tsv", "pipes"], - "default": "csv" - }, - "collectionFormatWithMulti": { - "type": "string", - "enum": ["csv", "ssv", "tsv", "pipes", "multi"], - "default": "csv" - }, - "title": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/title" - }, - "description": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/description" - }, - "default": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/default" - }, - "multipleOf": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" - }, - "maximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" - }, - "exclusiveMaximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" - }, - "minimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" - }, - "exclusiveMinimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" - }, - "maxLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "pattern": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" - }, - "maxItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "uniqueItems": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" - }, - "enum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" - }, - "jsonReference": { - "type": "object", - "required": ["$ref"], - "additionalProperties": false, - "properties": { - "$ref": { - "type": "string" - } - } - } - }, - "id": "http://swagger.io/v2/schema.json#", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "swagger": { - "type": "string", - "enum": ["2.0"], - "description": "The Swagger version of this document." - }, - "info": { - "$ref": "#/definitions/info" - }, - "host": { - "type": "string", - "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$", - "description": "The host (name or ip) of the API. Example: 'swagger.io'" - }, - "basePath": { - "type": "string", - "pattern": "^/", - "description": "The base path to the API. Example: '/api'." - }, - "schemes": { - "$ref": "#/definitions/schemesList" - }, - "consumes": { - "description": "A list of MIME types accepted by the API.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "produces": { - "description": "A list of MIME types the API can produce.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "paths": { - "$ref": "#/definitions/paths" - }, - "definitions": { - "$ref": "#/definitions/definitions" - }, - "parameters": { - "$ref": "#/definitions/parameterDefinitions" - }, - "responses": { - "$ref": "#/definitions/responseDefinitions" - }, - "security": { - "$ref": "#/definitions/security" - }, - "securityDefinitions": { - "$ref": "#/definitions/securityDefinitions" - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/tag" - }, - "uniqueItems": true - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - } - }, - "required": ["swagger", "info", "paths"], - "title": "A JSON Schema for Swagger 2.0 API.", - "type": "object" -} diff --git a/src/test/swagger-2.0/petstore-expanded.json b/src/test/swagger-2.0/petstore-expanded.json deleted file mode 100644 index b01e2d6fc9d..00000000000 --- a/src/test/swagger-2.0/petstore-expanded.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "basePath": "/api", - "consumes": ["application/json"], - "definitions": { - "errorModel": { - "properties": { - "code": { - "format": "int32", - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": ["code", "message"] - }, - "newPet": { - "allOf": [ - { - "$ref": "pet" - }, - { - "properties": { - "id": { - "format": "int64", - "type": "integer" - } - }, - "required": ["name"] - } - ] - }, - "pet": { - "properties": { - "id": { - "format": "int64", - "type": "integer" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - }, - "required": ["id", "name"] - } - }, - "host": "petstore.swagger.wordnik.com", - "info": { - "contact": { - "email": "foo@example.com", - "name": "Wordnik API Team", - "url": "http://madskristensen.net" - }, - "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", - "license": { - "name": "MIT", - "url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT" - }, - "termsOfService": "http://helloreverb.com/terms/", - "title": "Swagger Petstore", - "version": "1.0.0" - }, - "paths": { - "/pets": { - "get": { - "description": "Returns all pets from the system that the user has access to", - "operationId": "findPets", - "parameters": [ - { - "collectionFormat": "csv", - "description": "tags to filter by", - "in": "query", - "items": { - "type": "string" - }, - "name": "tags", - "required": false, - "type": "array" - }, - { - "description": "maximum number of results to return", - "format": "int32", - "in": "query", - "name": "limit", - "required": false, - "type": "integer" - } - ], - "produces": [ - "application/json", - "application/xml", - "text/xml", - "text/html" - ], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "200": { - "description": "pet response", - "schema": { - "items": { - "$ref": "#/definitions/pet" - }, - "type": "array" - } - } - } - }, - "post": { - "description": "Creates a new pet in the store. Duplicates are allowed", - "operationId": "addPet", - "parameters": [ - { - "description": "Pet to add to the store", - "in": "body", - "name": "pet", - "required": true, - "schema": { - "$ref": "#/definitions/newPet" - } - } - ], - "produces": ["application/json"], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/pet" - } - } - } - } - }, - "/pets/{id}": { - "delete": { - "description": "deletes a single pet based on the ID supplied", - "operationId": "deletePet", - "parameters": [ - { - "description": "ID of pet to delete", - "format": "int64", - "in": "path", - "name": "id", - "required": true, - "type": "integer" - } - ], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "204": { - "description": "pet deleted" - } - } - }, - "get": { - "description": "Returns a user based on a single ID, if the user does not have access to the pet", - "operationId": "findPetById", - "parameters": [ - { - "description": "ID of pet to fetch", - "format": "int64", - "in": "path", - "name": "id", - "required": true, - "type": "integer" - } - ], - "produces": [ - "application/json", - "application/xml", - "text/xml", - "text/html" - ], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "ErrorModel" - } - }, - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/pet" - } - } - } - } - } - }, - "produces": ["application/json"], - "schemes": ["http"], - "swagger": "2.0" -} diff --git a/src/test/swagger-2.0/petstore-simple.json b/src/test/swagger-2.0/petstore-simple.json deleted file mode 100644 index 8d63b728e48..00000000000 --- a/src/test/swagger-2.0/petstore-simple.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "basePath": "/api", - "consumes": ["application/json"], - "definitions": { - "errorModel": { - "properties": { - "code": { - "format": "int32", - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": ["code", "message"] - }, - "pet": { - "properties": { - "id": { - "format": "int64", - "type": "integer" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - }, - "required": ["id", "name"] - }, - "petInput": { - "allOf": [ - { - "$ref": "Pet" - }, - { - "properties": { - "id": { - "format": "int64", - "type": "integer" - } - }, - "required": ["name"] - } - ] - } - }, - "host": "petstore.swagger.wordnik.com", - "info": { - "contact": { - "name": "Wordnik API Team" - }, - "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", - "license": { - "name": "MIT" - }, - "termsOfService": "http://helloreverb.com/terms/", - "title": "Swagger Petstore", - "version": "1.0.0" - }, - "paths": { - "/pets": { - "get": { - "description": "Returns all pets from the system that the user has access to", - "operationId": "findPets", - "parameters": [ - { - "collectionFormat": "csv", - "description": "tags to filter by", - "in": "query", - "items": { - "type": "string" - }, - "name": "tags", - "required": false, - "type": "array" - }, - { - "description": "maximum number of results to return", - "format": "int32", - "in": "query", - "name": "limit", - "required": false, - "type": "integer" - } - ], - "produces": [ - "application/json", - "application/xml", - "text/xml", - "text/html" - ], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "200": { - "description": "pet response", - "schema": { - "items": { - "$ref": "#/definitions/pet" - }, - "type": "array" - } - } - } - }, - "post": { - "description": "Creates a new pet in the store. Duplicates are allowed", - "operationId": "addPet", - "parameters": [ - { - "description": "Pet to add to the store", - "in": "body", - "name": "pet", - "required": true, - "schema": { - "$ref": "#/definitions/petInput" - } - } - ], - "produces": ["application/json"], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/pet" - } - } - } - } - }, - "/pets/{id}": { - "delete": { - "description": "deletes a single pet based on the ID supplied", - "operationId": "deletePet", - "parameters": [ - { - "description": "ID of pet to delete", - "format": "int64", - "in": "path", - "name": "id", - "required": true, - "type": "integer" - } - ], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "204": { - "description": "pet deleted" - } - } - }, - "get": { - "description": "Returns a user based on a single ID, if the user does not have access to the pet", - "operationId": "findPetById", - "parameters": [ - { - "description": "ID of pet to fetch", - "format": "int64", - "in": "path", - "name": "id", - "required": true, - "type": "integer" - } - ], - "produces": [ - "application/json", - "application/xml", - "text/xml", - "text/html" - ], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "200": { - "description": "pet response", - "schema": { - "$ref": "Pet" - } - } - } - } - } - }, - "produces": ["application/json"], - "schemes": ["http"], - "swagger": "2.0" -} diff --git a/src/test/swagger-2.0/petstore-with-external-docs.json b/src/test/swagger-2.0/petstore-with-external-docs.json deleted file mode 100644 index 4d7ae2adcb4..00000000000 --- a/src/test/swagger-2.0/petstore-with-external-docs.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "basePath": "/api", - "consumes": ["application/json"], - "definitions": { - "errorModel": { - "properties": { - "code": { - "format": "int32", - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": ["code", "message"] - }, - "newPet": { - "allOf": [ - { - "$ref": "Pet" - }, - { - "properties": { - "id": { - "format": "int64", - "type": "integer" - } - }, - "required": ["name"] - } - ] - }, - "pet": { - "externalDocs": { - "description": "find more info here", - "url": "https://helloreverb.com/about" - }, - "properties": { - "id": { - "format": "int64", - "type": "integer" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - }, - "required": ["id", "name"] - } - }, - "externalDocs": { - "description": "find more info here", - "url": "https://helloreverb.com/about" - }, - "host": "petstore.swagger.wordnik.com", - "info": { - "contact": { - "email": "foo@example.com", - "name": "Wordnik API Team", - "url": "http://madskristensen.net" - }, - "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", - "license": { - "name": "MIT", - "url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT" - }, - "termsOfService": "http://helloreverb.com/terms/", - "title": "Swagger Petstore", - "version": "1.0.0" - }, - "paths": { - "/pets": { - "get": { - "description": "Returns all pets from the system that the user has access to", - "externalDocs": { - "description": "find more info here", - "url": "https://helloreverb.com/about" - }, - "operationId": "findPets", - "parameters": [ - { - "collectionFormat": "csv", - "description": "tags to filter by", - "in": "query", - "items": { - "type": "string" - }, - "name": "tags", - "required": false, - "type": "array" - }, - { - "description": "maximum number of results to return", - "format": "int32", - "in": "query", - "name": "limit", - "required": false, - "type": "integer" - } - ], - "produces": [ - "application/json", - "application/xml", - "text/xml", - "text/html" - ], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "200": { - "description": "pet response", - "schema": { - "items": { - "$ref": "#/definitions/pet" - }, - "type": "array" - } - } - } - }, - "post": { - "description": "Creates a new pet in the store. Duplicates are allowed", - "operationId": "addPet", - "parameters": [ - { - "description": "Pet to add to the store", - "in": "body", - "name": "pet", - "required": true, - "schema": { - "$ref": "#/definitions/newPet" - } - } - ], - "produces": ["application/json"], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/pet" - } - } - } - } - }, - "/pets/{id}": { - "delete": { - "description": "deletes a single pet based on the ID supplied", - "operationId": "deletePet", - "parameters": [ - { - "description": "ID of pet to delete", - "format": "int64", - "in": "path", - "name": "id", - "required": true, - "type": "integer" - } - ], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/errorModel" - } - }, - "204": { - "description": "pet deleted" - } - } - }, - "get": { - "description": "Returns a user based on a single ID, if the user does not have access to the pet", - "operationId": "findPetById", - "parameters": [ - { - "description": "ID of pet to fetch", - "format": "int64", - "in": "path", - "name": "id", - "required": true, - "type": "integer" - } - ], - "produces": [ - "application/json", - "application/xml", - "text/xml", - "text/html" - ], - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "ErrorModel" - } - }, - "200": { - "description": "pet response", - "schema": { - "$ref": "Pet" - } - } - } - } - } - }, - "produces": ["application/json"], - "schemes": ["http"], - "swagger": "2.0" -} diff --git a/src/test/swagger-2.0/petstore.json b/src/test/swagger-2.0/petstore.json deleted file mode 100644 index c5c162babef..00000000000 --- a/src/test/swagger-2.0/petstore.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "basePath": "/api", - "definitions": { - "Error": { - "properties": { - "code": { - "format": "int32", - "type": "integer" - }, - "message": { - "type": "string" - } - }, - "required": ["code", "message"] - }, - "Pet": { - "properties": { - "id": { - "format": "int64", - "type": "integer" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - }, - "required": ["id", "name"] - } - }, - "host": "petstore.swagger.wordnik.com", - "info": { - "contact": { - "name": "wordnik api team", - "url": "http://developer.wordnik.com" - }, - "license": { - "name": "Creative Commons 4.0 International", - "url": "http://creativecommons.org/licenses/by/4.0/" - }, - "title": "Swagger Petstore", - "version": "1.0.0" - }, - "paths": { - "/pets": { - "get": { - "responses": { - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "200": { - "description": "pet response", - "headers": { - "x-expires": { - "type": "string" - } - }, - "schema": { - "items": { - "$ref": "#/definitions/Pet" - }, - "type": "array" - } - } - }, - "summary": "finds pets in the system", - "tags": ["Pet Operations"] - } - } - }, - "schemes": ["http"], - "swagger": "2.0" -}