From e9773f5167a426332f51a8bf6a1984e88a4d3a9c Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Wed, 6 Dec 2023 21:21:52 +0400 Subject: [PATCH 01/57] build: gradle-intellij-plugin 1.15.0 -> 1.16.1 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 334308f..aeb22b6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("org.jetbrains.intellij") version "1.15.0" + id("org.jetbrains.intellij") version "1.16.1" java kotlin("jvm") version "1.8.10" } From 7062608c29633c02e4bc5f266cc1908bff4a8013 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Wed, 6 Dec 2023 21:46:16 +0400 Subject: [PATCH 02/57] build: intellij-plugin-verifier 1.303 -> 1.307 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index aeb22b6..77aac09 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,7 +48,7 @@ tasks.getByName("runPluginVe "2023.1.5", "2023.2", )) - verifierVersion.set("1.303") + verifierVersion.set("1.307") } tasks { From 7a45c5f6243347ed0290f954565628103a388117 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Wed, 6 Dec 2023 22:25:50 +0400 Subject: [PATCH 03/57] build: intellij-plugin-verifier add new 2023.2 versions --- build.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 77aac09..cc47762 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,6 +47,11 @@ tasks.getByName("runPluginVe "2023.1.4", "2023.1.5", "2023.2", + "2023.2.1", + "2023.2.2", + "2023.2.3", + "2023.2.4", + "2023.2.5", )) verifierVersion.set("1.307") } From 0c1c56bbff3a3710f30aa774899b145962a2946f Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Wed, 6 Dec 2023 23:08:18 +0400 Subject: [PATCH 04/57] feat: IDEA 2023.3 --- build.gradle.kts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cc47762..a373b76 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,12 +23,12 @@ dependencies { // See https://github.com/JetBrains/gradle-intellij-plugin/ intellij { - version.set("2023.1.5") + version.set("2023.3") plugins.set(listOf("yaml")) } tasks.getByName("patchPluginXml") { sinceBuild.set("223") - untilBuild.set("232.*") + untilBuild.set("233.*") changeNotes.set("""

Fixed issue with svg icon rendering, which was blocking showing of context menu with new files (right click, new)

""".trimIndent()) @@ -52,6 +52,7 @@ tasks.getByName("runPluginVe "2023.2.3", "2023.2.4", "2023.2.5", + "2023.3", )) verifierVersion.set("1.307") } From b37e20d3604f8f846790cf542debf7c09d7594b7 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Thu, 7 Dec 2023 01:27:09 +0400 Subject: [PATCH 05/57] feat: AsyncAPI 3.0.0 JsonSchema --- src/main/resources/schema/asyncapi-3.0.0.json | 8299 +++++++++++++++++ 1 file changed, 8299 insertions(+) create mode 100644 src/main/resources/schema/asyncapi-3.0.0.json diff --git a/src/main/resources/schema/asyncapi-3.0.0.json b/src/main/resources/schema/asyncapi-3.0.0.json new file mode 100644 index 0000000..5e45fc9 --- /dev/null +++ b/src/main/resources/schema/asyncapi-3.0.0.json @@ -0,0 +1,8299 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 3.0.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "const": "3.0.0", + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "#/definitions/info" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "defaultContentType": { + "type": "string", + "description": "Default content type to use when encoding/decoding a message's payload." + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "operations": { + "$ref": "#/definitions/operations" + }, + "components": { + "$ref": "#/definitions/components" + } + }, + "definitions": { + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "info": { + "type": "object", + "description": "The object provides metadata about the API. The metadata can be used by the clients if needed.", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "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. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "license": { + "$ref": "#/definitions/license" + }, + "tags": { + "type": "array", + "description": "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + } + }, + "examples": [ + { + "title": "AsyncAPI Sample App", + "version": "1.0.1", + "description": "This is a sample app.", + "termsOfService": "https://asyncapi.org/terms/", + "contact": { + "name": "API Support", + "url": "https://www.asyncapi.org/support", + "email": "support@asyncapi.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + } + ] + }, + "contact": { + "type": "object", + "description": "Contact information for the exposed 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-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + } + ] + }, + "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-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + "Reference": { + "type": "object", + "description": "A simple object to allow referencing other components in the specification, internally and externally.", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "description": "The reference string.", + "$ref": "#/definitions/ReferenceObject" + } + }, + "examples": [ + { + "$ref": "#/components/schemas/Pet" + } + ] + }, + "ReferenceObject": { + "type": "string", + "format": "uri-reference" + }, + "tag": { + "type": "object", + "description": "Allows adding metadata to a single tag.", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the tag." + }, + "description": { + "type": "string", + "description": "A short description for the tag. CommonMark syntax can be used for rich text representation." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "name": "user", + "description": "User-related messages" + } + ] + }, + "externalDocs": { + "type": "object", + "additionalProperties": false, + "description": "Allows referencing an external resource for extended documentation.", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string", + "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation." + }, + "url": { + "type": "string", + "description": "The URL for the target documentation. This MUST be in the form of an absolute URL.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "description": "Find more info here", + "url": "https://example.com" + } + ] + }, + "servers": { + "description": "An object representing multiple servers.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + }, + "examples": [ + { + "development": { + "host": "localhost:5672", + "description": "Development AMQP broker.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:development", + "description": "This environment is meant for developers to run their own tests." + } + ] + }, + "staging": { + "host": "rabbitmq-staging.in.mycompany.com:5672", + "description": "RabbitMQ broker for the staging environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:staging", + "description": "This environment is a replica of the production environment." + } + ] + }, + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "description": "RabbitMQ broker for the production environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:production", + "description": "This environment is the live environment available for final users." + } + ] + } + } + ] + }, + "server": { + "type": "object", + "description": "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", + "required": [ + "host", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "host": { + "type": "string", + "description": "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + "pathname": { + "type": "string", + "description": "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the server." + }, + "summary": { + "type": "string", + "description": "A brief summary of the server." + }, + "description": { + "type": "string", + "description": "A longer description of the server. CommonMark is allowed." + }, + "protocol": { + "type": "string", + "description": "The protocol this server supports for connection." + }, + "protocolVersion": { + "type": "string", + "description": "An optional string describing the server. CommonMark syntax MAY be used for rich text representation." + }, + "variables": { + "$ref": "#/definitions/serverVariables" + }, + "security": { + "$ref": "#/definitions/securityRequirements" + }, + "tags": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverBindingsObject" + } + ] + } + }, + "examples": [ + { + "host": "kafka.in.mycompany.com:9092", + "description": "Production Kafka broker.", + "protocol": "kafka", + "protocolVersion": "3.2" + }, + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "description": "Production RabbitMQ broker (uses the `production` vhost)." + } + ] + }, + "serverVariables": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverVariable" + } + ] + } + }, + "serverVariable": { + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "enum": { + "type": "array", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + "description": { + "type": "string", + "description": "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation." + }, + "examples": { + "type": "array", + "description": "An array of examples of the server variable.", + "items": { + "type": "string" + } + } + }, + "examples": [ + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/{env}", + "protocol": "amqp", + "description": "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + "variables": { + "env": { + "description": "Environment to connect to. It can be either `production` or `staging`.", + "enum": [ + "production", + "staging" + ] + } + } + } + ] + }, + "securityRequirements": { + "description": "An array representing security requirements.", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + }, + "SecurityScheme": { + "description": "Defines a security scheme that can be used by the operations.", + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + }, + { + "$ref": "#/definitions/SaslSecurityScheme" + } + ], + "examples": [ + { + "type": "userPassword" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "userPassword" + } + ] + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "description": " The location of the API key.", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "apiKey", + "in": "user" + } + ] + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "X509" + } + ] + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "symmetricEncryption" + } + ] + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "description": "A short description for security scheme.", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + }, + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string", + "description": "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes." + }, + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "http" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string", + "description": "The name of the header, query or cookie parameter to be used." + }, + "in": { + "type": "string", + "description": "The location of the API key", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "httpApiKey", + "name": "api_key", + "in": "header" + } + ] + }, + "oauth2Flows": { + "type": "object", + "description": "Allows configuration of the supported OAuth Flows.", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "description": "Configuration for the OAuth Implicit flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "description": "Configuration for the OAuth Client Credentials flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "description": "Configuration for the OAuth Authorization Code flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "availableScopes" + ] + } + ] + } + }, + "additionalProperties": false + }, + "scopes": { + "type": "array", + "description": "List of the needed scope names.", + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "type": "object", + "description": "Configuration details for a supported OAuth Flow", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri", + "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + "tokenUrl": { + "type": "string", + "format": "uri", + "description": "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + "refreshUrl": { + "type": "string", + "format": "uri", + "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + "availableScopes": { + "$ref": "#/definitions/oauth2Scopes", + "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "tokenUrl": "https://example.com/api/oauth/token", + "availableScopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri", + "description": "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL." + }, + "scopes": { + "type": "array", + "description": "List of the needed scope names. An empty array means no scopes are needed.", + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/SaslPlainSecurityScheme" + }, + { + "$ref": "#/definitions/SaslScramSecurityScheme" + }, + { + "$ref": "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + "SaslPlainSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme. Valid values", + "enum": [ + "plain" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "SaslScramSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "scramSha256", + "scramSha512" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "SaslGssapiSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "gssapi" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "serverBindingsObject": { + "type": "object", + "description": "Map describing protocol-specific definitions for a server.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-server" + } + } + ] + }, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-server" + } + } + ] + }, + "anypointmq": {}, + "nats": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + } + } + ] + }, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-server" + } + } + ] + }, + "solace": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0", + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.3.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.3.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.2.0-server" + } + } + ] + }, + "googlepubsub": {}, + "pulsar": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-server" + } + } + ] + } + } + }, + "bindings-mqtt-0.2.0-server": { + "title": "Server Schema", + "description": "This object contains information about the server representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "clientId": { + "type": "string", + "description": "The client identifier." + }, + "cleanSession": { + "type": "boolean", + "description": "Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5." + }, + "lastWill": { + "type": "object", + "description": "Last Will and Testament configuration.", + "properties": { + "topic": { + "type": "string", + "description": "The topic where the Last Will and Testament message will be sent." + }, + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + "message": { + "type": "string", + "description": "Last Will message." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + "keepAlive": { + "type": "integer", + "description": "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + "sessionExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires." + }, + "maximumPacketSize": { + "oneOf": [ + { + "type": "integer", + "minimum": 1, + "maximum": 4294967295 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false + }, + "keepAlive": 60, + "sessionExpiryInterval": 120, + "maximumPacketSize": 1024, + "bindingVersion": "0.2.0" + } + ] + }, + "schema": { + "description": "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "discriminator": { + "type": "string", + "description": "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "deprecated": { + "type": "boolean", + "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + "default": false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "bindings-kafka-0.4.0-server": { + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-server": { + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-jms-0.0.1-server": { + "title": "Server Schema", + "description": "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "jmsConnectionFactory" + ], + "properties": { + "jmsConnectionFactory": { + "type": "string", + "description": "The classname of the ConnectionFactory implementation for the JMS Provider." + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + }, + "description": "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." + }, + "clientID": { + "type": "string", + "description": "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "definitions": { + "property": { + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of a property" + }, + "value": { + "type": [ + "string", + "boolean", + "number", + "null" + ], + "description": "The name of a property" + } + } + } + }, + "examples": [ + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "properties": [ + { + "name": "disableTimeStampsByDefault", + "value": false + } + ], + "clientID": "my-application-1", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-ibmmq-0.1.0-server": { + "title": "IBM MQ server bindings object", + "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "type": "string", + "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + "ccdtQueueManagerName": { + "type": "string", + "default": "*", + "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + "cipherSpec": { + "type": "string", + "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + "multiEndpointServer": { + "type": "boolean", + "default": false, + "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + "heartBeatInterval": { + "type": "integer", + "minimum": 0, + "maximum": 999999, + "default": 300, + "description": "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "groupId": "PRODCLSTR1", + "cipherSpec": "ANY_TLS12_OR_HIGHER", + "bindingVersion": "0.1.0" + }, + { + "groupId": "PRODCLSTR1", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-solace-0.3.0-server": { + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "msgVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-solace-0.2.0-server": { + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "msvVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-pulsar-0.1.0-server": { + "title": "Server Schema", + "description": "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "tenant": { + "type": "string", + "description": "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "tenant": "contoso", + "bindingVersion": "0.1.0" + } + ] + }, + "channels": { + "type": "object", + "description": "An object containing all the Channel Object definitions the Application MUST use during runtime.", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channel" + } + ] + }, + "examples": [ + { + "userSignedUp": { + "address": "user.signedup", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "channel": { + "type": "object", + "description": "Describes a shared communication channel.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "address": { + "type": [ + "string", + "null" + ], + "description": "An optional string representation of this channel's address. The address is typically the \"topic name\", \"routing key\", \"event type\", or \"path\". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions." + }, + "messages": { + "$ref": "#/definitions/channelMessages" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "title": { + "type": "string", + "description": "A human-friendly title for the channel." + }, + "summary": { + "type": "string", + "description": "A brief summary of the channel." + }, + "description": { + "type": "string", + "description": "A longer description of the channel. CommonMark is allowed." + }, + "servers": { + "type": "array", + "description": "The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + "items": { + "$ref": "#/definitions/Reference" + }, + "uniqueItems": true + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping of channels.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channelBindingsObject" + } + ] + } + }, + "examples": [ + { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/rabbitmqInProd" + }, + { + "$ref": "#/servers/rabbitmqInStaging" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + } + ] + }, + "channelMessages": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageObject" + } + ] + }, + "description": "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**" + }, + "messageObject": { + "type": "object", + "description": "Describes a message received on a given channel and operation.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "contentType": { + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + "headers": { + "$ref": "#/definitions/anySchema" + }, + "payload": { + "$ref": "#/definitions/anySchema" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "description": "List of examples.", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object", + "description": "Example of the application headers. It can be of any type." + }, + "payload": { + "description": "Example of the message payload. It can be of any type." + } + } + } + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] + }, + "traits": { + "type": "array", + "description": "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + }, + { + "type": "array", + "items": [ + { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + }, + { + "type": "object", + "additionalItems": true + } + ] + } + ] + } + } + }, + "examples": [ + { + "messageId": "userSignup", + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + } + ] + }, + "anySchema": { + "if": { + "required": [ + "schema" + ] + }, + "then": { + "$ref": "#/definitions/multiFormatSchema" + }, + "else": { + "$ref": "#/definitions/schema" + }, + "description": "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise." + }, + "multiFormatSchema": { + "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + "if": { + "not": { + "type": "object" + } + }, + "then": { + "$ref": "#/definitions/schema" + }, + "else": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", + "anyOf": [ + { + "type": "string" + }, + { + "description": "All the schema formats tooling MUST support", + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + }, + { + "description": "All the schema formats tools are RECOMMENDED to support", + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0", + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/raml+yaml;version=1.0" + ] + } + ] + }, + "schema": { + "description": "Definition of the message payload. It can be of any type but defaults to Schema Object. It MUST match the schema format defined in schemaFormat, including the encoding type. E.g., Avro should be inlined as either a YAML or JSON object instead of as a string to be parsed as YAML or JSON. Non-JSON-based schemas (e.g., Protobuf or XSD) MUST be inlined as a string." + } + }, + "allOf": [ + { + "if": { + "not": { + "description": "If no schemaFormat has been defined, default to schema or reference", + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/schema" + } + ] + } + } + } + }, + { + "if": { + "description": "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/schema" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/openapiSchema_3_0" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/avroSchema_v1" + } + ] + } + } + } + } + ] + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "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 + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "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": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "correlationId": { + "type": "object", + "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "examples": [ + { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + ] + }, + "messageBindingsObject": { + "type": "object", + "description": "Map describing protocol-specific definitions for a message.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "http": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.2.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.2.0-message" + } + } + ] + }, + "ws": {}, + "amqp": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-message" + } + } + ] + }, + "amqp1": {}, + "mqtt": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-message" + } + } + ] + }, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-message" + } + } + ] + }, + "anypointmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-message" + } + } + ] + }, + "nats": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-message" + } + } + ] + }, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-message" + } + } + ] + }, + "solace": {}, + "googlepubsub": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-message" + } + } + ] + } + } + }, + "bindings-http-0.2.0-message": { + "title": "HTTP message bindings object", + "description": "This object contains information about the message representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "$ref": "#/definitions/schema", + "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-amqp-0.3.0-message": { + "title": "AMQP message bindings object", + "description": "This object contains information about the message representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "contentEncoding": { + "type": "string", + "description": "A MIME encoding for the message content." + }, + "messageType": { + "type": "string", + "description": "Application-specific message type." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-message": { + "title": "MQTT message bindings object", + "description": "This object contains information about the message representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "payloadFormatIndicator": { + "type": "integer", + "enum": [ + 0, + 1 + ], + "description": "1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.", + "default": 0 + }, + "correlationData": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received." + }, + "contentType": { + "type": "string", + "description": "String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object." + }, + "responseTopic": { + "oneOf": [ + { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "The topic (channel URI) to be used for a response message." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.2.0" + }, + { + "contentType": "application/json", + "correlationData": { + "type": "string", + "format": "uuid" + }, + "responseTopic": "application/responses", + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-kafka-0.4.0-message": { + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "key": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/schema" + } + ], + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.4.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-message": { + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "key": { + "$ref": "#/definitions/schema", + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.3.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-anypointmq-0.0.1-message": { + "title": "Anypoint MQ message bindings object", + "description": "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "messageId": { + "type": "string" + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-jms-0.0.1-message": { + "title": "Message Schema", + "description": "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "$ref": "#/definitions/schema", + "description": "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "required": [ + "JMSMessageID" + ], + "properties": { + "JMSMessageID": { + "type": [ + "string", + "null" + ], + "description": "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + "JMSTimestamp": { + "type": "integer", + "description": "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + "JMSDeliveryMode": { + "type": "string", + "enum": [ + "PERSISTENT", + "NON_PERSISTENT" + ], + "default": "PERSISTENT", + "description": "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + "JMSPriority": { + "type": "integer", + "default": 4, + "description": "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + "JMSExpires": { + "type": "integer", + "description": "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + "JMSType": { + "type": [ + "string", + "null" + ], + "description": "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + "JMSCorrelationID": { + "type": [ + "string", + "null" + ], + "description": "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + "JMSReplyTo": { + "type": "string", + "description": "The queue or topic that the message sender expects replies to." + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-ibmmq-0.1.0-message": { + "title": "IBM MQ message bindings object", + "description": "This object contains information about the message representation in IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "jms", + "binary" + ], + "default": "string", + "description": "The type of the message." + }, + "headers": { + "type": "string", + "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + "description": { + "type": "string", + "description": "Provides additional information for application developers: describes the message type or format." + }, + "expiry": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "binary" + } + } + }, + { + "properties": { + "type": { + "const": "jms" + } + }, + "not": { + "required": [ + "headers" + ] + } + }, + { + "properties": { + "type": { + "const": "string" + } + }, + "not": { + "required": [ + "headers" + ] + } + } + ], + "examples": [ + { + "type": "string", + "bindingVersion": "0.1.0" + }, + { + "type": "jms", + "description": "JMS stream message", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-googlepubsub-0.2.0-message": { + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the message representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + }, + "attributes": { + "type": "object" + }, + "orderingKey": { + "type": "string" + }, + "schema": { + "type": "object", + "additionalItems": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "examples": [ + { + "schema": { + "name": "projects/your-project-id/schemas/your-avro-schema-id" + } + }, + { + "schema": { + "name": "projects/your-project-id/schemas/your-protobuf-schema-id" + } + } + ] + }, + "messageTrait": { + "type": "object", + "description": "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "contentType": { + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + "headers": { + "$ref": "#/definitions/anySchema" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "description": "List of examples.", + "items": { + "type": "object" + } + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] + } + }, + "examples": [ + { + "contentType": "application/json" + } + ] + }, + "parameters": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "description": "JSON objects describing re-usable channel parameters.", + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user." + } + } + } + ] + }, + "parameter": { + "description": "Describes a parameter included in a channel address.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "enum": { + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied.", + "type": "string" + }, + "examples": { + "description": "An array of examples of the parameter value.", + "type": "array", + "items": { + "type": "string" + } + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user.", + "location": "$message.payload#/user/id" + } + } + } + ] + }, + "channelBindingsObject": { + "type": "object", + "description": "Map describing protocol-specific definitions for a channel.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "http": {}, + "ws": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-websockets-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-websockets-0.1.0-channel" + } + } + ] + }, + "amqp": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-channel" + } + } + ] + }, + "amqp1": {}, + "mqtt": {}, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-channel" + } + } + ] + }, + "anypointmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-channel" + } + } + ] + }, + "nats": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-channel" + } + } + ] + }, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + } + ] + }, + "sqs": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + } + ] + }, + "stomp": {}, + "redis": {}, + "ibmmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-channel" + } + } + ] + }, + "solace": {}, + "googlepubsub": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + } + ] + }, + "pulsar": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-channel" + } + } + ] + } + } + }, + "bindings-websockets-0.1.0-channel": { + "title": "WebSockets channel bindings object", + "description": "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + "query": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + "headers": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "method": "POST", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-amqp-0.3.0-channel": { + "title": "AMQP channel bindings object", + "description": "This object contains information about the channel representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "is": { + "type": "string", + "enum": [ + "queue", + "routingKey" + ], + "description": "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + "exchange": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + "type": { + "type": "string", + "enum": [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + "description": "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + "durable": { + "type": "boolean", + "description": "Whether the exchange should survive broker restarts or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the exchange should be deleted when the last queue is unbound from it." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the exchange. Defaults to '/'." + } + }, + "description": "When is=routingKey, this object defines the exchange properties." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the queue. It MUST NOT exceed 255 characters long." + }, + "durable": { + "type": "boolean", + "description": "Whether the queue should survive broker restarts or not." + }, + "exclusive": { + "type": "boolean", + "description": "Whether the queue should be used only by one connection or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the queue should be deleted when the last consumer unsubscribes." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the queue. Defaults to '/'." + } + }, + "description": "When is=queue, this object defines the queue properties." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "oneOf": [ + { + "properties": { + "is": { + "const": "routingKey" + } + }, + "required": [ + "exchange" + ], + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "is": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "exchange" + ] + } + } + ], + "examples": [ + { + "is": "routingKey", + "exchange": { + "name": "myExchange", + "type": "topic", + "durable": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-kafka-0.4.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "topicConfiguration": { + "description": "Topic configuration properties that are relevant for the API.", + "type": "object", + "additionalProperties": false, + "properties": { + "cleanup.policy": { + "description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + "description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + "type": "integer", + "minimum": -1 + }, + "retention.bytes": { + "description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + "type": "integer", + "minimum": -1 + }, + "delete.retention.ms": { + "description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + "type": "integer", + "minimum": 0 + }, + "max.message.bytes": { + "description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + "type": "integer", + "minimum": 0 + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-anypointmq-0.0.1-channel": { + "title": "Anypoint MQ channel bindings object", + "description": "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "exchange", + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signup-exchg", + "destinationType": "exchange", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-jms-0.0.1-channel": { + "title": "Channel Schema", + "description": "This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signed-up", + "destinationType": "fifo-queue", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-sns-0.1.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + "ordering": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + }, + "policy": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the topic." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "name" + ], + "definitions": { + "ordering": { + "type": "object", + "description": "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "type": { + "type": "string", + "description": "Defines the type of SNS Topic.", + "enum": [ + "standard", + "FIFO" + ] + }, + "contentBasedDeduplication": { + "type": "boolean", + "description": "True to turn on de-duplication of messages for a channel." + } + }, + "required": [ + "type" + ] + }, + "policy": { + "type": "object", + "description": "The security policy for the SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this topic", + "items": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SNS permission being allowed or denied e.g. sns:Publish", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "name": "my-sns-topic", + "policy": { + "statements": [ + { + "effect": "Allow", + "principal": "*", + "action": "SNS:Publish" + } + ] + } + } + ] + }, + "bindings-sqs-0.2.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queue": { + "description": "A definition of the queue that will be used as the channel.", + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "deadLetterQueue": { + "description": "A definition of the queue that will be used for un-processable messages.", + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queue" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "policy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name", + "fifoQueue" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queue": { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 15, + "visibilityTimeout": 60, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 86400, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + "tags": { + "owner": "AsyncAPI.NET", + "platform": "AsyncAPIOrg" + } + }, + "deadLetterQueue": { + "name": "myQueue_error", + "deliveryDelay": 0, + "visibilityTimeout": 0, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 604800 + } + } + ] + }, + "bindings-ibmmq-0.1.0-channel": { + "title": "IBM MQ channel bindings object", + "description": "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "destinationType": { + "type": "string", + "enum": [ + "topic", + "queue" + ], + "default": "topic", + "description": "Defines the type of AsyncAPI channel." + }, + "queue": { + "type": "object", + "description": "Defines the properties of a queue.", + "properties": { + "objectName": { + "type": "string", + "maxLength": 48, + "description": "Defines the name of the IBM MQ queue associated with the channel." + }, + "isPartitioned": { + "type": "boolean", + "default": false, + "description": "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + "exclusive": { + "type": "boolean", + "default": false, + "description": "Specifies if it is recommended to open the queue exclusively." + } + }, + "required": [ + "objectName" + ] + }, + "topic": { + "type": "object", + "description": "Defines the properties of a topic.", + "properties": { + "string": { + "type": "string", + "maxLength": 10240, + "description": "The value of the IBM MQ topic string to be used." + }, + "objectName": { + "type": "string", + "maxLength": 48, + "description": "The name of the IBM MQ topic object." + }, + "durablePermitted": { + "type": "boolean", + "default": true, + "description": "Defines if the subscription may be durable." + }, + "lastMsgRetained": { + "type": "boolean", + "default": false, + "description": "Defines if the last message published will be made available to new subscriptions." + } + } + }, + "maxMsgLength": { + "type": "integer", + "minimum": 0, + "maximum": 104857600, + "description": "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "const": "topic" + } + }, + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "destinationType": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "topic" + ] + } + } + ], + "examples": [ + { + "destinationType": "topic", + "topic": { + "objectName": "myTopicName" + }, + "bindingVersion": "0.1.0" + }, + { + "destinationType": "queue", + "queue": { + "objectName": "myQueueName", + "exclusive": true + }, + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-googlepubsub-0.2.0-channel": { + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the channel representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + }, + "labels": { + "type": "object" + }, + "messageRetentionDuration": { + "type": "string" + }, + "messageStoragePolicy": { + "type": "object", + "additionalProperties": false, + "properties": { + "allowedPersistenceRegions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "schemaSettings": { + "type": "object", + "additionalItems": false, + "properties": { + "encoding": { + "type": "string" + }, + "firstRevisionId": { + "type": "string" + }, + "lastRevisionId": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "encoding", + "name" + ] + } + }, + "required": [ + "schemaSettings" + ], + "examples": [ + { + "labels": { + "label1": "value1", + "label2": "value2" + }, + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-east1" + ] + }, + "schemaSettings": { + "encoding": "json", + "name": "projects/your-project-id/schemas/your-schema" + } + } + ] + }, + "bindings-pulsar-0.1.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "namespace", + "persistence" + ], + "properties": { + "namespace": { + "type": "string", + "description": "The namespace, the channel is associated with." + }, + "persistence": { + "type": "string", + "enum": [ + "persistent", + "non-persistent" + ], + "description": "persistence of the topic in Pulsar." + }, + "compaction": { + "type": "integer", + "minimum": 0, + "description": "Topic compaction threshold given in MB" + }, + "geo-replication": { + "type": "array", + "description": "A list of clusters the topic is replicated to.", + "items": { + "type": "string" + } + }, + "retention": { + "type": "object", + "additionalProperties": false, + "properties": { + "time": { + "type": "integer", + "minimum": 0, + "description": "Time given in Minutes. `0` = Disable message retention." + }, + "size": { + "type": "integer", + "minimum": 0, + "description": "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + "ttl": { + "type": "integer", + "description": "TTL in seconds for the specified topic" + }, + "deduplication": { + "type": "boolean", + "description": "Whether deduplication of events is enabled or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "namespace": "ns1", + "persistence": "persistent", + "compaction": 1000, + "retention": { + "time": 15, + "size": 1000 + }, + "ttl": 360, + "geo-replication": [ + "us-west", + "us-east" + ], + "deduplication": true, + "bindingVersion": "0.1.0" + } + ] + }, + "operations": { + "type": "object", + "description": "Holds a dictionary with all the operations this application MUST implement.", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operation" + } + ] + }, + "examples": [ + { + "onUserSignUp": { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ] + } + } + ] + }, + "operation": { + "type": "object", + "description": "Describes a specific operation.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "action", + "channel" + ], + "properties": { + "action": { + "type": "string", + "description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + "enum": [ + "send", + "receive" + ] + }, + "channel": { + "$ref": "#/definitions/Reference" + }, + "messages": { + "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + "items": { + "$ref": "#/definitions/Reference" + } + }, + "reply": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReply" + } + ] + }, + "traits": { + "type": "array", + "description": "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + }, + "title": { + "type": "string", + "description": "A human-friendly title for the operation." + }, + "summary": { + "type": "string", + "description": "A brief summary of the operation." + }, + "description": { + "type": "string", + "description": "A longer description of the operation. CommonMark is allowed." + }, + "security": { + "$ref": "#/definitions/securityRequirements" + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping and categorization of operations.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + } + }, + "examples": [ + { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ], + "messages": [ + { + "$ref": "/components/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "/components/messages/userSignedUpReply" + } + ] + } + } + ] + }, + "operationReply": { + "type": "object", + "description": "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "address": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReplyAddress" + } + ] + }, + "channel": { + "$ref": "#/definitions/Reference" + }, + "messages": { + "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + "items": { + "$ref": "#/definitions/Reference" + } + } + } + }, + "operationReplyAddress": { + "type": "object", + "description": "An object that specifies where an operation has to send the reply", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "location" + ], + "properties": { + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the reply address.", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "description": { + "type": "string", + "description": "An optional description of the address. CommonMark is allowed." + } + }, + "examples": [ + { + "description": "Consumer inbox", + "location": "$message.header#/replyTo" + } + ] + }, + "operationTrait": { + "type": "object", + "description": "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "description": "A human-friendly title for the operation.", + "$ref": "#/definitions/operation/properties/title" + }, + "summary": { + "description": "A short summary of what the operation is about.", + "$ref": "#/definitions/operation/properties/summary" + }, + "description": { + "description": "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", + "$ref": "#/definitions/operation/properties/description" + }, + "security": { + "description": "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", + "$ref": "#/definitions/operation/properties/security" + }, + "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", + "$ref": "#/definitions/operation/properties/tags" + }, + "externalDocs": { + "description": "Additional external documentation for this operation.", + "$ref": "#/definitions/operation/properties/externalDocs" + }, + "bindings": { + "description": "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + } + }, + "examples": [ + { + "bindings": { + "amqp": { + "ack": false + } + } + } + ] + }, + "operationBindingsObject": { + "type": "object", + "description": "Map describing protocol-specific definitions for an operation.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "http": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.2.0-operation" + } + } + ] + }, + "ws": {}, + "amqp": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-operation" + } + } + ] + }, + "amqp1": {}, + "mqtt": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-operation" + } + } + ] + }, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-operation" + } + } + ] + }, + "anypointmq": {}, + "nats": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-nats-0.1.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-nats-0.1.0-operation" + } + } + ] + }, + "jms": {}, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + } + } + ] + }, + "sqs": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + } + ] + }, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0", + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.3.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.3.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.2.0-operation" + } + } + ] + }, + "googlepubsub": {} + } + }, + "bindings-http-0.2.0-operation": { + "title": "HTTP operation bindings object", + "description": "This object contains information about the operation representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + "query": { + "$ref": "#/definitions/schema", + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + }, + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-amqp-0.3.0-operation": { + "title": "AMQP operation bindings object", + "description": "This object contains information about the operation representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "expiration": { + "type": "integer", + "minimum": 0, + "description": "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + "userId": { + "type": "string", + "description": "Identifies the user who has sent the message." + }, + "cc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The routing keys the message should be routed to at the time of publishing." + }, + "priority": { + "type": "integer", + "description": "A priority for the message." + }, + "deliveryMode": { + "type": "integer", + "enum": [ + 1, + 2 + ], + "description": "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + "mandatory": { + "type": "boolean", + "description": "Whether the message is mandatory or not." + }, + "bcc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Like cc but consumers will not receive this information." + }, + "timestamp": { + "type": "boolean", + "description": "Whether the message should include a timestamp or not." + }, + "ack": { + "type": "boolean", + "description": "Whether the consumer should ack the message or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "expiration": 100000, + "userId": "guest", + "cc": [ + "user.logs" + ], + "priority": 10, + "deliveryMode": 2, + "mandatory": false, + "bcc": [ + "external.audit" + ], + "timestamp": true, + "ack": false, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-operation": { + "title": "MQTT operation bindings object", + "description": "This object contains information about the operation representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the message or not." + }, + "messageExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Lifetime of the message in seconds" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "qos": 2, + "retain": true, + "messageExpiryInterval": 60, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-kafka-0.4.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-nats-0.1.0-operation": { + "title": "NATS operation bindings object", + "description": "This object contains information about the operation representation in NATS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queue": { + "type": "string", + "description": "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + "maxLength": 255 + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "queue": "MyCustomQueue", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-sns-0.1.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "description": "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + "consumers": { + "type": "array", + "description": "The protocols that listen to this topic and their endpoints.", + "items": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + }, + "minItems": 1 + }, + "deliveryPolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "description": "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "consumers" + ], + "definitions": { + "identifier": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string", + "description": "The endpoint is a URL." + }, + "email": { + "type": "string", + "description": "The endpoint is an email address." + }, + "phone": { + "type": "string", + "description": "The endpoint is a phone number." + }, + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + "consumer": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "protocol": { + "description": "The protocol that this endpoint receives messages by.", + "type": "string", + "enum": [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + "endpoint": { + "description": "The endpoint messages are delivered to.", + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + }, + "filterPolicy": { + "type": "object", + "description": "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + } + }, + "filterPolicyScope": { + "type": "string", + "description": "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + "enum": [ + "MessageAttributes", + "MessageBody" + ], + "default": "MessageAttributes" + }, + "rawMessageDelivery": { + "type": "boolean", + "description": "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + }, + "deliveryPolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "description": "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + "displayName": { + "type": "string", + "description": "The display name to use with an SNS subscription" + } + }, + "required": [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + "deliveryPolicy": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "minDelayTarget": { + "type": "integer", + "description": "The minimum delay for a retry in seconds." + }, + "maxDelayTarget": { + "type": "integer", + "description": "The maximum delay for a retry in seconds." + }, + "numRetries": { + "type": "integer", + "description": "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + "numNoDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with no delay)." + }, + "numMinDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with delay)." + }, + "numMaxDelayRetries": { + "type": "integer", + "description": "The number of post-backoff phase retries, with the maximum delay between retries." + }, + "backoffFunction": { + "type": "string", + "description": "The algorithm for backoff between retries.", + "enum": [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + "maxReceivesPerSecond": { + "type": "integer", + "description": "The maximum number of deliveries per second, per subscription." + } + } + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "description": "The SQS queue to use as a dead letter queue (DLQ)." + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + } + }, + "examples": [ + { + "topic": { + "name": "someTopic" + }, + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicy": { + "store": [ + "asyncapi_corp" + ], + "event": [ + { + "anything-but": "order_cancelled" + } + ], + "customer_interests": [ + "rugby", + "football", + "baseball" + ] + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 25 + }, + "deliveryPolicy": { + "minDelayTarget": 10, + "maxDelayTarget": 100, + "numRetries": 5, + "numNoDelayRetries": 2, + "numMinDelayRetries": 3, + "numMaxDelayRetries": 5, + "backoffFunction": "linear", + "maxReceivesPerSecond": 2 + } + } + ] + } + ] + }, + "bindings-sqs-0.2.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queues": { + "type": "array", + "description": "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queues" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "type": "string", + "description": "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + }, + "policy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queues": [ + { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 10, + "redrivePolicy": { + "deadLetterQueue": { + "name": "myQueue_error" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ] + } + ] + }, + "bindings-solace-0.3.0-operation": { + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + }, + "maxTtl": { + "type": "string", + "description": "The maximum TTL to apply to messages to be spooled." + }, + "maxMsgSpoolUsage": { + "type": "string", + "description": "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + }, + "examples": [ + { + "bindingVersion": "0.3.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-solace-0.2.0-operation": { + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + }, + "examples": [ + { + "bindingVersion": "0.2.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "components": { + "type": "object", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemas": { + "type": "object", + "description": "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/anySchema" + } + ] + } + } + }, + "servers": { + "type": "object", + "description": "An object to hold reusable Server Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + } + } + }, + "channels": { + "type": "object", + "description": "An object to hold reusable Channel Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channel" + } + ] + } + } + }, + "serverVariables": { + "type": "object", + "description": "An object to hold reusable Server Variable Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverVariable" + } + ] + } + } + }, + "operations": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operation" + } + ] + } + } + }, + "messages": { + "type": "object", + "description": "An object to hold reusable Message Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageObject" + } + ] + } + } + }, + "securitySchemes": { + "type": "object", + "description": "An object to hold reusable Security Scheme Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "parameters": { + "type": "object", + "description": "An object to hold reusable Parameter Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + } + } + }, + "correlationIds": { + "type": "object", + "description": "An object to hold reusable Correlation ID Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "description": "An object to hold reusable Operation Trait Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + } + }, + "messageTraits": { + "type": "object", + "description": "An object to hold reusable Message Trait Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "replies": { + "type": "object", + "description": "An object to hold reusable Operation Reply Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReply" + } + ] + } + } + }, + "replyAddresses": { + "type": "object", + "description": "An object to hold reusable Operation Reply Address Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReplyAddress" + } + ] + } + } + }, + "serverBindings": { + "type": "object", + "description": "An object to hold reusable Server Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverBindingsObject" + } + ] + } + } + }, + "channelBindings": { + "type": "object", + "description": "An object to hold reusable Channel Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channelBindingsObject" + } + ] + } + } + }, + "operationBindings": { + "type": "object", + "description": "An object to hold reusable Operation Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + } + } + }, + "messageBindings": { + "type": "object", + "description": "An object to hold reusable Message Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] + } + } + }, + "tags": { + "type": "object", + "description": "An object to hold reusable Tag Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + } + } + }, + "externalDocs": { + "type": "object", + "description": "An object to hold reusable External Documentation Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + } + } + } + }, + "examples": [ + { + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "$ref": "path/to/user-create.avsc#/UserCreate" + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com:{port}", + "description": "RabbitMQ broker", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + }, + "port": { + "$ref": "#/components/serverVariables/port" + } + } + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider, in this example `mycompany.com`" + }, + "port": { + "enum": [ + "5671", + "5672" + ], + "default": "5672" + } + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "description": "Multiline description of what this action does.\nHere you have another line.\n", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + } + ], + "headers": { + "type": "object", + "properties": { + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + } + } + } + ] + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file From affd9e4842955ec7eb5dc91cfd911ea16c515b6e Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Thu, 7 Dec 2023 01:51:32 +0400 Subject: [PATCH 06/57] feat: create AsyncAPI 3.0.0 specification from template --- .../actions/CreateAsyncAPISpecification.kt | 2 + .../internal/AsyncAPI schema 3 (json).json.ft | 46 +++++++++++++++++++ .../internal/AsyncAPI schema 3 (yaml).yaml.ft | 29 ++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (json).json.ft create mode 100644 src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (yaml).yaml.ft diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/actions/CreateAsyncAPISpecification.kt b/src/main/kotlin/com/asyncapi/plugin/idea/actions/CreateAsyncAPISpecification.kt index ac61c1a..a102166 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/actions/CreateAsyncAPISpecification.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/actions/CreateAsyncAPISpecification.kt @@ -21,6 +21,8 @@ class CreateAsyncAPISpecification: CreateFileFromTemplateAction( .setTitle("New API Specification") .addKind("AsyncAPI 2 (.yaml)", Icons.ASYNCAPI_ICON, "AsyncAPI schema (yaml).yaml") .addKind("AsyncAPI 2 (.json)", Icons.ASYNCAPI_ICON, "AsyncAPI schema (json).json") + .addKind("AsyncAPI 3 (.yaml)", Icons.ASYNCAPI_ICON, "AsyncAPI schema 3 (yaml).yaml") + .addKind("AsyncAPI 3 (.json)", Icons.ASYNCAPI_ICON, "AsyncAPI schema 3 (json).json") } override fun getActionName(directory: PsiDirectory?, newName: String, templateName: String?): String { diff --git a/src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (json).json.ft b/src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (json).json.ft new file mode 100644 index 0000000..5598801 --- /dev/null +++ b/src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (json).json.ft @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "\$ref": "#/components/messages/UserSignedUp" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "\$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (yaml).yaml.ft b/src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (yaml).yaml.ft new file mode 100644 index 0000000..3d34f69 --- /dev/null +++ b/src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (yaml).yaml.ft @@ -0,0 +1,29 @@ +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + \$ref: "#/components/messages/UserSignedUp" +operations: + processUserSignups: + action: "receive" + channel: + \$ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file From f1b63360ad86f4348088c2f9a1579fcf5eb91099 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Fri, 8 Dec 2023 23:12:47 +0400 Subject: [PATCH 07/57] fix: validation tests - channels case In 2023.3 internal format for linter error was changed --- .../testData/json/inspection/2.0.0/without channels.json | 6 +++--- .../testData/json/inspection/2.1.0/without channels.json | 6 +++--- .../testData/json/inspection/2.2.0/without channels.json | 6 +++--- .../testData/json/inspection/2.3.0/without channels.json | 6 +++--- .../testData/json/inspection/2.4.0/without channels.json | 6 +++--- .../testData/json/inspection/2.5.0/without channels.json | 6 +++--- .../testData/json/inspection/2.6.0/without channels.json | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/test/testData/json/inspection/2.0.0/without channels.json b/src/test/testData/json/inspection/2.0.0/without channels.json index b9c721b..2d4591e 100644 --- a/src/test/testData/json/inspection/2.0.0/without channels.json +++ b/src/test/testData/json/inspection/2.0.0/without channels.json @@ -1,5 +1,5 @@ -{ - "asyncapi": "2.0.0", +{ + "asyncapi": "2.0.0", "info": { "title": "Account Service", "version": "1.0.0", @@ -36,4 +36,4 @@ } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/2.1.0/without channels.json b/src/test/testData/json/inspection/2.1.0/without channels.json index 72968bb..6c2903c 100644 --- a/src/test/testData/json/inspection/2.1.0/without channels.json +++ b/src/test/testData/json/inspection/2.1.0/without channels.json @@ -1,5 +1,5 @@ -{ - "asyncapi": "2.1.0", +{ + "asyncapi": "2.1.0", "info": { "title": "Account Service", "version": "1.0.0", @@ -36,4 +36,4 @@ } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/2.2.0/without channels.json b/src/test/testData/json/inspection/2.2.0/without channels.json index be12352..86aa824 100644 --- a/src/test/testData/json/inspection/2.2.0/without channels.json +++ b/src/test/testData/json/inspection/2.2.0/without channels.json @@ -1,5 +1,5 @@ -{ - "asyncapi": "2.2.0", +{ + "asyncapi": "2.2.0", "info": { "title": "Account Service", "version": "1.0.0", @@ -36,4 +36,4 @@ } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/2.3.0/without channels.json b/src/test/testData/json/inspection/2.3.0/without channels.json index 7ede48b..b66ede5 100644 --- a/src/test/testData/json/inspection/2.3.0/without channels.json +++ b/src/test/testData/json/inspection/2.3.0/without channels.json @@ -1,5 +1,5 @@ -{ - "asyncapi": "2.3.0", +{ + "asyncapi": "2.3.0", "info": { "title": "Account Service", "version": "1.0.0", @@ -36,4 +36,4 @@ } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/2.4.0/without channels.json b/src/test/testData/json/inspection/2.4.0/without channels.json index b7e649c..3d127c0 100644 --- a/src/test/testData/json/inspection/2.4.0/without channels.json +++ b/src/test/testData/json/inspection/2.4.0/without channels.json @@ -1,5 +1,5 @@ -{ - "asyncapi": "2.4.0", +{ + "asyncapi": "2.4.0", "info": { "title": "Account Service", "version": "1.0.0", @@ -36,4 +36,4 @@ } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/2.5.0/without channels.json b/src/test/testData/json/inspection/2.5.0/without channels.json index dedc5e7..d03e962 100644 --- a/src/test/testData/json/inspection/2.5.0/without channels.json +++ b/src/test/testData/json/inspection/2.5.0/without channels.json @@ -1,5 +1,5 @@ -{ - "asyncapi": "2.5.0", +{ + "asyncapi": "2.5.0", "info": { "title": "Account Service", "version": "1.0.0", @@ -36,4 +36,4 @@ } } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/2.6.0/without channels.json b/src/test/testData/json/inspection/2.6.0/without channels.json index a3eeca5..a049bbf 100644 --- a/src/test/testData/json/inspection/2.6.0/without channels.json +++ b/src/test/testData/json/inspection/2.6.0/without channels.json @@ -1,5 +1,5 @@ -{ - "asyncapi": "2.6.0", +{ + "asyncapi": "2.6.0", "info": { "title": "Account Service", "version": "1.0.0", @@ -36,4 +36,4 @@ } } } -} \ No newline at end of file +} \ No newline at end of file From b5340330e8e8452974784fcb35945a7d93ac2174 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sat, 9 Dec 2023 14:23:24 +0400 Subject: [PATCH 08/57] refactor: rename AsyncAPISchemaHtmlRenderer to AsyncAPISpecificationHtmlRenderer --- ...t => AsyncAPISpecificationHtmlRenderer.kt} | 64 +++++++++---------- .../idea/extensions/web/StaticServer.kt | 6 +- src/main/resources/META-INF/plugin.xml | 2 +- 3 files changed, 36 insertions(+), 36 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/_core/{AsyncAPISchemaHtmlRenderer.kt => AsyncAPISpecificationHtmlRenderer.kt} (52%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaHtmlRenderer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt similarity index 52% rename from src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaHtmlRenderer.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt index 3e34221..e41d134 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaHtmlRenderer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt @@ -22,99 +22,99 @@ import java.util.function.Supplier * @since 1.1.0 */ @Service -class AsyncAPISchemaHtmlRenderer { +class AsyncAPISpecificationHtmlRenderer { private val webSocketRendererProvider = service() private val urlProvider = service() - private val schemaTemplateUrl = "/ui/index.html" - private val schemaTemplateCssUrl = "default(1.0.0-next.48).min.css" - private val schemaTemplateJsUrl = "index(1.0.0-next.48).js" + private val specificationTemplateUrl = "/ui/index.html" + private val specificationTemplateCssUrl = "default(1.0.0-next.48).min.css" + private val specificationTemplateJsUrl = "index(1.0.0-next.48).js" - fun render(request: FullHttpRequest, schemaUrl: String?): String { - schemaUrl ?: return "schema: not found." + fun render(request: FullHttpRequest, specificationUrl: String?): String { + specificationUrl ?: return "specification: not found." - val schemaFile = File(schemaUrl) - if (!schemaFile.exists()) { - return "schema: $schemaUrl not found." + val specificationFile = File(specificationUrl) + if (!specificationFile.exists()) { + return "specification: $specificationUrl not found." } - val schemaVirtualFile = LocalFileSystem.getInstance().findFileByIoFile(schemaFile) - schemaVirtualFile ?: return "schema: $schemaUrl not found." - if (schemaVirtualFile.fileType !is YAMLFileType && schemaVirtualFile.fileType !is JsonFileType) { - return "schema: $schemaUrl not in json or yaml format." + val specificationVirtualFile = LocalFileSystem.getInstance().findFileByIoFile(specificationFile) + specificationVirtualFile ?: return "specification: $specificationUrl not found." + if (specificationVirtualFile.fileType !is YAMLFileType && specificationVirtualFile.fileType !is JsonFileType) { + return "specification: $specificationUrl not in json or yaml format." } - val isJson = schemaVirtualFile.fileType is JsonFileType - val schema = replaceLocalReferences(schemaFile.readText(Charsets.UTF_8), schemaVirtualFile, isJson) - val temporalSchemaUrl = saveAsTemporalFile(schema, isJson) + val isJson = specificationVirtualFile.fileType is JsonFileType + val specification = replaceLocalReferences(specificationFile.readText(Charsets.UTF_8), specificationVirtualFile, isJson) + val temporalSpecificationUrl = saveAsTemporalFile(specification, isJson) - val schemaTemplate = this.javaClass.getResource(schemaTemplateUrl) - schemaTemplate ?: return "schema template not found." + val specificationTemplate = this.javaClass.getResource(specificationTemplateUrl) + specificationTemplate ?: return "specification template not found." val webSocket = webSocketRendererProvider.provide( fullHttpRequest = request, - supplier = Supplier { schemaVirtualFile } + supplier = Supplier { specificationVirtualFile } ) - return schemaTemplate.readText(Charsets.UTF_8) + return specificationTemplate.readText(Charsets.UTF_8) .replace( "url: '',", - "url: '${urlProvider.schema(temporalSchemaUrl)}'," + "url: '${urlProvider.schema(temporalSpecificationUrl)}'," ) .replace( "", - "" + "" ).replace( "", - "" + "" ).replace( "", webSocket?.toString() ?: "" ) } - private fun replaceLocalReferences(schema: String, schemaFile: VirtualFile, isJson: Boolean): String { + private fun replaceLocalReferences(specification: String, specificationFile: VirtualFile, isJson: Boolean): String { val objectMapper = if (isJson) { ObjectMapper() } else { ObjectMapper(YAMLFactory()) } - val tree = objectMapper.readTree(schema) + val tree = objectMapper.readTree(specification) tree.findParents("\$ref").forEach { val referenceValue = (it as ObjectNode).get("\$ref") if (referenceValue.toPrettyString().startsWith("\"./") || referenceValue.toPrettyString().startsWith("\"../")) { - (it).put("\$ref", localReferenceToFileUrl(referenceValue.toPrettyString(), schemaFile)) + (it).put("\$ref", localReferenceToFileUrl(referenceValue.toPrettyString(), specificationFile)) } } return objectMapper.writeValueAsString(tree) } - private fun localReferenceToFileUrl(localReference: String, schemaFile: VirtualFile): String { + private fun localReferenceToFileUrl(localReference: String, specificationFile: VirtualFile): String { val rawFileReference = localReference.removePrefix("\"").removeSuffix("\"") val fileReference = rawFileReference.split("#/").getOrNull(0) val schemaReference = rawFileReference.split("#/").getOrNull(1) fileReference ?: return rawFileReference - val referencedFile = schemaFile.parent.findFileByRelativePath(fileReference) + val referencedFile = specificationFile.parent.findFileByRelativePath(fileReference) referencedFile ?: return fileReference return urlProvider.reference(referencedFile.path, schemaReference) } - private fun saveAsTemporalFile(schema: String, isJson: Boolean): String { + private fun saveAsTemporalFile(specification: String, isJson: Boolean): String { val suffix = if (isJson) { ".json" } else { ".yaml" } - val tempSchema = FileUtil.createTempFile("jasyncapi-idea-plugin-${System.currentTimeMillis()}", suffix, true) - tempSchema.writeText(schema, Charsets.UTF_8) + val tempSpecification = FileUtil.createTempFile("jasyncapi-idea-plugin-${System.currentTimeMillis()}", suffix, true) + tempSpecification.writeText(specification, Charsets.UTF_8) - return tempSchema.systemIndependentPath + return tempSpecification.systemIndependentPath } } \ No newline at end of file diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/StaticServer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/StaticServer.kt index fa3106c..848c782 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/StaticServer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/StaticServer.kt @@ -1,6 +1,6 @@ package com.asyncapi.plugin.idea.extensions.web -import com.asyncapi.plugin.idea._core.AsyncAPISchemaHtmlRenderer +import com.asyncapi.plugin.idea._core.AsyncAPISpecificationHtmlRenderer import com.intellij.json.JsonFileType import com.intellij.openapi.components.service import com.intellij.openapi.vfs.LocalFileSystem @@ -20,7 +20,7 @@ import java.nio.charset.StandardCharsets class StaticServer : HttpRequestHandler() { private val urlProvider = service() - private val asyncAPISchemaHtmlRenderer = service() + private val asyncAPISpecificationHtmlRenderer = service() override fun isAccessible(request: HttpRequest): Boolean { return urlProvider.isPlugin(request) && super.isAccessible(request) @@ -44,7 +44,7 @@ class StaticServer : HttpRequestHandler() { override fun handle(resourceUrl: String): Resource { return Resource( "text/html", - asyncAPISchemaHtmlRenderer.render(request, resourceUrl).toByteArray(StandardCharsets.UTF_8) + asyncAPISpecificationHtmlRenderer.render(request, resourceUrl).toByteArray(StandardCharsets.UTF_8) ) } } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 1e81bb1..b393c06 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -28,7 +28,7 @@ - + From 1e48dff2ea21570855204dc47893648f8469e434 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sat, 9 Dec 2023 14:41:34 +0400 Subject: [PATCH 09/57] refactor: rename AsyncAPISchemaCompletionContributor to AsyncAPISpecificationCompletionContributor --- ... => AsyncAPISpecificationCompletionContributor.kt} | 2 +- src/main/resources/META-INF/plugin.xml | 4 ++-- ...AsyncAPISpecificationCompletionContributorTest.kt} | 2 +- .../AsyncAPISchemaCompletionContributorJsonTest.kt | 11 ----------- ...ncAPISpecificationCompletionContributorJsonTest.kt | 11 +++++++++++ ...cAPISpecificationCompletionContributorYamlTest.kt} | 4 ++-- .../AsyncAPISchemaCompletionContributorJsonTest.kt | 11 ----------- ...ncAPISpecificationCompletionContributorJsonTest.kt | 11 +++++++++++ ...cAPISpecificationCompletionContributorYamlTest.kt} | 4 ++-- .../AsyncAPISchemaCompletionContributorJsonTest.kt | 11 ----------- ...ncAPISpecificationCompletionContributorJsonTest.kt | 11 +++++++++++ ...cAPISpecificationCompletionContributorYamlTest.kt} | 4 ++-- .../AsyncAPISchemaCompletionContributorJsonTest.kt | 11 ----------- ...ncAPISpecificationCompletionContributorJsonTest.kt | 11 +++++++++++ ...cAPISpecificationCompletionContributorYamlTest.kt} | 4 ++-- .../AsyncAPISchemaCompletionContributorJsonTest.kt | 11 ----------- ...ncAPISpecificationCompletionContributorJsonTest.kt | 11 +++++++++++ ...cAPISpecificationCompletionContributorYamlTest.kt} | 4 ++-- .../AsyncAPISchemaCompletionContributorJsonTest.kt | 11 ----------- ...ncAPISpecificationCompletionContributorJsonTest.kt | 11 +++++++++++ ...cAPISpecificationCompletionContributorYamlTest.kt} | 4 ++-- .../AsyncAPISchemaCompletionContributorJsonTest.kt | 11 ----------- ...ncAPISpecificationCompletionContributorJsonTest.kt | 11 +++++++++++ ...cAPISpecificationCompletionContributorYamlTest.kt} | 4 ++-- 24 files changed, 95 insertions(+), 95 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/{AsyncAPISchemaCompletionContributor.kt => AsyncAPISpecificationCompletionContributor.kt} (94%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{AbstractAsyncAPISchemaCompletionContributorTest.kt => AbstractAsyncAPISpecificationCompletionContributorTest.kt} (97%) delete mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISchemaCompletionContributorJsonTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/{AsyncAPISchemaCompletionContributorYamlTest.kt => AsyncAPISpecificationCompletionContributorYamlTest.kt} (69%) delete mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISchemaCompletionContributorJsonTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/{AsyncAPISchemaCompletionContributorYamlTest.kt => AsyncAPISpecificationCompletionContributorYamlTest.kt} (69%) delete mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISchemaCompletionContributorJsonTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/{AsyncAPISchemaCompletionContributorYamlTest.kt => AsyncAPISpecificationCompletionContributorYamlTest.kt} (69%) delete mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISchemaCompletionContributorJsonTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/{AsyncAPISchemaCompletionContributorYamlTest.kt => AsyncAPISpecificationCompletionContributorYamlTest.kt} (69%) delete mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISchemaCompletionContributorJsonTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/{AsyncAPISchemaCompletionContributorYamlTest.kt => AsyncAPISpecificationCompletionContributorYamlTest.kt} (69%) delete mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISchemaCompletionContributorJsonTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/{AsyncAPISchemaCompletionContributorYamlTest.kt => AsyncAPISpecificationCompletionContributorYamlTest.kt} (69%) delete mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISchemaCompletionContributorJsonTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/{AsyncAPISchemaCompletionContributorYamlTest.kt => AsyncAPISpecificationCompletionContributorYamlTest.kt} (69%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISchemaCompletionContributor.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt similarity index 94% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISchemaCompletionContributor.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt index 0043f0c..fa244ec 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISchemaCompletionContributor.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt @@ -12,7 +12,7 @@ import com.jetbrains.jsonSchema.impl.JsonSchemaCompletionContributor * @author Pavel Bodiachevskii * @since 1.6.0 */ -class AsyncAPISchemaCompletionContributor: CompletionContributor() { +class AsyncAPISpecificationCompletionContributor: CompletionContributor() { private val asyncAPISchemaRecognizer = service() private val asyncAPIJsonSchemaProvider = service() diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index b393c06..d2b72c3 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -52,8 +52,8 @@ - - + + diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/AbstractAsyncAPISchemaCompletionContributorTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/AbstractAsyncAPISpecificationCompletionContributorTest.kt similarity index 97% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/AbstractAsyncAPISchemaCompletionContributorTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/AbstractAsyncAPISpecificationCompletionContributorTest.kt index 596c457..5747832 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/AbstractAsyncAPISchemaCompletionContributorTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/AbstractAsyncAPISpecificationCompletionContributorTest.kt @@ -8,7 +8,7 @@ import junit.framework.TestCase * @author Pavel Bodiachevskii * @since 1.6.0 */ -abstract class AbstractAsyncAPISchemaCompletionContributorTest: BasePlatformTestCase() { +abstract class AbstractAsyncAPISpecificationCompletionContributorTest: BasePlatformTestCase() { abstract fun fileExtension(): String diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISchemaCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISchemaCompletionContributorJsonTest.kt deleted file mode 100644 index e9f8870..0000000 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISchemaCompletionContributorJsonTest.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.asyncapi.plugin.idea.completion.v2_0_0 - -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest - -class AsyncAPISchemaCompletionContributorJsonTest: AbstractAsyncAPISchemaCompletionContributorTest() { - - override fun fileExtension(): String = "json" - - override fun asyncAPIVersion(): String = "2.0.0" - -} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt new file mode 100644 index 0000000..3640ffd --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -0,0 +1,11 @@ +package com.asyncapi.plugin.idea.completion.v2_0_0 + +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest + +class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { + + override fun fileExtension(): String = "json" + + override fun asyncAPIVersion(): String = "2.0.0" + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISchemaCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 69% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISchemaCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index 42a5b98..01e8b79 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISchemaCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,8 +1,8 @@ package com.asyncapi.plugin.idea.completion.v2_0_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest -class AsyncAPISchemaCompletionContributorYamlTest: AbstractAsyncAPISchemaCompletionContributorTest() { +class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { override fun fileExtension(): String = "yaml" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISchemaCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISchemaCompletionContributorJsonTest.kt deleted file mode 100644 index 99b42bb..0000000 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISchemaCompletionContributorJsonTest.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.asyncapi.plugin.idea.completion.v2_1_0 - -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest - -class AsyncAPISchemaCompletionContributorJsonTest: AbstractAsyncAPISchemaCompletionContributorTest() { - - override fun fileExtension(): String = "json" - - override fun asyncAPIVersion(): String = "2.1.0" - -} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt new file mode 100644 index 0000000..b6ff0ec --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -0,0 +1,11 @@ +package com.asyncapi.plugin.idea.completion.v2_1_0 + +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest + +class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { + + override fun fileExtension(): String = "json" + + override fun asyncAPIVersion(): String = "2.1.0" + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISchemaCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 69% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISchemaCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index 1acc09b..4f2b23b 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISchemaCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,8 +1,8 @@ package com.asyncapi.plugin.idea.completion.v2_1_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest -class AsyncAPISchemaCompletionContributorYamlTest: AbstractAsyncAPISchemaCompletionContributorTest() { +class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { override fun fileExtension(): String = "yaml" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISchemaCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISchemaCompletionContributorJsonTest.kt deleted file mode 100644 index c116bda..0000000 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISchemaCompletionContributorJsonTest.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.asyncapi.plugin.idea.completion.v2_2_0 - -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest - -class AsyncAPISchemaCompletionContributorJsonTest: AbstractAsyncAPISchemaCompletionContributorTest() { - - override fun fileExtension(): String = "json" - - override fun asyncAPIVersion(): String = "2.2.0" - -} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt new file mode 100644 index 0000000..a3c8635 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -0,0 +1,11 @@ +package com.asyncapi.plugin.idea.completion.v2_2_0 + +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest + +class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { + + override fun fileExtension(): String = "json" + + override fun asyncAPIVersion(): String = "2.2.0" + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISchemaCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 69% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISchemaCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index 92b6035..b2a40b5 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISchemaCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,8 +1,8 @@ package com.asyncapi.plugin.idea.completion.v2_2_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest -class AsyncAPISchemaCompletionContributorYamlTest: AbstractAsyncAPISchemaCompletionContributorTest() { +class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { override fun fileExtension(): String = "yaml" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISchemaCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISchemaCompletionContributorJsonTest.kt deleted file mode 100644 index 37b64f8..0000000 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISchemaCompletionContributorJsonTest.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.asyncapi.plugin.idea.completion.v2_3_0 - -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest - -class AsyncAPISchemaCompletionContributorJsonTest: AbstractAsyncAPISchemaCompletionContributorTest() { - - override fun fileExtension(): String = "json" - - override fun asyncAPIVersion(): String = "2.3.0" - -} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt new file mode 100644 index 0000000..57237be --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -0,0 +1,11 @@ +package com.asyncapi.plugin.idea.completion.v2_3_0 + +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest + +class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { + + override fun fileExtension(): String = "json" + + override fun asyncAPIVersion(): String = "2.3.0" + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISchemaCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 69% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISchemaCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index db60519..c686408 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISchemaCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,8 +1,8 @@ package com.asyncapi.plugin.idea.completion.v2_3_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest -class AsyncAPISchemaCompletionContributorYamlTest: AbstractAsyncAPISchemaCompletionContributorTest() { +class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { override fun fileExtension(): String = "yaml" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISchemaCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISchemaCompletionContributorJsonTest.kt deleted file mode 100644 index 0c4ba5b..0000000 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISchemaCompletionContributorJsonTest.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.asyncapi.plugin.idea.completion.v2_4_0 - -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest - -class AsyncAPISchemaCompletionContributorJsonTest: AbstractAsyncAPISchemaCompletionContributorTest() { - - override fun fileExtension(): String = "json" - - override fun asyncAPIVersion(): String = "2.4.0" - -} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt new file mode 100644 index 0000000..78b9c8e --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -0,0 +1,11 @@ +package com.asyncapi.plugin.idea.completion.v2_4_0 + +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest + +class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { + + override fun fileExtension(): String = "json" + + override fun asyncAPIVersion(): String = "2.4.0" + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISchemaCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 69% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISchemaCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index 6b25c0b..d799bdc 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISchemaCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,8 +1,8 @@ package com.asyncapi.plugin.idea.completion.v2_4_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest -class AsyncAPISchemaCompletionContributorYamlTest: AbstractAsyncAPISchemaCompletionContributorTest() { +class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { override fun fileExtension(): String = "yaml" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISchemaCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISchemaCompletionContributorJsonTest.kt deleted file mode 100644 index e0127d7..0000000 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISchemaCompletionContributorJsonTest.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.asyncapi.plugin.idea.completion.v2_5_0 - -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest - -class AsyncAPISchemaCompletionContributorJsonTest: AbstractAsyncAPISchemaCompletionContributorTest() { - - override fun fileExtension(): String = "json" - - override fun asyncAPIVersion(): String = "2.5.0" - -} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt new file mode 100644 index 0000000..0176b61 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -0,0 +1,11 @@ +package com.asyncapi.plugin.idea.completion.v2_5_0 + +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest + +class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { + + override fun fileExtension(): String = "json" + + override fun asyncAPIVersion(): String = "2.5.0" + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISchemaCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 69% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISchemaCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index 4537b3e..d639f90 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISchemaCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,8 +1,8 @@ package com.asyncapi.plugin.idea.completion.v2_5_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest -class AsyncAPISchemaCompletionContributorYamlTest: AbstractAsyncAPISchemaCompletionContributorTest() { +class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { override fun fileExtension(): String = "yaml" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISchemaCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISchemaCompletionContributorJsonTest.kt deleted file mode 100644 index c308fb8..0000000 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISchemaCompletionContributorJsonTest.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.asyncapi.plugin.idea.completion.v2_6_0 - -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest - -class AsyncAPISchemaCompletionContributorJsonTest: AbstractAsyncAPISchemaCompletionContributorTest() { - - override fun fileExtension(): String = "json" - - override fun asyncAPIVersion(): String = "2.6.0" - -} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt new file mode 100644 index 0000000..221c108 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -0,0 +1,11 @@ +package com.asyncapi.plugin.idea.completion.v2_6_0 + +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest + +class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { + + override fun fileExtension(): String = "json" + + override fun asyncAPIVersion(): String = "2.6.0" + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISchemaCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 69% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISchemaCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index 49a8cfb..21f77b0 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISchemaCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,8 +1,8 @@ package com.asyncapi.plugin.idea.completion.v2_6_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISchemaCompletionContributorTest +import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest -class AsyncAPISchemaCompletionContributorYamlTest: AbstractAsyncAPISchemaCompletionContributorTest() { +class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { override fun fileExtension(): String = "yaml" From 87eb11d5b67142524fda972e9d700a6aa4200f77 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sun, 10 Dec 2023 00:03:40 +0400 Subject: [PATCH 10/57] refactor: rename AsyncAPISchemaRecognizer to AsyncAPISpecificationRecognizer --- .../idea/_core/AsyncAPIJsonSchemaProvider.kt | 6 ++-- ....kt => AsyncAPISpecificationRecognizer.kt} | 2 +- ...ncAPISpecificationCompletionContributor.kt | 6 ++-- .../extensions/index/AsyncAPISchemaIndexer.kt | 6 ++-- .../web/AsyncAPIBrowserUrlProvider.kt | 6 ++-- src/main/resources/META-INF/plugin.xml | 2 +- ...=> AsyncAPISpecificationRecognizerTest.kt} | 36 +++++++++---------- 7 files changed, 32 insertions(+), 32 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/_core/{AsyncAPISchemaRecognizer.kt => AsyncAPISpecificationRecognizer.kt} (97%) rename src/test/kotlin/com/asyncapi/plugin/idea/_core/{AsyncAPISchemaRecognizerTest.kt => AsyncAPISpecificationRecognizerTest.kt} (87%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProvider.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProvider.kt index aff3697..21e4fac 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProvider.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProvider.kt @@ -16,13 +16,13 @@ import com.jetbrains.jsonSchema.impl.JsonSchemaObject @Service class AsyncAPIJsonSchemaProvider { - private val asyncAPISchemaRecognizer = service() + private val asyncAPISpecificationRecognizer = service() fun provide(file: PsiFile, project: Project): JsonSchemaObject? { - val asyncApiVersion = asyncAPISchemaRecognizer.extractAsyncAPIKey(file) + val asyncApiVersion = asyncAPISpecificationRecognizer.extractAsyncAPIKey(file) asyncApiVersion ?: return null - if (!asyncAPISchemaRecognizer.isSupported(asyncApiVersion)) { + if (!asyncAPISpecificationRecognizer.isSupported(asyncApiVersion)) { return null } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaRecognizer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt similarity index 97% rename from src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaRecognizer.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt index a54bfde..c2e16d2 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaRecognizer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt @@ -14,7 +14,7 @@ import org.jetbrains.yaml.psi.YAMLFile * @since 1.1.0 */ @Service -class AsyncAPISchemaRecognizer { +class AsyncAPISpecificationRecognizer { fun isSchema(file: PsiFile?, useIndex: Boolean = false): Boolean { file ?: return false diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt index fa244ec..c981a0f 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt @@ -1,7 +1,7 @@ package com.asyncapi.plugin.idea.extensions.completion import com.asyncapi.plugin.idea._core.AsyncAPIJsonSchemaProvider -import com.asyncapi.plugin.idea._core.AsyncAPISchemaRecognizer +import com.asyncapi.plugin.idea._core.AsyncAPISpecificationRecognizer import com.intellij.codeInsight.completion.CompletionContributor import com.intellij.codeInsight.completion.CompletionParameters import com.intellij.codeInsight.completion.CompletionResultSet @@ -14,12 +14,12 @@ import com.jetbrains.jsonSchema.impl.JsonSchemaCompletionContributor */ class AsyncAPISpecificationCompletionContributor: CompletionContributor() { - private val asyncAPISchemaRecognizer = service() + private val asyncAPISpecificationRecognizer = service() private val asyncAPIJsonSchemaProvider = service() override fun fillCompletionVariants(parameters: CompletionParameters, result: CompletionResultSet) { - if (!asyncAPISchemaRecognizer.isSchema(parameters.originalFile)) { + if (!asyncAPISpecificationRecognizer.isSchema(parameters.originalFile)) { return } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt index 1dfa589..aecd602 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt @@ -1,6 +1,6 @@ package com.asyncapi.plugin.idea.extensions.index -import com.asyncapi.plugin.idea._core.AsyncAPISchemaRecognizer +import com.asyncapi.plugin.idea._core.AsyncAPISpecificationRecognizer import com.asyncapi.plugin.idea._core.AsyncAPISchemaReferencesCollector import com.intellij.json.psi.JsonFile import com.intellij.openapi.components.service @@ -13,12 +13,12 @@ import org.jetbrains.yaml.psi.YAMLFile */ class AsyncAPISchemaIndexer: DataIndexer, FileContent> { - private val asyncAPISchemaRecognizer = service() + private val asyncAPISpecificationRecognizer = service() override fun map(inputData: FileContent): MutableMap> { val index = mutableMapOf>() - if (!asyncAPISchemaRecognizer.isSchema(inputData.psiFile)) { + if (!asyncAPISpecificationRecognizer.isSchema(inputData.psiFile)) { return index } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/AsyncAPIBrowserUrlProvider.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/AsyncAPIBrowserUrlProvider.kt index f296afa..668961a 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/AsyncAPIBrowserUrlProvider.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/AsyncAPIBrowserUrlProvider.kt @@ -1,6 +1,6 @@ package com.asyncapi.plugin.idea.extensions.web -import com.asyncapi.plugin.idea._core.AsyncAPISchemaRecognizer +import com.asyncapi.plugin.idea._core.AsyncAPISpecificationRecognizer import com.intellij.ide.browsers.OpenInBrowserRequest import com.intellij.ide.browsers.WebBrowserUrlProvider import com.intellij.openapi.components.service @@ -13,11 +13,11 @@ import com.intellij.util.Url */ class AsyncAPIBrowserUrlProvider: WebBrowserUrlProvider() { - private val asyncAPISchemaRecognizer = service() + private val asyncAPISpecificationRecognizer = service() private val urlProvider = service() override fun canHandleElement(request: OpenInBrowserRequest): Boolean { - return asyncAPISchemaRecognizer.isSchema(request.file) + return asyncAPISpecificationRecognizer.isSchema(request.file) } override fun getUrl(request: OpenInBrowserRequest, file: VirtualFile): Url? { diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index d2b72c3..48ca605 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -27,7 +27,7 @@ - + diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaRecognizerTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt similarity index 87% rename from src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaRecognizerTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt index bf0839a..b74754b 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaRecognizerTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt @@ -12,40 +12,40 @@ import org.jetbrains.yaml.YAMLLanguage * @author Pavel Bodiachevskii * @since 1.1.0 */ -class AsyncAPISchemaRecognizerTest: BasePlatformTestCase() { +class AsyncAPISpecificationRecognizerTest: BasePlatformTestCase() { override fun getTestDataPath(): String { return "src/test/testData" } fun `test - injects correctly`() { - TestCase.assertNotNull(service()) + TestCase.assertNotNull(service()) } fun `test - isSchema when file is null`() { - val asyncAPISchemaRecognizer = service() + val asyncAPISpecificationRecognizer = service() TestCase.assertFalse( "must be false in case of null file.", - asyncAPISchemaRecognizer.isSchema(null) + asyncAPISpecificationRecognizer.isSchema(null) ) } fun `test - extractAsyncAPIKey when file is null`() { - val asyncAPISchemaRecognizer = service() + val asyncAPISpecificationRecognizer = service() TestCase.assertNull( "must be false in case of null file.", - asyncAPISchemaRecognizer.extractAsyncAPIKey(null) + asyncAPISpecificationRecognizer.extractAsyncAPIKey(null) ) } fun `test - isSupported when file is null`() { - val asyncAPISchemaRecognizer = service() + val asyncAPISpecificationRecognizer = service() TestCase.assertFalse( "must be false in case of null version.", - asyncAPISchemaRecognizer.isSupported(null) + asyncAPISpecificationRecognizer.isSupported(null) ) } @@ -148,22 +148,22 @@ class AsyncAPISchemaRecognizerTest: BasePlatformTestCase() { } private fun `test - isSchema(psiFile) when file is schema and not empty`(asyncApiFile: PsiFile, version: String) { - val asyncAPISchemaRecognizer = service() + val asyncAPISpecificationRecognizer = service() TestCase.assertTrue( "$version must be supported.", - asyncAPISchemaRecognizer.isSupported( - asyncAPISchemaRecognizer.extractAsyncAPIKey(asyncApiFile) + asyncAPISpecificationRecognizer.isSupported( + asyncAPISpecificationRecognizer.extractAsyncAPIKey(asyncApiFile) ) ) TestCase.assertEquals( "version $version must be recognized correctly", version, - asyncAPISchemaRecognizer.extractAsyncAPIKey(asyncApiFile) + asyncAPISpecificationRecognizer.extractAsyncAPIKey(asyncApiFile) ) TestCase.assertTrue( "must be true in case of non null, non empty json file with `asyncapi` key provided.", - asyncAPISchemaRecognizer.isSchema( + asyncAPISpecificationRecognizer.isSchema( asyncApiFile ) ) @@ -254,21 +254,21 @@ class AsyncAPISchemaRecognizerTest: BasePlatformTestCase() { } private fun `test - isSchema(psiFile) when file is empty`(asyncApiFile: PsiFile) { - val asyncAPISchemaRecognizer = service() + val asyncAPISpecificationRecognizer = service() TestCase.assertFalse( "empty file must not be supported.", - asyncAPISchemaRecognizer.isSupported( - asyncAPISchemaRecognizer.extractAsyncAPIKey(asyncApiFile) + asyncAPISpecificationRecognizer.isSupported( + asyncAPISpecificationRecognizer.extractAsyncAPIKey(asyncApiFile) ) ) TestCase.assertNull( "empty file must not be recognized correctly", - asyncAPISchemaRecognizer.extractAsyncAPIKey(asyncApiFile) + asyncAPISpecificationRecognizer.extractAsyncAPIKey(asyncApiFile) ) TestCase.assertFalse( "must be false in case of empty file.", - asyncAPISchemaRecognizer.isSchema(asyncApiFile) + asyncAPISpecificationRecognizer.isSchema(asyncApiFile) ) } From 6960dae1df823a307bf48c32d5f9c76d138dfb8a Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sun, 10 Dec 2023 00:36:11 +0400 Subject: [PATCH 11/57] refactor: rename AsyncAPISpecificationRecognizer isSchema to isSpecification --- .../_core/AsyncAPISpecificationRecognizer.kt | 2 +- ...ncAPISpecificationCompletionContributor.kt | 2 +- .../extensions/index/AsyncAPISchemaIndexer.kt | 2 +- .../web/AsyncAPIBrowserUrlProvider.kt | 2 +- .../AsyncAPISpecificationRecognizerTest.kt | 124 +++++++++--------- 5 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt index c2e16d2..0a11859 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt @@ -16,7 +16,7 @@ import org.jetbrains.yaml.psi.YAMLFile @Service class AsyncAPISpecificationRecognizer { - fun isSchema(file: PsiFile?, useIndex: Boolean = false): Boolean { + fun isSpecification(file: PsiFile?, useIndex: Boolean = false): Boolean { file ?: return false if (file.fileType !is YAMLFileType && file.fileType !is JsonFileType) { diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt index c981a0f..d48cd66 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/completion/AsyncAPISpecificationCompletionContributor.kt @@ -19,7 +19,7 @@ class AsyncAPISpecificationCompletionContributor: CompletionContributor() { override fun fillCompletionVariants(parameters: CompletionParameters, result: CompletionResultSet) { - if (!asyncAPISpecificationRecognizer.isSchema(parameters.originalFile)) { + if (!asyncAPISpecificationRecognizer.isSpecification(parameters.originalFile)) { return } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt index aecd602..9d9529f 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt @@ -18,7 +18,7 @@ class AsyncAPISchemaIndexer: DataIndexer, FileContent> { override fun map(inputData: FileContent): MutableMap> { val index = mutableMapOf>() - if (!asyncAPISpecificationRecognizer.isSchema(inputData.psiFile)) { + if (!asyncAPISpecificationRecognizer.isSpecification(inputData.psiFile)) { return index } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/AsyncAPIBrowserUrlProvider.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/AsyncAPIBrowserUrlProvider.kt index 668961a..b39bd56 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/AsyncAPIBrowserUrlProvider.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/AsyncAPIBrowserUrlProvider.kt @@ -17,7 +17,7 @@ class AsyncAPIBrowserUrlProvider: WebBrowserUrlProvider() { private val urlProvider = service() override fun canHandleElement(request: OpenInBrowserRequest): Boolean { - return asyncAPISpecificationRecognizer.isSchema(request.file) + return asyncAPISpecificationRecognizer.isSpecification(request.file) } override fun getUrl(request: OpenInBrowserRequest, file: VirtualFile): Url? { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt index b74754b..5a72dca 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt @@ -22,12 +22,12 @@ class AsyncAPISpecificationRecognizerTest: BasePlatformTestCase() { TestCase.assertNotNull(service()) } - fun `test - isSchema when file is null`() { + fun `test - isSpecification when file is null`() { val asyncAPISpecificationRecognizer = service() TestCase.assertFalse( "must be false in case of null file.", - asyncAPISpecificationRecognizer.isSchema(null) + asyncAPISpecificationRecognizer.isSpecification(null) ) } @@ -49,105 +49,105 @@ class AsyncAPISpecificationRecognizerTest: BasePlatformTestCase() { ) } - fun `test (json) - 2_0_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (json) - 2_0_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.0.0.json", Language.findLanguageByID("JSON")!!), "2.0.0" ) } - fun `test (yaml) - 2_0_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_0_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.0.0.yaml", YAMLLanguage.INSTANCE), "2.0.0" ) } - fun `test (json) - 2_1_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (json) - 2_1_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.1.0.json", Language.findLanguageByID("JSON")!!), "2.1.0" ) } - fun `test (yaml) - 2_1_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_1_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.1.0.yaml", YAMLLanguage.INSTANCE), "2.1.0" ) } - fun `test (json) - 2_2_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (json) - 2_2_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.2.0.json", Language.findLanguageByID("JSON")!!), "2.2.0" ) } - fun `test (yaml) - 2_2_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_2_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.2.0.yaml", YAMLLanguage.INSTANCE), "2.2.0" ) } - fun `test (json) - 2_3_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (json) - 2_3_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.3.0.json", Language.findLanguageByID("JSON")!!), "2.3.0" ) } - fun `test (yaml) - 2_3_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_3_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.3.0.yaml", YAMLLanguage.INSTANCE), "2.3.0" ) } - fun `test (json) - 2_4_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (json) - 2_4_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.4.0.json", Language.findLanguageByID("JSON")!!), "2.4.0" ) } - fun `test (yaml) - 2_4_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_4_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.4.0.yaml", YAMLLanguage.INSTANCE), "2.4.0" ) } - fun `test (json) - 2_5_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (json) - 2_5_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.5.0.json", Language.findLanguageByID("JSON")!!), "2.5.0" ) } - fun `test (yaml) - 2_5_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_5_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.5.0.yaml", YAMLLanguage.INSTANCE), "2.5.0" ) } - fun `test (json) - 2_6_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (json) - 2_6_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.6.0.json", Language.findLanguageByID("JSON")!!), "2.6.0" ) } - fun `test (yaml) - 2_6_0 isSchema(psiFile) when file is schema and not empty`() { - `test - isSchema(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_6_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( createFile("asyncapi-2.6.0.yaml", YAMLLanguage.INSTANCE), "2.6.0" ) } - private fun `test - isSchema(psiFile) when file is schema and not empty`(asyncApiFile: PsiFile, version: String) { + private fun `test - isSpecification(psiFile) when file is schema and not empty`(asyncApiFile: PsiFile, version: String) { val asyncAPISpecificationRecognizer = service() TestCase.assertTrue( @@ -163,97 +163,97 @@ class AsyncAPISpecificationRecognizerTest: BasePlatformTestCase() { ) TestCase.assertTrue( "must be true in case of non null, non empty json file with `asyncapi` key provided.", - asyncAPISpecificationRecognizer.isSchema( + asyncAPISpecificationRecognizer.isSpecification( asyncApiFile ) ) } - fun `test (json) - 2_0_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (json) - 2_0_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.0.0.json", Language.findLanguageByID("JSON")!!, true) ) } - fun `test (yaml) - 2_0_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (yaml) - 2_0_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.0.0.yaml", YAMLLanguage.INSTANCE, true) ) } - fun `test (json) - 2_1_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (json) - 2_1_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.1.0.json", Language.findLanguageByID("JSON")!!, true) ) } - fun `test (yaml) - 2_1_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (yaml) - 2_1_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.1.0.yaml", YAMLLanguage.INSTANCE, true) ) } - fun `test (json) - 2_2_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (json) - 2_2_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.2.0.json", Language.findLanguageByID("JSON")!!, true) ) } - fun `test (yaml) - 2_2_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (yaml) - 2_2_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.2.0.yaml", YAMLLanguage.INSTANCE, true) ) } - fun `test (json) - 2_3_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (json) - 2_3_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.3.0.json", Language.findLanguageByID("JSON")!!, true) ) } - fun `test (yaml) - 2_3_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (yaml) - 2_3_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.3.0.yaml", YAMLLanguage.INSTANCE, true) ) } - fun `test (json) - 2_4_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (json) - 2_4_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.4.0.json", Language.findLanguageByID("JSON")!!, true) ) } - fun `test (yaml) - 2_4_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (yaml) - 2_4_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.4.0.yaml", YAMLLanguage.INSTANCE, true) ) } - fun `test (json) - 2_5_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (json) - 2_5_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.5.0.json", Language.findLanguageByID("JSON")!!, true) ) } - fun `test (yaml) - 2_5_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (yaml) - 2_5_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.5.0.yaml", YAMLLanguage.INSTANCE, true) ) } - fun `test (json) - 2_6_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (json) - 2_6_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.6.0.json", Language.findLanguageByID("JSON")!!, true) ) } - fun `test (yaml) - 2_6_0 isSchema(psiFile) when file is empty`() { - `test - isSchema(psiFile) when file is empty`( + fun `test (yaml) - 2_6_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( createFile("asyncapi-2.6.0.yaml", YAMLLanguage.INSTANCE, true) ) } - private fun `test - isSchema(psiFile) when file is empty`(asyncApiFile: PsiFile) { + private fun `test - isSpecification(psiFile) when file is empty`(asyncApiFile: PsiFile) { val asyncAPISpecificationRecognizer = service() TestCase.assertFalse( @@ -268,7 +268,7 @@ class AsyncAPISpecificationRecognizerTest: BasePlatformTestCase() { ) TestCase.assertFalse( "must be false in case of empty file.", - asyncAPISpecificationRecognizer.isSchema(asyncApiFile) + asyncAPISpecificationRecognizer.isSpecification(asyncApiFile) ) } From 77f4916c1129f3904487206e712de49fd2a1decf Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sun, 10 Dec 2023 01:06:30 +0400 Subject: [PATCH 12/57] feat: AsyncAPI 3.0.0 completion --- .../_core/AsyncAPISpecificationRecognizer.kt | 2 +- ...ISpecificationCompletionContributorTest.kt | 2 +- ...cificationCompletionContributorJsonTest.kt | 4 +- ...cificationCompletionContributorYamlTest.kt | 4 +- ...cificationCompletionContributorJsonTest.kt | 4 +- ...cificationCompletionContributorYamlTest.kt | 4 +- ...cificationCompletionContributorJsonTest.kt | 4 +- ...cificationCompletionContributorYamlTest.kt | 4 +- ...cificationCompletionContributorJsonTest.kt | 4 +- ...cificationCompletionContributorYamlTest.kt | 4 +- ...cificationCompletionContributorJsonTest.kt | 4 +- ...cificationCompletionContributorYamlTest.kt | 4 +- ...cificationCompletionContributorJsonTest.kt | 4 +- ...cificationCompletionContributorYamlTest.kt | 4 +- ...cificationCompletionContributorJsonTest.kt | 4 +- ...cificationCompletionContributorYamlTest.kt | 4 +- ...ISpecificationCompletionContributorTest.kt | 114 ++++++++++++++++++ ...cificationCompletionContributorJsonTest.kt | 15 +++ ...cificationCompletionContributorYamlTest.kt | 17 +++ .../json/completion/3.0.0/\"c\".json" | 4 + .../testData/json/completion/3.0.0/c.json | 4 + ...-> messages -> UserSignedUp -> \"p\".json" | 47 ++++++++ ...s -> messages -> UserSignedUp -> \"p.json" | 47 ++++++++ ...ents -> messages -> UserSignedUp -> p.json | 47 ++++++++ .../json/completion/3.0.0/info -> \"i\".json" | 6 + .../json/completion/3.0.0/info -> i.json | 6 + .../yaml/completion/3.0.0/\"c\".yaml" | 3 + .../testData/yaml/completion/3.0.0/c.yaml | 3 + ...-> messages -> UserSignedUp -> \"p\".yaml" | 31 +++++ ...s -> messages -> UserSignedUp -> \"p.yaml" | 31 +++++ ...ents -> messages -> UserSignedUp -> p.yaml | 31 +++++ .../yaml/completion/3.0.0/info -> \"i\".yaml" | 4 + .../yaml/completion/3.0.0/info -> i.yaml | 4 + 33 files changed, 444 insertions(+), 30 deletions(-) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{ => v2}/AbstractAsyncAPISpecificationCompletionContributorTest.kt (98%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_0_0 => v2/_0_0}/AsyncAPISpecificationCompletionContributorJsonTest.kt (59%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_0_0 => v2/_0_0}/AsyncAPISpecificationCompletionContributorYamlTest.kt (78%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_1_0 => v2/_1_0}/AsyncAPISpecificationCompletionContributorJsonTest.kt (59%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_1_0 => v2/_1_0}/AsyncAPISpecificationCompletionContributorYamlTest.kt (78%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_2_0 => v2/_2_0}/AsyncAPISpecificationCompletionContributorJsonTest.kt (59%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_2_0 => v2/_2_0}/AsyncAPISpecificationCompletionContributorYamlTest.kt (78%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_3_0 => v2/_3_0}/AsyncAPISpecificationCompletionContributorJsonTest.kt (59%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_3_0 => v2/_3_0}/AsyncAPISpecificationCompletionContributorYamlTest.kt (78%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_4_0 => v2/_4_0}/AsyncAPISpecificationCompletionContributorJsonTest.kt (59%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_4_0 => v2/_4_0}/AsyncAPISpecificationCompletionContributorYamlTest.kt (78%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_5_0 => v2/_5_0}/AsyncAPISpecificationCompletionContributorJsonTest.kt (59%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_5_0 => v2/_5_0}/AsyncAPISpecificationCompletionContributorYamlTest.kt (78%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_6_0 => v2/_6_0}/AsyncAPISpecificationCompletionContributorJsonTest.kt (59%) rename src/test/kotlin/com/asyncapi/plugin/idea/completion/{v2_6_0 => v2/_6_0}/AsyncAPISpecificationCompletionContributorYamlTest.kt (78%) create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/AbstractAsyncAPISpecificationCompletionContributorTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt create mode 100644 "src/test/testData/json/completion/3.0.0/\"c\".json" create mode 100644 src/test/testData/json/completion/3.0.0/c.json create mode 100644 "src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> \"p\".json" create mode 100644 "src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> \"p.json" create mode 100644 src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> p.json create mode 100644 "src/test/testData/json/completion/3.0.0/info -> \"i\".json" create mode 100644 src/test/testData/json/completion/3.0.0/info -> i.json create mode 100644 "src/test/testData/yaml/completion/3.0.0/\"c\".yaml" create mode 100644 src/test/testData/yaml/completion/3.0.0/c.yaml create mode 100644 "src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> \"p\".yaml" create mode 100644 "src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> \"p.yaml" create mode 100644 src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> p.yaml create mode 100644 "src/test/testData/yaml/completion/3.0.0/info -> \"i\".yaml" create mode 100644 src/test/testData/yaml/completion/3.0.0/info -> i.yaml diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt index 0a11859..73757cd 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizer.kt @@ -46,7 +46,7 @@ class AsyncAPISpecificationRecognizer { fun isSupported(version: String?): Boolean { return when (version) { - "2.0.0", "2.1.0", "2.2.0", "2.3.0", "2.4.0", "2.5.0", "2.6.0" -> true + "2.0.0", "2.1.0", "2.2.0", "2.3.0", "2.4.0", "2.5.0", "2.6.0", "3.0.0" -> true else -> false } } diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/AbstractAsyncAPISpecificationCompletionContributorTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/AbstractAsyncAPISpecificationCompletionContributorTest.kt similarity index 98% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/AbstractAsyncAPISpecificationCompletionContributorTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/AbstractAsyncAPISpecificationCompletionContributorTest.kt index 5747832..b90f56c 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/AbstractAsyncAPISpecificationCompletionContributorTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/AbstractAsyncAPISpecificationCompletionContributorTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.completion +package com.asyncapi.plugin.idea.completion.v2 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt similarity index 59% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt index 3640ffd..b081b36 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_0_0 +package com.asyncapi.plugin.idea.completion.v2._0_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 78% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index 01e8b79..30b2f42 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_0_0 +package com.asyncapi.plugin.idea.completion.v2._0_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt similarity index 59% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt index b6ff0ec..511ad69 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_1_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_1_0 +package com.asyncapi.plugin.idea.completion.v2._1_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_1_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 78% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_1_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index 4f2b23b..9da3e79 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_1_0/AsyncAPISpecificationCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_1_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_1_0 +package com.asyncapi.plugin.idea.completion.v2._1_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt similarity index 59% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt index a3c8635..194ccf2 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_2_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_2_0 +package com.asyncapi.plugin.idea.completion.v2._2_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_2_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 78% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_2_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index b2a40b5..847949f 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_2_0/AsyncAPISpecificationCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_2_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_2_0 +package com.asyncapi.plugin.idea.completion.v2._2_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt similarity index 59% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt index 57237be..d51f4f1 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_3_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_3_0 +package com.asyncapi.plugin.idea.completion.v2._3_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_3_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 78% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_3_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index c686408..90d66e3 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_3_0/AsyncAPISpecificationCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_3_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_3_0 +package com.asyncapi.plugin.idea.completion.v2._3_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt similarity index 59% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt index 78b9c8e..1e95ddf 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_4_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_4_0 +package com.asyncapi.plugin.idea.completion.v2._4_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_4_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 78% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_4_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index d799bdc..a205a51 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_4_0/AsyncAPISpecificationCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_4_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_4_0 +package com.asyncapi.plugin.idea.completion.v2._4_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt similarity index 59% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt index 0176b61..56482b1 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_5_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_5_0 +package com.asyncapi.plugin.idea.completion.v2._5_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_5_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 78% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_5_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index d639f90..a63c025 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_5_0/AsyncAPISpecificationCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_5_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_5_0 +package com.asyncapi.plugin.idea.completion.v2._5_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt similarity index 59% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt index 221c108..c6570f7 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_6_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_6_0 +package com.asyncapi.plugin.idea.completion.v2._6_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_6_0/AsyncAPISpecificationCompletionContributorYamlTest.kt similarity index 78% rename from src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorYamlTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_6_0/AsyncAPISpecificationCompletionContributorYamlTest.kt index 21f77b0..f110fdd 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2_6_0/AsyncAPISpecificationCompletionContributorYamlTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v2/_6_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -1,6 +1,6 @@ -package com.asyncapi.plugin.idea.completion.v2_6_0 +package com.asyncapi.plugin.idea.completion.v2._6_0 -import com.asyncapi.plugin.idea.completion.AbstractAsyncAPISpecificationCompletionContributorTest +import com.asyncapi.plugin.idea.completion.v2.AbstractAsyncAPISpecificationCompletionContributorTest class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/AbstractAsyncAPISpecificationCompletionContributorTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/AbstractAsyncAPISpecificationCompletionContributorTest.kt new file mode 100644 index 0000000..90ae7e6 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/AbstractAsyncAPISpecificationCompletionContributorTest.kt @@ -0,0 +1,114 @@ +package com.asyncapi.plugin.idea.completion.v3 + +import com.intellij.codeInsight.completion.CompletionType +import com.intellij.testFramework.fixtures.BasePlatformTestCase +import junit.framework.TestCase + +/** + * @author Pavel Bodiachevskii + * @since 2.4.0 + */ +abstract class AbstractAsyncAPISpecificationCompletionContributorTest: BasePlatformTestCase() { + + abstract fun fileExtension(): String + + abstract fun asyncAPIVersion(): String + + override fun getTestDataPath(): String = "src/test/testData/${fileExtension()}/completion/${asyncAPIVersion()}" + + protected open val `$ - c` = listOf( + "\"channels\"", + "\"components\"", + "\"defaultContentType\"", + ) + + protected open val `$ - components - messages - UserSignedUp - p` = listOf( + "\"contentType\"", + "\"deprecated\"", + "\"description\"", + "\"examples\"" + ) + + protected open val `$ - info - i` = listOf( + "\"description\"", + "\"license\"", + "\"termsOfService\"", + "\"title\"", + "\"version\"" + ) + + fun `test $ - (double quote)c(double quote)`() { + configureMyFixture("\"c\".${fileExtension()}") + + /* + TODO: to research why completion returns more variants only in tests. In IDEA everything is ok: + expected: ["channels", "components", "defaultContentType", "externalDocs"] + actual: ["channels", "components", "defaultContentType", "externalDocs", "id", "info", "servers", "tags"] + */ + TestCase.assertTrue((myFixture.lookupElementStrings ?: emptyList()).containsAll(`$ - c`)) + } + + fun `test $ - c`() { + configureMyFixture("c.${fileExtension()}") + + TestCase.assertEquals(`$ - c`.sorted(), (myFixture.lookupElementStrings?.sorted() ?: emptyList())) + } + + fun `test $ - components - messages - UserSignedUp - (double quote)p(double quote)`() { + configureMyFixture("components -> messages -> UserSignedUp -> \"p\".${fileExtension()}") + + /* + TODO: to research why completion returns more variants only in tests. In IDEA everything is ok: + expected: ["contentType", "deprecated", "description", "examples"] + actual: ["$ref", "bindings", "contentType", "correlationId", "deprecated", "description", "examples", "externalDocs", "headers", "name", "oneOf", "schemaFormat", "summary", "tags", "title", "traits"] + */ + TestCase.assertTrue( + (myFixture.lookupElementStrings ?: emptyList()) + .containsAll(`$ - components - messages - UserSignedUp - p`) + ) + } + + fun `test $ - components - messages - UserSignedUp - (double quote)p`() { + configureMyFixture("components -> messages -> UserSignedUp -> \"p.${fileExtension()}") + + TestCase.assertEquals( + `$ - components - messages - UserSignedUp - p`.sorted().map { it.replace("\"", "") }, + (myFixture.lookupElementStrings?.sorted() ?: emptyList()) + ) + } + + fun `test $ - components - messages - UserSignedUp - p`() { + configureMyFixture("components -> messages -> UserSignedUp -> p.${fileExtension()}") + + TestCase.assertEquals( + `$ - components - messages - UserSignedUp - p`.sorted(), + (myFixture.lookupElementStrings?.sorted() ?: emptyList()) + ) + } + + fun `test $ - info - (double quote)i(double quote)`() { + configureMyFixture("info -> \"i\".${fileExtension()}") + + /* + TODO: to research why completion returns more variants only in tests. In IDEA everything is ok: + expected: ["description", "license", "termsOfService", "title", "version"] + actual: ["contact", "description", "license", "termsOfService", "title", "version"] + */ + TestCase.assertTrue( + (myFixture.lookupElementStrings ?: emptyList()) + .containsAll(`$ - info - i`) + ) + } + + fun `test $ - info - i`() { + configureMyFixture("info -> i.${fileExtension()}") + + TestCase.assertEquals(`$ - info - i`.sorted(), (myFixture.lookupElementStrings?.sorted() ?: emptyList())) + } + + private fun configureMyFixture(fileName: String) { + myFixture.configureByFile(fileName) + myFixture.complete(CompletionType.BASIC, 1) + } + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt new file mode 100644 index 0000000..bee8943 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/_0_0/AsyncAPISpecificationCompletionContributorJsonTest.kt @@ -0,0 +1,15 @@ +package com.asyncapi.plugin.idea.completion.v3._0_0 + +import com.asyncapi.plugin.idea.completion.v3.AbstractAsyncAPISpecificationCompletionContributorTest + +/** + * @author Pavel Bodiachevskii + * @since 2.4.0 + */ +class AsyncAPISpecificationCompletionContributorJsonTest: AbstractAsyncAPISpecificationCompletionContributorTest() { + + override fun fileExtension(): String = "json" + + override fun asyncAPIVersion(): String = "3.0.0" + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt new file mode 100644 index 0000000..10e663d --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/completion/v3/_0_0/AsyncAPISpecificationCompletionContributorYamlTest.kt @@ -0,0 +1,17 @@ +package com.asyncapi.plugin.idea.completion.v3._0_0 + +import com.asyncapi.plugin.idea.completion.v3.AbstractAsyncAPISpecificationCompletionContributorTest + +class AsyncAPISpecificationCompletionContributorYamlTest: AbstractAsyncAPISpecificationCompletionContributorTest() { + + override fun fileExtension(): String = "yaml" + + override fun asyncAPIVersion(): String = "3.0.0" + + override val `$ - c` = super.`$ - c`.sorted().map { it.replace("\"", "") } + + override val `$ - components - messages - UserSignedUp - p` = super.`$ - components - messages - UserSignedUp - p`.sorted().map { it.replace("\"", "") } + + override val `$ - info - i` = super.`$ - info - i`.sorted().map { it.replace("\"", "") } + +} \ No newline at end of file diff --git "a/src/test/testData/json/completion/3.0.0/\"c\".json" "b/src/test/testData/json/completion/3.0.0/\"c\".json" new file mode 100644 index 0000000..1fc4339 --- /dev/null +++ "b/src/test/testData/json/completion/3.0.0/\"c\".json" @@ -0,0 +1,4 @@ +{ + "asyncapi": "3.0.0", + "c" +} \ No newline at end of file diff --git a/src/test/testData/json/completion/3.0.0/c.json b/src/test/testData/json/completion/3.0.0/c.json new file mode 100644 index 0000000..ee1e150 --- /dev/null +++ b/src/test/testData/json/completion/3.0.0/c.json @@ -0,0 +1,4 @@ +{ + "asyncapi": "3.0.0", + c +} \ No newline at end of file diff --git "a/src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> \"p\".json" "b/src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> \"p\".json" new file mode 100644 index 0000000..3a17281 --- /dev/null +++ "b/src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> \"p\".json" @@ -0,0 +1,47 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/messages/UserSignedUp" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "p" + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git "a/src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> \"p.json" "b/src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> \"p.json" new file mode 100644 index 0000000..6e32217 --- /dev/null +++ "b/src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> \"p.json" @@ -0,0 +1,47 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/messages/UserSignedUp" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "p + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> p.json b/src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> p.json new file mode 100644 index 0000000..38bd19d --- /dev/null +++ b/src/test/testData/json/completion/3.0.0/components -> messages -> UserSignedUp -> p.json @@ -0,0 +1,47 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/messages/UserSignedUp" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + p + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git "a/src/test/testData/json/completion/3.0.0/info -> \"i\".json" "b/src/test/testData/json/completion/3.0.0/info -> \"i\".json" new file mode 100644 index 0000000..4f53782 --- /dev/null +++ "b/src/test/testData/json/completion/3.0.0/info -> \"i\".json" @@ -0,0 +1,6 @@ +{ + "asyncapi": "3.0.0", + "info": { + "i" + } +} \ No newline at end of file diff --git a/src/test/testData/json/completion/3.0.0/info -> i.json b/src/test/testData/json/completion/3.0.0/info -> i.json new file mode 100644 index 0000000..9eb272c --- /dev/null +++ b/src/test/testData/json/completion/3.0.0/info -> i.json @@ -0,0 +1,6 @@ +{ + "asyncapi": "3.0.0", + "info": { + i + } +} \ No newline at end of file diff --git "a/src/test/testData/yaml/completion/3.0.0/\"c\".yaml" "b/src/test/testData/yaml/completion/3.0.0/\"c\".yaml" new file mode 100644 index 0000000..1060024 --- /dev/null +++ "b/src/test/testData/yaml/completion/3.0.0/\"c\".yaml" @@ -0,0 +1,3 @@ +--- +asyncapi: 3.0.0 +"c" \ No newline at end of file diff --git a/src/test/testData/yaml/completion/3.0.0/c.yaml b/src/test/testData/yaml/completion/3.0.0/c.yaml new file mode 100644 index 0000000..0a535f6 --- /dev/null +++ b/src/test/testData/yaml/completion/3.0.0/c.yaml @@ -0,0 +1,3 @@ +--- +asyncapi: 3.0.0 +c \ No newline at end of file diff --git "a/src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> \"p\".yaml" "b/src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> \"p\".yaml" new file mode 100644 index 0000000..0159a27 --- /dev/null +++ "b/src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> \"p\".yaml" @@ -0,0 +1,31 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/components/messages/UserSignedUp" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + "p" + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git "a/src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> \"p.yaml" "b/src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> \"p.yaml" new file mode 100644 index 0000000..65f38bd --- /dev/null +++ "b/src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> \"p.yaml" @@ -0,0 +1,31 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/components/messages/UserSignedUp" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + "p + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> p.yaml b/src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> p.yaml new file mode 100644 index 0000000..fff789b --- /dev/null +++ b/src/test/testData/yaml/completion/3.0.0/components -> messages -> UserSignedUp -> p.yaml @@ -0,0 +1,31 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/components/messages/UserSignedUp" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + p + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git "a/src/test/testData/yaml/completion/3.0.0/info -> \"i\".yaml" "b/src/test/testData/yaml/completion/3.0.0/info -> \"i\".yaml" new file mode 100644 index 0000000..be4b890 --- /dev/null +++ "b/src/test/testData/yaml/completion/3.0.0/info -> \"i\".yaml" @@ -0,0 +1,4 @@ +--- +asyncapi: 3.0.0 +info: + "i" \ No newline at end of file diff --git a/src/test/testData/yaml/completion/3.0.0/info -> i.yaml b/src/test/testData/yaml/completion/3.0.0/info -> i.yaml new file mode 100644 index 0000000..5cd62dd --- /dev/null +++ b/src/test/testData/yaml/completion/3.0.0/info -> i.yaml @@ -0,0 +1,4 @@ +--- +asyncapi: 3.0.0 +info: + i \ No newline at end of file From fcce095604d302ca1e890b7b41765834b25627d4 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sun, 10 Dec 2023 01:19:21 +0400 Subject: [PATCH 13/57] test: 3.0.0 AsyncAPISpecificationRecognizerTest --- .../AsyncAPISpecificationRecognizerTest.kt | 26 +++++++++++ src/test/resources/asyncapi-3.0.0.json | 46 +++++++++++++++++++ src/test/resources/asyncapi-3.0.0.yaml | 30 ++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 src/test/resources/asyncapi-3.0.0.json create mode 100644 src/test/resources/asyncapi-3.0.0.yaml diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt index 5a72dca..33a7c06 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt @@ -147,6 +147,20 @@ class AsyncAPISpecificationRecognizerTest: BasePlatformTestCase() { ) } + fun `test (json) - 3_0_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( + createFile("asyncapi-3.0.0.json", Language.findLanguageByID("JSON")!!), + "3.0.0" + ) + } + + fun `test (yaml) - 3_0_0 isSpecification(psiFile) when file is schema and not empty`() { + `test - isSpecification(psiFile) when file is schema and not empty`( + createFile("asyncapi-3.0.0.yaml", YAMLLanguage.INSTANCE), + "3.0.0" + ) + } + private fun `test - isSpecification(psiFile) when file is schema and not empty`(asyncApiFile: PsiFile, version: String) { val asyncAPISpecificationRecognizer = service() @@ -253,6 +267,18 @@ class AsyncAPISpecificationRecognizerTest: BasePlatformTestCase() { ) } + fun `test (json) - 3_0_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( + createFile("asyncapi-3.0.0.json", Language.findLanguageByID("JSON")!!, true) + ) + } + + fun `test (yaml) - 3_0_0 isSpecification(psiFile) when file is empty`() { + `test - isSpecification(psiFile) when file is empty`( + createFile("asyncapi-3.0.0.yaml", YAMLLanguage.INSTANCE, true) + ) + } + private fun `test - isSpecification(psiFile) when file is empty`(asyncApiFile: PsiFile) { val asyncAPISpecificationRecognizer = service() diff --git a/src/test/resources/asyncapi-3.0.0.json b/src/test/resources/asyncapi-3.0.0.json new file mode 100644 index 0000000..a1b3311 --- /dev/null +++ b/src/test/resources/asyncapi-3.0.0.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/messages/UserSignedUp" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/asyncapi-3.0.0.yaml b/src/test/resources/asyncapi-3.0.0.yaml new file mode 100644 index 0000000..0149fd6 --- /dev/null +++ b/src/test/resources/asyncapi-3.0.0.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/components/messages/UserSignedUp" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file From 1f7a088eefafbda3bf0c45498a49cd825c11a520 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sun, 10 Dec 2023 01:23:03 +0400 Subject: [PATCH 14/57] test: 3.0.0 AsyncAPIJsonSchemaProviderTest --- .../_core/AsyncAPIJsonSchemaProviderTest.kt | 46 ++++++++++++++++++- src/test/resources/asyncapi-3.99.99.json | 46 +++++++++++++++++++ src/test/resources/asyncapi-3.99.99.yaml | 30 ++++++++++++ 3 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/asyncapi-3.99.99.json create mode 100644 src/test/resources/asyncapi-3.99.99.yaml diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProviderTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProviderTest.kt index 8cea79b..683e463 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProviderTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProviderTest.kt @@ -159,7 +159,18 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.6.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (yaml) - provide when file is AsyncAPI schema with unknown version`() { + fun `test (yaml) - provide when file is 3_0_0 AsyncAPI schema`() { + val asyncAPIPSI = prepareFile("asyncapi-3.0.0", false) + TestCase.assertNotNull(asyncAPIPSI) + + val asyncAPIJsonSchemaProvider = service() + + val jsonSchemaObject = asyncAPIJsonSchemaProvider.provide(asyncAPIPSI, project) + TestCase.assertNotNull(jsonSchemaObject) + TestCase.assertEquals("/schema/asyncapi-3.0.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) + } + + fun `test (yaml) - v2 provide when file is AsyncAPI schema with unknown version`() { val asyncAPIPSI = prepareFile("asyncapi-2.99.99", false) TestCase.assertNotNull(asyncAPIPSI) @@ -169,6 +180,16 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertNull(jsonSchemaObject) } + fun `test (yaml) - v3 provide when file is AsyncAPI schema with unknown version`() { + val asyncAPIPSI = prepareFile("asyncapi-3.99.99", false) + TestCase.assertNotNull(asyncAPIPSI) + + val asyncAPIJsonSchemaProvider = service() + + val jsonSchemaObject = asyncAPIJsonSchemaProvider.provide(asyncAPIPSI, project) + TestCase.assertNull(jsonSchemaObject) + } + fun `test (json) - provide when file is 2_0_0 AsyncAPI schema`() { val asyncAPIPSI = prepareFile("asyncapi-2.0.0", true) TestCase.assertNotNull(asyncAPIPSI) @@ -246,7 +267,18 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.6.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (json) - provide when file is AsyncAPI schema with unknown version`() { + fun `test (json) - provide when file is 3_0_0 AsyncAPI schema`() { + val asyncAPIPSI = prepareFile("asyncapi-3.0.0", true) + TestCase.assertNotNull(asyncAPIPSI) + + val asyncAPIJsonSchemaProvider = service() + + val jsonSchemaObject = asyncAPIJsonSchemaProvider.provide(asyncAPIPSI, project) + TestCase.assertNotNull(jsonSchemaObject) + TestCase.assertEquals("/schema/asyncapi-3.0.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) + } + + fun `test (json) - v2 provide when file is AsyncAPI schema with unknown version`() { val asyncAPIPSI = prepareFile("asyncapi-2.99.99", true) TestCase.assertNotNull(asyncAPIPSI) @@ -256,6 +288,16 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertNull(jsonSchemaObject) } + fun `test (json) - v3 provide when file is AsyncAPI schema with unknown version`() { + val asyncAPIPSI = prepareFile("asyncapi-3.99.99", true) + TestCase.assertNotNull(asyncAPIPSI) + + val asyncAPIJsonSchemaProvider = service() + + val jsonSchemaObject = asyncAPIJsonSchemaProvider.provide(asyncAPIPSI, project) + TestCase.assertNull(jsonSchemaObject) + } + private fun prepareFile(fileName: String, isJson: Boolean ): PsiFile { val psiFileFactory = PsiFileFactory.getInstance(project) diff --git a/src/test/resources/asyncapi-3.99.99.json b/src/test/resources/asyncapi-3.99.99.json new file mode 100644 index 0000000..ccfea97 --- /dev/null +++ b/src/test/resources/asyncapi-3.99.99.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.99.99", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/messages/UserSignedUp" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/resources/asyncapi-3.99.99.yaml b/src/test/resources/asyncapi-3.99.99.yaml new file mode 100644 index 0000000..9c28050 --- /dev/null +++ b/src/test/resources/asyncapi-3.99.99.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.99.99 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/components/messages/UserSignedUp" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file From da89423aaf016da102d1bdb44f49180cca366ef5 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sun, 10 Dec 2023 01:26:47 +0400 Subject: [PATCH 15/57] refactor: rename AsyncAPISpecificationRecognizerTest method names --- .../AsyncAPISpecificationRecognizerTest.kt | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt index 33a7c06..83f71b6 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationRecognizerTest.kt @@ -49,119 +49,119 @@ class AsyncAPISpecificationRecognizerTest: BasePlatformTestCase() { ) } - fun `test (json) - 2_0_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (json) - 2_0_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.0.0.json", Language.findLanguageByID("JSON")!!), "2.0.0" ) } - fun `test (yaml) - 2_0_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_0_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.0.0.yaml", YAMLLanguage.INSTANCE), "2.0.0" ) } - fun `test (json) - 2_1_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (json) - 2_1_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.1.0.json", Language.findLanguageByID("JSON")!!), "2.1.0" ) } - fun `test (yaml) - 2_1_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_1_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.1.0.yaml", YAMLLanguage.INSTANCE), "2.1.0" ) } - fun `test (json) - 2_2_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (json) - 2_2_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.2.0.json", Language.findLanguageByID("JSON")!!), "2.2.0" ) } - fun `test (yaml) - 2_2_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_2_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.2.0.yaml", YAMLLanguage.INSTANCE), "2.2.0" ) } - fun `test (json) - 2_3_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (json) - 2_3_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.3.0.json", Language.findLanguageByID("JSON")!!), "2.3.0" ) } - fun `test (yaml) - 2_3_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_3_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.3.0.yaml", YAMLLanguage.INSTANCE), "2.3.0" ) } - fun `test (json) - 2_4_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (json) - 2_4_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.4.0.json", Language.findLanguageByID("JSON")!!), "2.4.0" ) } - fun `test (yaml) - 2_4_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_4_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.4.0.yaml", YAMLLanguage.INSTANCE), "2.4.0" ) } - fun `test (json) - 2_5_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (json) - 2_5_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.5.0.json", Language.findLanguageByID("JSON")!!), "2.5.0" ) } - fun `test (yaml) - 2_5_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_5_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.5.0.yaml", YAMLLanguage.INSTANCE), "2.5.0" ) } - fun `test (json) - 2_6_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (json) - 2_6_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.6.0.json", Language.findLanguageByID("JSON")!!), "2.6.0" ) } - fun `test (yaml) - 2_6_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (yaml) - 2_6_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-2.6.0.yaml", YAMLLanguage.INSTANCE), "2.6.0" ) } - fun `test (json) - 3_0_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (json) - 3_0_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-3.0.0.json", Language.findLanguageByID("JSON")!!), "3.0.0" ) } - fun `test (yaml) - 3_0_0 isSpecification(psiFile) when file is schema and not empty`() { - `test - isSpecification(psiFile) when file is schema and not empty`( + fun `test (yaml) - 3_0_0 isSpecification(psiFile) when file is specification and not empty`() { + `test - isSpecification(psiFile) when file is specification and not empty`( createFile("asyncapi-3.0.0.yaml", YAMLLanguage.INSTANCE), "3.0.0" ) } - private fun `test - isSpecification(psiFile) when file is schema and not empty`(asyncApiFile: PsiFile, version: String) { + private fun `test - isSpecification(psiFile) when file is specification and not empty`(asyncApiFile: PsiFile, version: String) { val asyncAPISpecificationRecognizer = service() TestCase.assertTrue( From f1d06e09f9301f255cc62753c75b1f7263e13839 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Sun, 10 Dec 2023 01:33:16 +0400 Subject: [PATCH 16/57] refactor: rename AsyncAPISchemaReferenceContributor to AsyncAPISpecificationReferenceContributor --- ...ibutor.kt => AsyncAPISpecificationReferenceContributor.kt} | 2 +- ...ibutor.kt => AsyncAPISpecificationReferenceContributor.kt} | 2 +- src/main/resources/META-INF/plugin.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/json/{AsyncAPISchemaReferenceContributor.kt => AsyncAPISpecificationReferenceContributor.kt} (95%) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/yaml/{AsyncAPISchemaReferenceContributor.kt => AsyncAPISpecificationReferenceContributor.kt} (96%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/json/AsyncAPISchemaReferenceContributor.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/json/AsyncAPISpecificationReferenceContributor.kt similarity index 95% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/json/AsyncAPISchemaReferenceContributor.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/json/AsyncAPISpecificationReferenceContributor.kt index a6f3dc0..d3d059b 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/json/AsyncAPISchemaReferenceContributor.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/json/AsyncAPISpecificationReferenceContributor.kt @@ -13,7 +13,7 @@ import com.intellij.psi.PsiReferenceRegistrar /** * @author Pavel Bodiachevskii */ -class AsyncAPISchemaReferenceContributor: PsiReferenceContributor() { +class AsyncAPISpecificationReferenceContributor: PsiReferenceContributor() { override fun registerReferenceProviders(registrar: PsiReferenceRegistrar) { registrar.registerReferenceProvider(localReferencePattern(), AsyncAPILocalReferenceProvider()) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/yaml/AsyncAPISchemaReferenceContributor.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/yaml/AsyncAPISpecificationReferenceContributor.kt similarity index 96% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/yaml/AsyncAPISchemaReferenceContributor.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/yaml/AsyncAPISpecificationReferenceContributor.kt index c725f56..41e5f36 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/yaml/AsyncAPISchemaReferenceContributor.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/contributor/yaml/AsyncAPISpecificationReferenceContributor.kt @@ -14,7 +14,7 @@ import org.jetbrains.yaml.psi.YAMLValue /** * @author Pavel Bodiachevskii */ -class AsyncAPISchemaReferenceContributor: PsiReferenceContributor() { +class AsyncAPISpecificationReferenceContributor: PsiReferenceContributor() { override fun registerReferenceProviders(registrar: PsiReferenceRegistrar) { registrar.registerReferenceProvider(localReferencePattern(), AsyncAPILocalReferenceProvider()) diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 48ca605..1e263f8 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -48,8 +48,8 @@ - - + + From e51a8d6101ac3c8a999a15df7ffa43d96e04cbcf Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 03:22:11 +0400 Subject: [PATCH 17/57] refactor: rename AsyncAPISchemaReferencesCollector to AsyncAPISpecificationReferencesCollector --- ...=> AsyncAPISpecificationReferencesCollector.kt} | 14 +++++++------- .../idea/extensions/index/AsyncAPISchemaIndexer.kt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/_core/{AsyncAPISchemaReferencesCollector.kt => AsyncAPISpecificationReferencesCollector.kt} (90%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaReferencesCollector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationReferencesCollector.kt similarity index 90% rename from src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaReferencesCollector.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationReferencesCollector.kt index e89d0ce..167cff1 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISchemaReferencesCollector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationReferencesCollector.kt @@ -11,9 +11,9 @@ import org.jetbrains.yaml.psi.YAMLFile /** * @author Pavel Bodiachevskii */ -class AsyncAPISchemaReferencesCollector( - private val asyncAPISchema: PsiFile, - private val asyncAPISchemaDir: VirtualFile, +class AsyncAPISpecificationReferencesCollector( + private val asyncAPISpecification: PsiFile, + private val asyncAPISpecificationDir: VirtualFile, ) { fun collectFiles(): Map> { @@ -24,7 +24,7 @@ class AsyncAPISchemaReferencesCollector( .filter { isFileReference(it) } .map { cutReferenceToPropertyIfExists(it) } .filter { isJsonOrYaml(it) } - .mapNotNull { asyncAPISchemaDir.findFileByRelativePath(it)?.path } + .mapNotNull { asyncAPISpecificationDir.findFileByRelativePath(it)?.path } .toSet() } @@ -32,9 +32,9 @@ class AsyncAPISchemaReferencesCollector( } private fun collect(xpath: String): List { - return when (asyncAPISchema) { - is JsonFile -> return JsonFileXPath.findText(asyncAPISchema, xpath) - is YAMLFile -> return YamlFileXPath.findText(asyncAPISchema, xpath) + return when (asyncAPISpecification) { + is JsonFile -> return JsonFileXPath.findText(asyncAPISpecification, xpath) + is YAMLFile -> return YamlFileXPath.findText(asyncAPISpecification, xpath) else -> emptyList() } } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt index 9d9529f..4efdc15 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt @@ -1,7 +1,7 @@ package com.asyncapi.plugin.idea.extensions.index import com.asyncapi.plugin.idea._core.AsyncAPISpecificationRecognizer -import com.asyncapi.plugin.idea._core.AsyncAPISchemaReferencesCollector +import com.asyncapi.plugin.idea._core.AsyncAPISpecificationReferencesCollector import com.intellij.json.psi.JsonFile import com.intellij.openapi.components.service import com.intellij.util.indexing.DataIndexer @@ -31,7 +31,7 @@ class AsyncAPISchemaIndexer: DataIndexer, FileContent> { index[AsyncAPISchemaIndex.asyncapi] = setOf(inputData.file.path) var foundReferences = emptySet() - AsyncAPISchemaReferencesCollector(asyncapiSchema, inputData.file.parent).collectFiles().forEach { (referenceType, references) -> + AsyncAPISpecificationReferencesCollector(asyncapiSchema, inputData.file.parent).collectFiles().forEach { (referenceType, references) -> index[referenceType] = references foundReferences = foundReferences.plus(references) From 46e1bb3f025f10252c8defba78ab2e0a8feadecc Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 03:46:33 +0400 Subject: [PATCH 18/57] refactor: AsyncAPISpecificationReferencesCollector move from _core to extensions.index --- .../plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt | 1 - .../index}/AsyncAPISpecificationReferencesCollector.kt | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/{_core => extensions/index}/AsyncAPISpecificationReferencesCollector.kt (96%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt index 4efdc15..e9f950a 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt @@ -1,7 +1,6 @@ package com.asyncapi.plugin.idea.extensions.index import com.asyncapi.plugin.idea._core.AsyncAPISpecificationRecognizer -import com.asyncapi.plugin.idea._core.AsyncAPISpecificationReferencesCollector import com.intellij.json.psi.JsonFile import com.intellij.openapi.components.service import com.intellij.util.indexing.DataIndexer diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationReferencesCollector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt similarity index 96% rename from src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationReferencesCollector.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt index 167cff1..914f30f 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationReferencesCollector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt @@ -1,8 +1,7 @@ -package com.asyncapi.plugin.idea._core +package com.asyncapi.plugin.idea.extensions.index import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath import com.asyncapi.plugin.idea._core.xpath.YamlFileXPath -import com.asyncapi.plugin.idea.extensions.index.AsyncAPISchemaIndex import com.intellij.json.psi.JsonFile import com.intellij.openapi.vfs.VirtualFile import com.intellij.psi.PsiFile From c5cd3c2e241f7a346c988cc4bceab7997a96e9be Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 03:50:34 +0400 Subject: [PATCH 19/57] refactor: rename AsyncAPISchemaIndex to AsyncAPISpecificationIndex --- .../extensions/index/AsyncAPISchemaIndexer.kt | 4 ++-- ...emaIndex.kt => AsyncAPISpecificationIndex.kt} | 2 +- .../AsyncAPISpecificationReferencesCollector.kt | 16 ++++++++-------- .../inspection/AsyncAPISchemaDetector.kt | 10 +++++----- src/main/resources/META-INF/plugin.xml | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/{AsyncAPISchemaIndex.kt => AsyncAPISpecificationIndex.kt} (96%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt index e9f950a..6ee6f9a 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt @@ -28,13 +28,13 @@ class AsyncAPISchemaIndexer: DataIndexer, FileContent> { } asyncapiSchema ?: return index - index[AsyncAPISchemaIndex.asyncapi] = setOf(inputData.file.path) + index[AsyncAPISpecificationIndex.asyncapi] = setOf(inputData.file.path) var foundReferences = emptySet() AsyncAPISpecificationReferencesCollector(asyncapiSchema, inputData.file.parent).collectFiles().forEach { (referenceType, references) -> index[referenceType] = references foundReferences = foundReferences.plus(references) - index[AsyncAPISchemaIndex.references] = foundReferences + index[AsyncAPISpecificationIndex.references] = foundReferences } return index diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndex.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt similarity index 96% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndex.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt index 67d4cfd..1e04d03 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndex.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt @@ -14,7 +14,7 @@ import java.io.DataOutput * I use [Set] because of cases when schema has multiple references to schemas. * @author Pavel Bodiachevskii */ -class AsyncAPISchemaIndex: FileBasedIndexExtension>() { +class AsyncAPISpecificationIndex: FileBasedIndexExtension>() { override fun getName(): ID> = asyncapiIndexId diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt index 914f30f..890e9e3 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt @@ -54,28 +54,28 @@ class AsyncAPISpecificationReferencesCollector( companion object { val possibleReferencesLocation = mapOf( - AsyncAPISchemaIndex.channels to setOf("\$.channels.*.\$ref"), - AsyncAPISchemaIndex.parameters to setOf( + AsyncAPISpecificationIndex.channels to setOf("\$.channels.*.\$ref"), + AsyncAPISpecificationIndex.parameters to setOf( "\$.channels.*.parameters.*.\$ref", "\$.components.parameters.*.\$ref" ), - AsyncAPISchemaIndex.traits to setOf( + AsyncAPISpecificationIndex.traits to setOf( "\$.channels.*.subscribe.traits.*.\$ref", "\$.channels.*.publish.traits.*.\$ref", "\$.components.messages.*.traits.*.\$ref" ), - AsyncAPISchemaIndex.messages to setOf( + AsyncAPISpecificationIndex.messages to setOf( "\$.channels.*.subscribe.message.\$ref", "\$.channels.*.publish.message.\$ref", "\$.components.messages.*.\$ref" ), - AsyncAPISchemaIndex.schemas to setOf("\$.components.schemas.*.\$ref"), - AsyncAPISchemaIndex.securitySchemes to setOf("\$.components.securitySchemes.*.\$ref"), - AsyncAPISchemaIndex.correlationIds to setOf( + AsyncAPISpecificationIndex.schemas to setOf("\$.components.schemas.*.\$ref"), + AsyncAPISpecificationIndex.securitySchemes to setOf("\$.components.securitySchemes.*.\$ref"), + AsyncAPISpecificationIndex.correlationIds to setOf( "\$.components.messages.*.correlationId.\$ref", "\$.components.messages.*.traits.*.correlationId.\$ref" ), - AsyncAPISchemaIndex.headers to setOf( + AsyncAPISpecificationIndex.headers to setOf( "\$.components.messages.*.headers.\$ref", "\$.components.messages.*.traits.*.headers.\$ref" ) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISchemaDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISchemaDetector.kt index d9e1e76..df2fedc 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISchemaDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISchemaDetector.kt @@ -1,6 +1,6 @@ package com.asyncapi.plugin.idea.extensions.inspection -import com.asyncapi.plugin.idea.extensions.index.AsyncAPISchemaIndex +import com.asyncapi.plugin.idea.extensions.index.AsyncAPISpecificationIndex import com.intellij.json.psi.JsonFile import com.intellij.psi.PsiFile import com.intellij.psi.search.GlobalSearchScope @@ -68,16 +68,16 @@ class AsyncAPISchemaDetector { private fun indexedAsyncAPISchemas(asyncapiSchema: PsiFile): List { return FileBasedIndex.getInstance().getValues( - AsyncAPISchemaIndex.asyncapiIndexId, - AsyncAPISchemaIndex.asyncapi, + AsyncAPISpecificationIndex.asyncapiIndexId, + AsyncAPISpecificationIndex.asyncapi, GlobalSearchScope.allScope(asyncapiSchema.project) ).flatten() } private fun indexedReferencedAsyncAPISchemas(asyncapiSchema: PsiFile): List { return FileBasedIndex.getInstance().getValues( - AsyncAPISchemaIndex.asyncapiIndexId, - AsyncAPISchemaIndex.references, + AsyncAPISpecificationIndex.asyncapiIndexId, + AsyncAPISpecificationIndex.references, GlobalSearchScope.allScope(asyncapiSchema.project) ).flatten() } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 1e263f8..687bc0d 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -45,7 +45,7 @@ - + From 7c9625e3a3a0eb97784cdf8401747a9efaa097f8 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 03:52:57 +0400 Subject: [PATCH 20/57] refactor: rename AsyncAPISchemaIndexer to AsyncAPISpecificationIndexer --- .../idea/extensions/index/AsyncAPISpecificationIndex.kt | 2 +- ...PISchemaIndexer.kt => AsyncAPISpecificationIndexer.kt} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/{AsyncAPISchemaIndexer.kt => AsyncAPISpecificationIndexer.kt} (78%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt index 1e04d03..38f8710 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt @@ -18,7 +18,7 @@ class AsyncAPISpecificationIndex: FileBasedIndexExtension>() override fun getName(): ID> = asyncapiIndexId - override fun getIndexer(): DataIndexer, FileContent> = AsyncAPISchemaIndexer() + override fun getIndexer(): DataIndexer, FileContent> = AsyncAPISpecificationIndexer() override fun getKeyDescriptor(): KeyDescriptor = EnumeratorStringDescriptor.INSTANCE diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndexer.kt similarity index 78% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndexer.kt index 6ee6f9a..fed351a 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISchemaIndexer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndexer.kt @@ -10,7 +10,7 @@ import org.jetbrains.yaml.psi.YAMLFile /** * @author Pavel Bodiachevskii */ -class AsyncAPISchemaIndexer: DataIndexer, FileContent> { +class AsyncAPISpecificationIndexer: DataIndexer, FileContent> { private val asyncAPISpecificationRecognizer = service() @@ -21,16 +21,16 @@ class AsyncAPISchemaIndexer: DataIndexer, FileContent> { return index } - val asyncapiSchema = when(inputData.psiFile) { + val asyncapiSpecification = when(inputData.psiFile) { is JsonFile -> inputData.psiFile as JsonFile is YAMLFile -> inputData.psiFile as YAMLFile else -> null } - asyncapiSchema ?: return index + asyncapiSpecification ?: return index index[AsyncAPISpecificationIndex.asyncapi] = setOf(inputData.file.path) var foundReferences = emptySet() - AsyncAPISpecificationReferencesCollector(asyncapiSchema, inputData.file.parent).collectFiles().forEach { (referenceType, references) -> + AsyncAPISpecificationReferencesCollector(asyncapiSpecification, inputData.file.parent).collectFiles().forEach { (referenceType, references) -> index[referenceType] = references foundReferences = foundReferences.plus(references) From 1f0d9b3e20baf2a2824284b80a61b6fe37be570c Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 03:57:56 +0400 Subject: [PATCH 21/57] refactor: rename AsyncAPISchemaDetector to AsyncAPISpecificationDetector --- .../plugin/idea/extensions/icon/AsyncAPIIconProvider.kt | 8 ++++---- .../extensions/inspection/AsyncAPIJsonSchemaInspection.kt | 4 ++-- ...SchemaDetector.kt => AsyncAPISpecificationDetector.kt} | 2 +- .../extensions/inspection/AsyncAPIYamlSchemaInspection.kt | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/{AsyncAPISchemaDetector.kt => AsyncAPISpecificationDetector.kt} (98%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt index 9257b0f..1d0a5fe 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt @@ -1,6 +1,6 @@ package com.asyncapi.plugin.idea.extensions.icon -import com.asyncapi.plugin.idea.extensions.inspection.AsyncAPISchemaDetector +import com.asyncapi.plugin.idea.extensions.inspection.AsyncAPISpecificationDetector import com.intellij.ide.IconProvider import com.intellij.json.psi.JsonFile import com.intellij.psi.PsiElement @@ -13,12 +13,12 @@ import javax.swing.Icon */ class AsyncAPIIconProvider: IconProvider() { - private val asyncApiSchemaDetector = AsyncAPISchemaDetector() + private val asyncApiSpecificationDetector = AsyncAPISpecificationDetector() override fun getIcon(element: PsiElement, flags: Int): Icon? { if (element is JsonFile || element is YAMLFile) { - if (asyncApiSchemaDetector.isAsyncAPISchema(element as? PsiFile) || - asyncApiSchemaDetector.isReferencedAsyncAPISchema(element as? PsiFile) + if (asyncApiSpecificationDetector.isAsyncAPISchema(element as? PsiFile) || + asyncApiSpecificationDetector.isReferencedAsyncAPISchema(element as? PsiFile) ) { return Icons.ASYNCAPI_ICON } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt index 30b99f8..0275624 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt @@ -17,11 +17,11 @@ import com.jetbrains.jsonSchema.impl.JsonSchemaComplianceChecker */ class AsyncAPIJsonSchemaInspection: LocalInspectionTool() { - private val asyncAPISchemaDetector = AsyncAPISchemaDetector() + private val asyncAPISpecificationDetector = AsyncAPISpecificationDetector() private val asyncAPIJsonSchemaProvider = service() override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean, session: LocalInspectionToolSession): PsiElementVisitor { - if (!asyncAPISchemaDetector.isAsyncAPIJsonSchema(holder.file)) { + if (!asyncAPISpecificationDetector.isAsyncAPIJsonSchema(holder.file)) { return PsiElementVisitor.EMPTY_VISITOR } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISchemaDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt similarity index 98% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISchemaDetector.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index df2fedc..7cdcec8 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISchemaDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -10,7 +10,7 @@ import org.jetbrains.yaml.psi.YAMLFile /** * @author Pavel Bodiachevskii */ -class AsyncAPISchemaDetector { +class AsyncAPISpecificationDetector { fun isAsyncAPIJsonSchema(psiFile: PsiFile?): Boolean { psiFile ?: return false diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt index 692a0e2..6c8738a 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt @@ -18,11 +18,11 @@ import org.jetbrains.yaml.psi.YamlPsiElementVisitor */ class AsyncAPIYamlSchemaInspection: LocalInspectionTool() { - private val asyncAPISchemaDetector = AsyncAPISchemaDetector() + private val asyncAPISpecificationDetector = AsyncAPISpecificationDetector() private val asyncAPIJsonSchemaProvider = service() override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean, session: LocalInspectionToolSession): PsiElementVisitor { - if (!asyncAPISchemaDetector.isAsyncAPIYamlSchema(holder.file)) { + if (!asyncAPISpecificationDetector.isAsyncAPIYamlSchema(holder.file)) { return PsiElementVisitor.EMPTY_VISITOR } From 701f87a4c22a84782d56970fa67b7f22f91b3816 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 04:02:58 +0400 Subject: [PATCH 22/57] refactor: move v2 index to v2 package --- .../extensions/index/{ => v2}/AsyncAPISpecificationIndex.kt | 2 +- .../extensions/index/{ => v2}/AsyncAPISpecificationIndexer.kt | 2 +- .../index/{ => v2}/AsyncAPISpecificationReferencesCollector.kt | 2 +- .../idea/extensions/inspection/AsyncAPISpecificationDetector.kt | 2 +- src/main/resources/META-INF/plugin.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/{ => v2}/AsyncAPISpecificationIndex.kt (97%) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/{ => v2}/AsyncAPISpecificationIndexer.kt (96%) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/{ => v2}/AsyncAPISpecificationReferencesCollector.kt (98%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndex.kt similarity index 97% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndex.kt index 38f8710..968be70 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndex.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndex.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.extensions.index +package com.asyncapi.plugin.idea.extensions.index.v2 import com.intellij.json.JsonFileType import com.intellij.util.indexing.* diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndexer.kt similarity index 96% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndexer.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndexer.kt index fed351a..ad0e00b 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationIndexer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndexer.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.extensions.index +package com.asyncapi.plugin.idea.extensions.index.v2 import com.asyncapi.plugin.idea._core.AsyncAPISpecificationRecognizer import com.intellij.json.psi.JsonFile diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationReferencesCollector.kt similarity index 98% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationReferencesCollector.kt index 890e9e3..387f7c5 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AsyncAPISpecificationReferencesCollector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationReferencesCollector.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.extensions.index +package com.asyncapi.plugin.idea.extensions.index.v2 import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath import com.asyncapi.plugin.idea._core.xpath.YamlFileXPath diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index 7cdcec8..95d6bba 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -1,6 +1,6 @@ package com.asyncapi.plugin.idea.extensions.inspection -import com.asyncapi.plugin.idea.extensions.index.AsyncAPISpecificationIndex +import com.asyncapi.plugin.idea.extensions.index.v2.AsyncAPISpecificationIndex import com.intellij.json.psi.JsonFile import com.intellij.psi.PsiFile import com.intellij.psi.search.GlobalSearchScope diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 687bc0d..810c746 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -45,7 +45,7 @@ - + From 8718b3dd367e9d008b1d9e70405e36e62806a13d Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 04:04:18 +0400 Subject: [PATCH 23/57] refactor: rename AsyncAPISpecificationDetector isAsyncAPISchema to isAsyncAPISpecification --- .../plugin/idea/extensions/icon/AsyncAPIIconProvider.kt | 2 +- .../idea/extensions/inspection/AsyncAPISpecificationDetector.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt index 1d0a5fe..92a2e48 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt @@ -17,7 +17,7 @@ class AsyncAPIIconProvider: IconProvider() { override fun getIcon(element: PsiElement, flags: Int): Icon? { if (element is JsonFile || element is YAMLFile) { - if (asyncApiSpecificationDetector.isAsyncAPISchema(element as? PsiFile) || + if (asyncApiSpecificationDetector.isAsyncAPISpecification(element as? PsiFile) || asyncApiSpecificationDetector.isReferencedAsyncAPISchema(element as? PsiFile) ) { return Icons.ASYNCAPI_ICON diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index 95d6bba..91cf8d9 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -30,7 +30,7 @@ class AsyncAPISpecificationDetector { return indexedAsyncAPISchemas(psiFile).contains(psiFile.virtualFile?.path) } - fun isAsyncAPISchema(psiFile: PsiFile?): Boolean { + fun isAsyncAPISpecification(psiFile: PsiFile?): Boolean { psiFile ?: return false return when (psiFile) { is JsonFile -> return isAsyncAPIJsonSchema(psiFile) From 878611cb31469c54b50398deea3b30f9d1e3fe01 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 04:08:11 +0400 Subject: [PATCH 24/57] refactor: rename AsyncAPISpecificationDetector isReferencedAsyncAPISchema to isAsyncAPISpecificationComponent --- .../plugin/idea/extensions/icon/AsyncAPIIconProvider.kt | 2 +- .../idea/extensions/inspection/AsyncAPISpecificationDetector.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt index 92a2e48..eebadd5 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/icon/AsyncAPIIconProvider.kt @@ -18,7 +18,7 @@ class AsyncAPIIconProvider: IconProvider() { override fun getIcon(element: PsiElement, flags: Int): Icon? { if (element is JsonFile || element is YAMLFile) { if (asyncApiSpecificationDetector.isAsyncAPISpecification(element as? PsiFile) || - asyncApiSpecificationDetector.isReferencedAsyncAPISchema(element as? PsiFile) + asyncApiSpecificationDetector.isAsyncAPISpecificationComponent(element as? PsiFile) ) { return Icons.ASYNCAPI_ICON } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index 91cf8d9..39460e6 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -57,7 +57,7 @@ class AsyncAPISpecificationDetector { return indexedReferencedAsyncAPISchemas(psiFile).contains(psiFile.virtualFile?.path) } - fun isReferencedAsyncAPISchema(psiFile: PsiFile?): Boolean { + fun isAsyncAPISpecificationComponent(psiFile: PsiFile?): Boolean { psiFile ?: return false return when (psiFile) { is JsonFile -> return isReferencedAsyncAPIJsonSchema(psiFile) From f384a871201ee9ab0859f0978bf488dd6731587e Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 04:10:14 +0400 Subject: [PATCH 25/57] refactor: rename and make private AsyncAPISpecificationDetector#isReferencedAsyncAPIJsonSchema to isAsyncAPISpecificationJsonComponent --- .../extensions/inspection/AsyncAPISpecificationDetector.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index 39460e6..fe550c5 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -39,7 +39,7 @@ class AsyncAPISpecificationDetector { } } - fun isReferencedAsyncAPIJsonSchema(psiFile: PsiFile?): Boolean { + private fun isAsyncAPISpecificationJsonComponent(psiFile: PsiFile?): Boolean { psiFile ?: return false if (psiFile !is JsonFile) { return false @@ -60,7 +60,7 @@ class AsyncAPISpecificationDetector { fun isAsyncAPISpecificationComponent(psiFile: PsiFile?): Boolean { psiFile ?: return false return when (psiFile) { - is JsonFile -> return isReferencedAsyncAPIJsonSchema(psiFile) + is JsonFile -> return isAsyncAPISpecificationJsonComponent(psiFile) is YAMLFile -> return isReferencedAsyncAPIYamlSchema(psiFile) else -> false } From 7c9d2fb109884f46ed66ea73a22a8b84185d2e70 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 04:13:46 +0400 Subject: [PATCH 26/57] refactor: rename and make private AsyncAPISpecificationDetector#isReferencedAsyncAPIYamlSchema to isAsyncAPISpecificationYamlComponent --- .../extensions/inspection/AsyncAPISpecificationDetector.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index fe550c5..55dbfcd 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -48,7 +48,7 @@ class AsyncAPISpecificationDetector { return indexedReferencedAsyncAPISchemas(psiFile).contains(psiFile.virtualFile?.path) } - fun isReferencedAsyncAPIYamlSchema(psiFile: PsiFile?): Boolean { + private fun isAsyncAPISpecificationYamlComponent(psiFile: PsiFile?): Boolean { psiFile ?: return false if (psiFile !is YAMLFile) { return false @@ -61,7 +61,7 @@ class AsyncAPISpecificationDetector { psiFile ?: return false return when (psiFile) { is JsonFile -> return isAsyncAPISpecificationJsonComponent(psiFile) - is YAMLFile -> return isReferencedAsyncAPIYamlSchema(psiFile) + is YAMLFile -> return isAsyncAPISpecificationYamlComponent(psiFile) else -> false } } From 547e3f3ea37cdaa845ee24adb2e445369e5a6374 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 04:17:51 +0400 Subject: [PATCH 27/57] refactor: rename AsyncAPISpecificationDetector#indexedAsyncAPISchemas to indexedAsyncAPISpecifications --- .../extensions/inspection/AsyncAPISpecificationDetector.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index 55dbfcd..381ec87 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -18,7 +18,7 @@ class AsyncAPISpecificationDetector { return false } - return indexedAsyncAPISchemas(psiFile).contains(psiFile.virtualFile?.path) + return indexedAsyncAPISpecifications(psiFile).contains(psiFile.virtualFile?.path) } fun isAsyncAPIYamlSchema(psiFile: PsiFile?): Boolean { @@ -27,7 +27,7 @@ class AsyncAPISpecificationDetector { return false } - return indexedAsyncAPISchemas(psiFile).contains(psiFile.virtualFile?.path) + return indexedAsyncAPISpecifications(psiFile).contains(psiFile.virtualFile?.path) } fun isAsyncAPISpecification(psiFile: PsiFile?): Boolean { @@ -66,7 +66,7 @@ class AsyncAPISpecificationDetector { } } - private fun indexedAsyncAPISchemas(asyncapiSchema: PsiFile): List { + private fun indexedAsyncAPISpecifications(asyncapiSchema: PsiFile): List { return FileBasedIndex.getInstance().getValues( AsyncAPISpecificationIndex.asyncapiIndexId, AsyncAPISpecificationIndex.asyncapi, From 68ecac752bd40585bab6aa4f9d2e0afd19cf47cb Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Mon, 11 Dec 2023 04:19:41 +0400 Subject: [PATCH 28/57] refactor: rename AsyncAPISpecificationDetector#indexedReferencedAsyncAPISchemas to indexedAsyncAPISpecificationReferences --- .../extensions/inspection/AsyncAPISpecificationDetector.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index 381ec87..d5cd2fe 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -45,7 +45,7 @@ class AsyncAPISpecificationDetector { return false } - return indexedReferencedAsyncAPISchemas(psiFile).contains(psiFile.virtualFile?.path) + return indexedAsyncAPISpecificationReferences(psiFile).contains(psiFile.virtualFile?.path) } private fun isAsyncAPISpecificationYamlComponent(psiFile: PsiFile?): Boolean { @@ -54,7 +54,7 @@ class AsyncAPISpecificationDetector { return false } - return indexedReferencedAsyncAPISchemas(psiFile).contains(psiFile.virtualFile?.path) + return indexedAsyncAPISpecificationReferences(psiFile).contains(psiFile.virtualFile?.path) } fun isAsyncAPISpecificationComponent(psiFile: PsiFile?): Boolean { @@ -74,7 +74,7 @@ class AsyncAPISpecificationDetector { ).flatten() } - private fun indexedReferencedAsyncAPISchemas(asyncapiSchema: PsiFile): List { + private fun indexedAsyncAPISpecificationReferences(asyncapiSchema: PsiFile): List { return FileBasedIndex.getInstance().getValues( AsyncAPISpecificationIndex.asyncapiIndexId, AsyncAPISpecificationIndex.references, From 55b844fd92c93940ef8f7de66029cc1ee44fef13 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:03:05 +0400 Subject: [PATCH 29/57] feat: v3 index --- .../AbstractAsyncAPISpecificationIndexer.kt | 54 +++++++++ ...syncAPISpecificationReferencesCollector.kt | 57 ++++++++++ .../index/v2/AsyncAPISpecificationIndexer.kt | 43 ++------ ...syncAPISpecificationReferencesCollector.kt | 104 ++++++------------ .../index/v3/AsyncAPISpecificationIndex.kt | 64 +++++++++++ .../index/v3/AsyncAPISpecificationIndexer.kt | 24 ++++ ...syncAPISpecificationReferencesCollector.kt | 19 ++++ src/main/resources/META-INF/plugin.xml | 3 +- 8 files changed, 264 insertions(+), 104 deletions(-) create mode 100644 src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AbstractAsyncAPISpecificationIndexer.kt create mode 100644 src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AbstractAsyncAPISpecificationReferencesCollector.kt create mode 100644 src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt create mode 100644 src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndexer.kt create mode 100644 src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationReferencesCollector.kt diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AbstractAsyncAPISpecificationIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AbstractAsyncAPISpecificationIndexer.kt new file mode 100644 index 0000000..8de4e0c --- /dev/null +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AbstractAsyncAPISpecificationIndexer.kt @@ -0,0 +1,54 @@ +package com.asyncapi.plugin.idea.extensions.index + +import com.asyncapi.plugin.idea._core.AsyncAPISpecificationRecognizer +import com.intellij.json.psi.JsonFile +import com.intellij.openapi.components.service +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.PsiFile +import com.intellij.util.indexing.DataIndexer +import com.intellij.util.indexing.FileContent +import org.jetbrains.yaml.psi.YAMLFile + +/** + * @author Pavel Bodiachevskii + */ +abstract class AbstractAsyncAPISpecificationIndexer: DataIndexer, FileContent> { + + private val asyncAPISpecificationRecognizer = service() + + abstract fun asyncapiIndexKey(): String + + abstract fun referencesIndexKey(): String + + abstract fun asyncAPISpecificationReferencesCollector( + asyncAPISpecification: PsiFile, + asyncAPISpecificationDir: VirtualFile + ): AbstractAsyncAPISpecificationReferencesCollector + + override fun map(inputData: FileContent): MutableMap> { + val index = mutableMapOf>() + + if (!asyncAPISpecificationRecognizer.isSpecification(inputData.psiFile)) { + return index + } + + val asyncapiSpecification = when(inputData.psiFile) { + is JsonFile -> inputData.psiFile as JsonFile + is YAMLFile -> inputData.psiFile as YAMLFile + else -> null + } + asyncapiSpecification ?: return index + + index[asyncapiIndexKey()] = setOf(inputData.file.path) + var foundReferences = emptySet() + asyncAPISpecificationReferencesCollector(asyncapiSpecification, inputData.file.parent).collectFiles().forEach { (referenceType, references) -> + index[referenceType] = references + + foundReferences = foundReferences.plus(references) + index[referencesIndexKey()] = foundReferences + } + + return index + } + +} \ No newline at end of file diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AbstractAsyncAPISpecificationReferencesCollector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AbstractAsyncAPISpecificationReferencesCollector.kt new file mode 100644 index 0000000..4c920ab --- /dev/null +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/AbstractAsyncAPISpecificationReferencesCollector.kt @@ -0,0 +1,57 @@ +package com.asyncapi.plugin.idea.extensions.index + +import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath +import com.asyncapi.plugin.idea._core.xpath.YamlFileXPath +import com.intellij.json.psi.JsonFile +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.PsiFile +import org.jetbrains.yaml.psi.YAMLFile + +/** + * @author Pavel Bodiachevskii + */ +abstract class AbstractAsyncAPISpecificationReferencesCollector( + private val asyncAPISpecification: PsiFile, + private val asyncAPISpecificationDir: VirtualFile, +) { + + abstract fun possibleReferencesLocation(): Map> + + fun collectFiles(): Map> { + val references = mutableMapOf>() + possibleReferencesLocation().forEach { (referenceLocation, xpaths) -> + references[referenceLocation] = xpaths.flatMap { collect(it) } + .asSequence() + .filter { isFileReference(it) } + .map { cutReferenceToPropertyIfExists(it) } + .filter { isJsonOrYaml(it) } + .mapNotNull { asyncAPISpecificationDir.findFileByRelativePath(it)?.path } + .toSet() + } + + return references + } + + private fun collect(xpath: String): List { + return when (asyncAPISpecification) { + is JsonFile -> return JsonFileXPath.findText(asyncAPISpecification, xpath) + is YAMLFile -> return YamlFileXPath.findText(asyncAPISpecification, xpath) + else -> emptyList() + } + } + + private fun isFileReference(reference: String) = !reference.startsWith("#/") + + private fun isJsonOrYaml(fileReference: String): Boolean { + return fileReference.endsWith(".json") || fileReference.endsWith(".yaml") || fileReference.endsWith(".yml") + } + + private fun cutReferenceToPropertyIfExists(fileReference: String): String { + if (fileReference.contains("#/")) { + return fileReference.substring(0, fileReference.indexOf("#/")) + } + + return fileReference + } + +} \ No newline at end of file diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndexer.kt index ad0e00b..a0173bd 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndexer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndexer.kt @@ -1,43 +1,24 @@ package com.asyncapi.plugin.idea.extensions.index.v2 -import com.asyncapi.plugin.idea._core.AsyncAPISpecificationRecognizer -import com.intellij.json.psi.JsonFile -import com.intellij.openapi.components.service -import com.intellij.util.indexing.DataIndexer -import com.intellij.util.indexing.FileContent -import org.jetbrains.yaml.psi.YAMLFile +import com.asyncapi.plugin.idea.extensions.index.AbstractAsyncAPISpecificationIndexer +import com.asyncapi.plugin.idea.extensions.index.AbstractAsyncAPISpecificationReferencesCollector +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.PsiFile /** * @author Pavel Bodiachevskii */ -class AsyncAPISpecificationIndexer: DataIndexer, FileContent> { +class AsyncAPISpecificationIndexer: AbstractAsyncAPISpecificationIndexer() { - private val asyncAPISpecificationRecognizer = service() + override fun asyncapiIndexKey(): String = AsyncAPISpecificationIndex.asyncapi - override fun map(inputData: FileContent): MutableMap> { - val index = mutableMapOf>() + override fun referencesIndexKey(): String = AsyncAPISpecificationIndex.references - if (!asyncAPISpecificationRecognizer.isSpecification(inputData.psiFile)) { - return index - } - - val asyncapiSpecification = when(inputData.psiFile) { - is JsonFile -> inputData.psiFile as JsonFile - is YAMLFile -> inputData.psiFile as YAMLFile - else -> null - } - asyncapiSpecification ?: return index - - index[AsyncAPISpecificationIndex.asyncapi] = setOf(inputData.file.path) - var foundReferences = emptySet() - AsyncAPISpecificationReferencesCollector(asyncapiSpecification, inputData.file.parent).collectFiles().forEach { (referenceType, references) -> - index[referenceType] = references - - foundReferences = foundReferences.plus(references) - index[AsyncAPISpecificationIndex.references] = foundReferences - } - - return index + override fun asyncAPISpecificationReferencesCollector( + asyncAPISpecification: PsiFile, + asyncAPISpecificationDir: VirtualFile + ): AbstractAsyncAPISpecificationReferencesCollector { + return AsyncAPISpecificationReferencesCollector(asyncAPISpecification, asyncAPISpecificationDir) } } \ No newline at end of file diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationReferencesCollector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationReferencesCollector.kt index 387f7c5..fb2931e 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationReferencesCollector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationReferencesCollector.kt @@ -1,84 +1,44 @@ package com.asyncapi.plugin.idea.extensions.index.v2 -import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath -import com.asyncapi.plugin.idea._core.xpath.YamlFileXPath -import com.intellij.json.psi.JsonFile +import com.asyncapi.plugin.idea.extensions.index.AbstractAsyncAPISpecificationReferencesCollector import com.intellij.openapi.vfs.VirtualFile import com.intellij.psi.PsiFile -import org.jetbrains.yaml.psi.YAMLFile /** * @author Pavel Bodiachevskii */ class AsyncAPISpecificationReferencesCollector( - private val asyncAPISpecification: PsiFile, - private val asyncAPISpecificationDir: VirtualFile, -) { - - fun collectFiles(): Map> { - val references = mutableMapOf>() - possibleReferencesLocation.forEach { (referenceLocation, xpaths) -> - references[referenceLocation] = xpaths.flatMap { collect(it) } - .asSequence() - .filter { isFileReference(it) } - .map { cutReferenceToPropertyIfExists(it) } - .filter { isJsonOrYaml(it) } - .mapNotNull { asyncAPISpecificationDir.findFileByRelativePath(it)?.path } - .toSet() - } - - return references - } - - private fun collect(xpath: String): List { - return when (asyncAPISpecification) { - is JsonFile -> return JsonFileXPath.findText(asyncAPISpecification, xpath) - is YAMLFile -> return YamlFileXPath.findText(asyncAPISpecification, xpath) - else -> emptyList() - } - } - - private fun isFileReference(reference: String) = !reference.startsWith("#/") - - private fun isJsonOrYaml(fileReference: String): Boolean { - return fileReference.endsWith(".json") || fileReference.endsWith(".yaml") || fileReference.endsWith(".yml") - } - - private fun cutReferenceToPropertyIfExists(fileReference: String): String { - if (fileReference.contains("#/")) { - return fileReference.substring(0, fileReference.indexOf("#/")) - } - - return fileReference - } - - companion object { - val possibleReferencesLocation = mapOf( - AsyncAPISpecificationIndex.channels to setOf("\$.channels.*.\$ref"), - AsyncAPISpecificationIndex.parameters to setOf( - "\$.channels.*.parameters.*.\$ref", - "\$.components.parameters.*.\$ref" - ), - AsyncAPISpecificationIndex.traits to setOf( - "\$.channels.*.subscribe.traits.*.\$ref", - "\$.channels.*.publish.traits.*.\$ref", - "\$.components.messages.*.traits.*.\$ref" - ), - AsyncAPISpecificationIndex.messages to setOf( - "\$.channels.*.subscribe.message.\$ref", - "\$.channels.*.publish.message.\$ref", - "\$.components.messages.*.\$ref" - ), - AsyncAPISpecificationIndex.schemas to setOf("\$.components.schemas.*.\$ref"), - AsyncAPISpecificationIndex.securitySchemes to setOf("\$.components.securitySchemes.*.\$ref"), - AsyncAPISpecificationIndex.correlationIds to setOf( - "\$.components.messages.*.correlationId.\$ref", - "\$.components.messages.*.traits.*.correlationId.\$ref" - ), - AsyncAPISpecificationIndex.headers to setOf( - "\$.components.messages.*.headers.\$ref", - "\$.components.messages.*.traits.*.headers.\$ref" - ) + asyncAPISpecification: PsiFile, + asyncAPISpecificationDir: VirtualFile, +): AbstractAsyncAPISpecificationReferencesCollector(asyncAPISpecification, asyncAPISpecificationDir) { + + override fun possibleReferencesLocation(): Map> { + return mapOf( + AsyncAPISpecificationIndex.channels to setOf("\$.channels.*.\$ref"), + AsyncAPISpecificationIndex.parameters to setOf( + "\$.channels.*.parameters.*.\$ref", + "\$.components.parameters.*.\$ref" + ), + AsyncAPISpecificationIndex.traits to setOf( + "\$.channels.*.subscribe.traits.*.\$ref", + "\$.channels.*.publish.traits.*.\$ref", + "\$.components.messages.*.traits.*.\$ref" + ), + AsyncAPISpecificationIndex.messages to setOf( + "\$.channels.*.subscribe.message.\$ref", + "\$.channels.*.publish.message.\$ref", + "\$.components.messages.*.\$ref" + ), + AsyncAPISpecificationIndex.schemas to setOf("\$.components.schemas.*.\$ref"), + AsyncAPISpecificationIndex.securitySchemes to setOf("\$.components.securitySchemes.*.\$ref"), + AsyncAPISpecificationIndex.correlationIds to setOf( + "\$.components.messages.*.correlationId.\$ref", + "\$.components.messages.*.traits.*.correlationId.\$ref" + ), + AsyncAPISpecificationIndex.headers to setOf( + "\$.components.messages.*.headers.\$ref", + "\$.components.messages.*.traits.*.headers.\$ref" + ) ) } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt new file mode 100644 index 0000000..407f53b --- /dev/null +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt @@ -0,0 +1,64 @@ +package com.asyncapi.plugin.idea.extensions.index.v3 + +import com.intellij.json.JsonFileType +import com.intellij.util.indexing.* +import com.intellij.util.io.DataExternalizer +import com.intellij.util.io.DataInputOutputUtil +import com.intellij.util.io.EnumeratorStringDescriptor +import com.intellij.util.io.KeyDescriptor +import org.jetbrains.yaml.YAMLFileType +import java.io.DataInput +import java.io.DataOutput + +/** + * I use [Set] because of cases when schema has multiple references to schemas. + * @author Pavel Bodiachevskii + */ +class AsyncAPISpecificationIndex: FileBasedIndexExtension>() { + + override fun getName(): ID> = asyncapiIndexId + + override fun getIndexer(): DataIndexer, FileContent> = AsyncAPISpecificationIndexer() + + override fun getKeyDescriptor(): KeyDescriptor = EnumeratorStringDescriptor.INSTANCE + + override fun getVersion(): Int = 1 + + override fun getInputFilter(): FileBasedIndex.InputFilter = FileBasedIndex.InputFilter { file -> file.fileType is JsonFileType || file.fileType is YAMLFileType } + + override fun dependsOnFileContent(): Boolean = true + + override fun getValueExternalizer(): DataExternalizer> = object: DataExternalizer> { + + override fun save(out: DataOutput, value: Set?) { + DataInputOutputUtil.writeINT(out, value!!.size) + value.forEach { out.writeUTF(it) } + } + + override fun read(`in`: DataInput): Set { + val indexedAsyncAPISchemas = mutableSetOf() + + val size = DataInputOutputUtil.readINT(`in`) + for (i in 0 until size) { + indexedAsyncAPISchemas.add(`in`.readUTF()) + } + + return indexedAsyncAPISchemas + } + + } + + companion object { + + @JvmStatic + val asyncapiIndexId = ID.create>("com.asyncapi.v3") + + @JvmStatic + val asyncapi = "asyncapi" + + @JvmStatic + val references = "references" + + } + +} \ No newline at end of file diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndexer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndexer.kt new file mode 100644 index 0000000..b9f8eef --- /dev/null +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndexer.kt @@ -0,0 +1,24 @@ +package com.asyncapi.plugin.idea.extensions.index.v3 + +import com.asyncapi.plugin.idea.extensions.index.AbstractAsyncAPISpecificationIndexer +import com.asyncapi.plugin.idea.extensions.index.AbstractAsyncAPISpecificationReferencesCollector +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.PsiFile + +/** + * @author Pavel Bodiachevskii + */ +class AsyncAPISpecificationIndexer: AbstractAsyncAPISpecificationIndexer() { + + override fun asyncapiIndexKey(): String = AsyncAPISpecificationIndex.asyncapi + + override fun referencesIndexKey(): String = AsyncAPISpecificationIndex.references + + override fun asyncAPISpecificationReferencesCollector( + asyncAPISpecification: PsiFile, + asyncAPISpecificationDir: VirtualFile + ): AbstractAsyncAPISpecificationReferencesCollector { + return AsyncAPISpecificationReferencesCollector(asyncAPISpecification, asyncAPISpecificationDir) + } + +} \ No newline at end of file diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationReferencesCollector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationReferencesCollector.kt new file mode 100644 index 0000000..add5c2c --- /dev/null +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationReferencesCollector.kt @@ -0,0 +1,19 @@ +package com.asyncapi.plugin.idea.extensions.index.v3 + +import com.asyncapi.plugin.idea.extensions.index.AbstractAsyncAPISpecificationReferencesCollector +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.PsiFile + +/** + * @author Pavel Bodiachevskii + */ +class AsyncAPISpecificationReferencesCollector( + asyncAPISpecification: PsiFile, + asyncAPISpecificationDir: VirtualFile, +): AbstractAsyncAPISpecificationReferencesCollector(asyncAPISpecification, asyncAPISpecificationDir) { + + override fun possibleReferencesLocation(): Map> { + return emptyMap() + } + +} \ No newline at end of file diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 810c746..b107e14 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -44,8 +44,9 @@ - + + From cb2b7339c569b5a80c45074e8a204e9d1c3286bb Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:13:07 +0400 Subject: [PATCH 30/57] refactor: change schema in names to specification --- .../psi/reference/YamlFileVariantsProvider.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/YamlFileVariantsProvider.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/YamlFileVariantsProvider.kt index aa9eb73..beaffac 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/YamlFileVariantsProvider.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/YamlFileVariantsProvider.kt @@ -14,7 +14,7 @@ import org.jetbrains.yaml.psi.YAMLScalar // JsonReferenceVariantsProvider class YamlFileVariantsProvider( private val foundYamlElements: List, - private val asyncAPISchemaName: String, + private val asyncAPISpecificationName: String, private val psiXPath: String, private val referencedFileLocation: String? = null ) { @@ -34,7 +34,7 @@ class YamlFileVariantsProvider( yamlScalars.forEach { yamlScalar -> val parentName = resolveParentName(yamlScalar) - var restoredPath = convertToSchemaReferenceAndActualize(psiXPath) + var restoredPath = convertToSpecificationReferenceAndActualize(psiXPath) if (parentName.isNotBlank()) { restoredPath = restoredPath.plus("/$parentName") @@ -51,7 +51,7 @@ class YamlFileVariantsProvider( yamlMappings.forEach { foundYamlMapping -> val parentName = resolveParentName(foundYamlMapping) - var restoredPath = convertToSchemaReferenceAndActualize(psiXPath) + var restoredPath = convertToSpecificationReferenceAndActualize(psiXPath) if (parentName.isNotBlank()) { restoredPath = restoredPath.plus("/$parentName") @@ -72,7 +72,7 @@ class YamlFileVariantsProvider( yamlKeyValues.forEach { yamlKeyValue -> val parentName = resolveParentName(yamlKeyValue) - var restoredPath = convertToSchemaReferenceAndActualize(psiXPath) + var restoredPath = convertToSpecificationReferenceAndActualize(psiXPath) if (parentName.isNotBlank()) { restoredPath = restoredPath.plus("/$parentName") @@ -88,8 +88,8 @@ class YamlFileVariantsProvider( return (yamlPsiElement.parent as? YAMLPsiElement)?.name ?: "" } - private fun convertToSchemaReferenceAndActualize(psiXPath: String): String { - val schemaReference = psiXPath.replace("$", "#") + private fun convertToSpecificationReferenceAndActualize(psiXPath: String): String { + val specificationReference = psiXPath.replace("$", "#") .split(".") /* Last element if it exists must be deleted. @@ -98,13 +98,13 @@ class YamlFileVariantsProvider( .dropLast(1) .joinToString("/") - return referencedFileLocation?.plus(schemaReference) ?: schemaReference + return referencedFileLocation?.plus(specificationReference) ?: specificationReference } private fun buildVariant(variant: String): LookupElement { return LookupElementBuilder.create(variant) .withCaseSensitivity(false) - .withTypeText(asyncAPISchemaName) + .withTypeText(asyncAPISpecificationName) .withIcon(Icons.ASYNCAPI_ICON) } From 1216bc007ba3486822ba89838e6b910d2b75d0f4 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:14:31 +0400 Subject: [PATCH 31/57] refactor: change schema in names to specification --- .../psi/reference/JsonFileVariantsProvider.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/JsonFileVariantsProvider.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/JsonFileVariantsProvider.kt index 2a443eb..bbfeb46 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/JsonFileVariantsProvider.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/JsonFileVariantsProvider.kt @@ -14,7 +14,7 @@ import com.intellij.json.psi.JsonProperty // JsonReferenceVariantsProvider class JsonFileVariantsProvider( private val foundJsonElements: List, - private val asyncAPISchemaName: String, + private val asyncAPISpecificationName: String, private val psiXPath: String, private val referencedFileLocation: String? = null ) { @@ -33,7 +33,7 @@ class JsonFileVariantsProvider( jsonObjects.forEach { foundJsonObject -> val parentName = resolveParentName(foundJsonObject) - var restoredPath = convertToSchemaReferenceAndActualize(psiXPath) + var restoredPath = convertToSpecificationReferenceAndActualize(psiXPath) if (parentName.isNotBlank()) { restoredPath = restoredPath.plus("/$parentName") @@ -54,7 +54,7 @@ class JsonFileVariantsProvider( jsonStringLiterals.forEach { jsonStringLiteral -> val parentName = resolveParentName(jsonStringLiteral) - var restoredPath = convertToSchemaReferenceAndActualize(psiXPath) + var restoredPath = convertToSpecificationReferenceAndActualize(psiXPath) if (parentName.isNotBlank()) { restoredPath = restoredPath.plus("/$parentName") @@ -70,8 +70,8 @@ class JsonFileVariantsProvider( return (jsonObject.parent as? JsonProperty)?.name ?: "" } - private fun convertToSchemaReferenceAndActualize(psiXPath: String): String { - val schemaReference = psiXPath.replace("$", "#") + private fun convertToSpecificationReferenceAndActualize(psiXPath: String): String { + val specificationReference = psiXPath.replace("$", "#") .split(".") /* Last element if it exists must be deleted. @@ -80,13 +80,13 @@ class JsonFileVariantsProvider( .dropLast(1) .joinToString("/") - return referencedFileLocation?.plus(schemaReference) ?: schemaReference + return referencedFileLocation?.plus(specificationReference) ?: specificationReference } private fun buildVariant(variant: String): LookupElement { return LookupElementBuilder.create(variant) .withCaseSensitivity(false) - .withTypeText(asyncAPISchemaName) + .withTypeText(asyncAPISpecificationName) .withIcon(Icons.ASYNCAPI_ICON) } From ae844308cf2a8b26d99792a17450706d5fc59380 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:18:21 +0400 Subject: [PATCH 32/57] refactor: change schema in names to specification --- .../asyncapi/plugin/idea/_core/xpath/JsonFileXPath.kt | 10 +++++----- .../asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt | 10 +++++----- .../asyncapi/plugin/idea/_core/xpath/YamlFileXPath.kt | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPath.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPath.kt index 82ce9e7..3c7c38b 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPath.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPath.kt @@ -12,15 +12,15 @@ import com.intellij.psi.PsiElement */ object JsonFileXPath: PsiFileXPath() { - override fun findPsi(asyncAPISchema: JsonFile?, psiXPath: String, partialMatch: Boolean): List { - asyncAPISchema ?: return emptyList() + override fun findPsi(asyncAPISpecification: JsonFile?, psiXPath: String, partialMatch: Boolean): List { + asyncAPISpecification ?: return emptyList() val tokens = tokenize(psiXPath) if (tokens.isEmpty()) { return emptyList() } - var elements: List = asyncAPISchema.children.filterIsInstance(JsonObject::class.java).flatMap { + var elements: List = asyncAPISpecification.children.filterIsInstance(JsonObject::class.java).flatMap { it.propertyList } @@ -31,8 +31,8 @@ object JsonFileXPath: PsiFileXPath() { return elements } - override fun findText(asyncAPISchema: JsonFile?, psiXPath: String, partialMatch: Boolean): List { - return findPsi(asyncAPISchema, psiXPath, partialMatch).map { + override fun findText(asyncAPISpecification: JsonFile?, psiXPath: String, partialMatch: Boolean): List { + return findPsi(asyncAPISpecification, psiXPath, partialMatch).map { it.text.removePrefix("\"").removeSuffix("\"") } } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt index 6f3ad98..0a6c6cc 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt @@ -14,10 +14,10 @@ abstract class PsiFileXPath { * Converts schema reference to PSI XPath. * For example: #/components/messages will be compiled as $.components.messages * - * @param schemaReference to compile as PSI xpath. + * @param specificationReference to compile as PSI xpath. */ - fun compileXPath(schemaReference: String): String { - return schemaReference + fun compileXPath(specificationReference: String): String { + return specificationReference .removePrefix("\"") .removeSuffix("\"") .replace("#/", "") @@ -34,7 +34,7 @@ abstract class PsiFileXPath { * * @return list of [PsiElement.getText] for each found [PsiElement] or empty. */ - abstract fun findText(asyncAPISchema: AsyncAPISchema?, psiXPath: String, partialMatch: Boolean = false): List + abstract fun findText(asyncAPISpecification: AsyncAPISchema?, psiXPath: String, partialMatch: Boolean = false): List /** * Search for [PsiElement] text by given xpath. @@ -45,7 +45,7 @@ abstract class PsiFileXPath { * * @return list of found [PsiElement] or empty. */ - abstract fun findPsi(asyncAPISchema: AsyncAPISchema?, psiXPath: String, partialMatch: Boolean = false): List + abstract fun findPsi(asyncAPISpecification: AsyncAPISchema?, psiXPath: String, partialMatch: Boolean = false): List /** * Split psiXPath to tokens. diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPath.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPath.kt index ecfbf05..8ba412d 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPath.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPath.kt @@ -12,21 +12,21 @@ import org.jetbrains.yaml.psi.YAMLMapping */ object YamlFileXPath: PsiFileXPath() { - override fun findText(asyncAPISchema: YAMLFile?, psiXPath: String, partialMatch: Boolean): List { - return findPsi(asyncAPISchema, psiXPath, partialMatch).map { + override fun findText(asyncAPISpecification: YAMLFile?, psiXPath: String, partialMatch: Boolean): List { + return findPsi(asyncAPISpecification, psiXPath, partialMatch).map { it.text.removePrefix("\"").removeSuffix("\"") } } - override fun findPsi(asyncAPISchema: YAMLFile?, psiXPath: String, partialMatch: Boolean): List { - asyncAPISchema ?: return emptyList() + override fun findPsi(asyncAPISpecification: YAMLFile?, psiXPath: String, partialMatch: Boolean): List { + asyncAPISpecification ?: return emptyList() val tokens = tokenize(psiXPath) if (tokens.isEmpty()) { return emptyList() } - var elements: List = asyncAPISchema.documents.flatMap { it.yamlElements } + var elements: List = asyncAPISpecification.documents.flatMap { it.yamlElements } tokens.forEach { token -> elements = exploreNodes(elements, token, partialMatch) From 9f70e0dc833a06e3936d2015f670e07dab1b48c0 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:21:42 +0400 Subject: [PATCH 33/57] refactor: change schema in names to specification --- .../asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt index 0a6c6cc..4522984 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt @@ -8,10 +8,10 @@ import com.intellij.psi.PsiFile * * @author Pavel Bodiachevskii */ -abstract class PsiFileXPath { +abstract class PsiFileXPath { /** - * Converts schema reference to PSI XPath. + * Converts specification reference to PSI XPath. * For example: #/components/messages will be compiled as $.components.messages * * @param specificationReference to compile as PSI xpath. @@ -28,24 +28,24 @@ abstract class PsiFileXPath { /** * Search for [PsiElement] by given xpath. * - * @param asyncAPISchema [PsiFile] to inspect. + * @param asyncAPISpecification [PsiFile] to inspect. * @param psiXPath PSI XPath to execute. * @param partialMatch is partial match allowed. * * @return list of [PsiElement.getText] for each found [PsiElement] or empty. */ - abstract fun findText(asyncAPISpecification: AsyncAPISchema?, psiXPath: String, partialMatch: Boolean = false): List + abstract fun findText(asyncAPISpecification: AsyncAPISpecification?, psiXPath: String, partialMatch: Boolean = false): List /** * Search for [PsiElement] text by given xpath. * - * @param asyncAPISchema [PsiFile] to inspect. + * @param asyncAPISpecification [PsiFile] to inspect. * @param psiXPath PSI XPath to execute. * @param partialMatch is partial match allowed. * * @return list of found [PsiElement] or empty. */ - abstract fun findPsi(asyncAPISpecification: AsyncAPISchema?, psiXPath: String, partialMatch: Boolean = false): List + abstract fun findPsi(asyncAPISpecification: AsyncAPISpecification?, psiXPath: String, partialMatch: Boolean = false): List /** * Split psiXPath to tokens. From 84a43a9c6df7bb5984a439454625a46f4d5657ad Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:23:44 +0400 Subject: [PATCH 34/57] refactor: change schema in names to specification --- .../extensions/index/v2/AsyncAPISpecificationIndex.kt | 8 ++++---- .../extensions/index/v3/AsyncAPISpecificationIndex.kt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndex.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndex.kt index 968be70..c5c3a07 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndex.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v2/AsyncAPISpecificationIndex.kt @@ -11,7 +11,7 @@ import java.io.DataInput import java.io.DataOutput /** - * I use [Set] because of cases when schema has multiple references to schemas. + * I use [Set] because of cases when specification has multiple references to components. * @author Pavel Bodiachevskii */ class AsyncAPISpecificationIndex: FileBasedIndexExtension>() { @@ -36,14 +36,14 @@ class AsyncAPISpecificationIndex: FileBasedIndexExtension>() } override fun read(`in`: DataInput): Set { - val indexedAsyncAPISchemas = mutableSetOf() + val indexedAsyncAPISpecifications = mutableSetOf() val size = DataInputOutputUtil.readINT(`in`) for (i in 0 until size) { - indexedAsyncAPISchemas.add(`in`.readUTF()) + indexedAsyncAPISpecifications.add(`in`.readUTF()) } - return indexedAsyncAPISchemas + return indexedAsyncAPISpecifications } } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt index 407f53b..57447e0 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt @@ -11,7 +11,7 @@ import java.io.DataInput import java.io.DataOutput /** - * I use [Set] because of cases when schema has multiple references to schemas. + * I use [Set] because of cases when specification has multiple references to components. * @author Pavel Bodiachevskii */ class AsyncAPISpecificationIndex: FileBasedIndexExtension>() { @@ -36,14 +36,14 @@ class AsyncAPISpecificationIndex: FileBasedIndexExtension>() } override fun read(`in`: DataInput): Set { - val indexedAsyncAPISchemas = mutableSetOf() + val indexedAsyncAPISpecifications = mutableSetOf() val size = DataInputOutputUtil.readINT(`in`) for (i in 0 until size) { - indexedAsyncAPISchemas.add(`in`.readUTF()) + indexedAsyncAPISpecifications.add(`in`.readUTF()) } - return indexedAsyncAPISchemas + return indexedAsyncAPISpecifications } } From 0286605e1a1b4d83caa38cb096b225a3557489d0 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:26:34 +0400 Subject: [PATCH 35/57] refactor: change schema in names to specification --- .../idea/extensions/psi/reference/AsyncAPIFileReference.kt | 2 +- .../idea/extensions/psi/reference/AsyncAPILocalReference.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/AsyncAPIFileReference.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/AsyncAPIFileReference.kt index af090f4..ce440ca 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/AsyncAPIFileReference.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/AsyncAPIFileReference.kt @@ -15,7 +15,7 @@ import org.jetbrains.yaml.psi.YAMLFile import org.jetbrains.yaml.psi.YAMLPsiElement /** - * Reference to schema located in file. + * Reference to specification component located in external file. * * @author Pavel Bodiachevskii */ diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/AsyncAPILocalReference.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/AsyncAPILocalReference.kt index 7d2d5da..8e3863d 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/AsyncAPILocalReference.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/psi/reference/AsyncAPILocalReference.kt @@ -13,7 +13,7 @@ import org.jetbrains.yaml.psi.YAMLFile import org.jetbrains.yaml.psi.YAMLPsiElement /** - * Reference to element inside current schema. + * Reference to element inside current specification. * * @author Pavel Bodiachevskii * From f6fa0ba02fbe7ff503fb4ded5b8f4cdfcf6800ee Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:29:50 +0400 Subject: [PATCH 36/57] refactor: change schema in names to specification --- .../inspection/AsyncAPIJsonSchemaInspection.kt | 2 +- .../inspection/AsyncAPISpecificationDetector.kt | 16 ++++++++-------- .../inspection/AsyncAPIYamlSchemaInspection.kt | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt index 0275624..b725760 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt @@ -21,7 +21,7 @@ class AsyncAPIJsonSchemaInspection: LocalInspectionTool() { private val asyncAPIJsonSchemaProvider = service() override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean, session: LocalInspectionToolSession): PsiElementVisitor { - if (!asyncAPISpecificationDetector.isAsyncAPIJsonSchema(holder.file)) { + if (!asyncAPISpecificationDetector.isAsyncAPIJsonSpecification(holder.file)) { return PsiElementVisitor.EMPTY_VISITOR } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index d5cd2fe..1d02298 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -12,7 +12,7 @@ import org.jetbrains.yaml.psi.YAMLFile */ class AsyncAPISpecificationDetector { - fun isAsyncAPIJsonSchema(psiFile: PsiFile?): Boolean { + fun isAsyncAPIJsonSpecification(psiFile: PsiFile?): Boolean { psiFile ?: return false if (psiFile !is JsonFile) { return false @@ -21,7 +21,7 @@ class AsyncAPISpecificationDetector { return indexedAsyncAPISpecifications(psiFile).contains(psiFile.virtualFile?.path) } - fun isAsyncAPIYamlSchema(psiFile: PsiFile?): Boolean { + fun isAsyncAPIYamlSpecification(psiFile: PsiFile?): Boolean { psiFile ?: return false if (psiFile !is YAMLFile) { return false @@ -33,8 +33,8 @@ class AsyncAPISpecificationDetector { fun isAsyncAPISpecification(psiFile: PsiFile?): Boolean { psiFile ?: return false return when (psiFile) { - is JsonFile -> return isAsyncAPIJsonSchema(psiFile) - is YAMLFile -> return isAsyncAPIYamlSchema(psiFile) + is JsonFile -> return isAsyncAPIJsonSpecification(psiFile) + is YAMLFile -> return isAsyncAPIYamlSpecification(psiFile) else -> false } } @@ -66,19 +66,19 @@ class AsyncAPISpecificationDetector { } } - private fun indexedAsyncAPISpecifications(asyncapiSchema: PsiFile): List { + private fun indexedAsyncAPISpecifications(asyncapiSpecification: PsiFile): List { return FileBasedIndex.getInstance().getValues( AsyncAPISpecificationIndex.asyncapiIndexId, AsyncAPISpecificationIndex.asyncapi, - GlobalSearchScope.allScope(asyncapiSchema.project) + GlobalSearchScope.allScope(asyncapiSpecification.project) ).flatten() } - private fun indexedAsyncAPISpecificationReferences(asyncapiSchema: PsiFile): List { + private fun indexedAsyncAPISpecificationReferences(asyncapiSpecification: PsiFile): List { return FileBasedIndex.getInstance().getValues( AsyncAPISpecificationIndex.asyncapiIndexId, AsyncAPISpecificationIndex.references, - GlobalSearchScope.allScope(asyncapiSchema.project) + GlobalSearchScope.allScope(asyncapiSpecification.project) ).flatten() } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt index 6c8738a..405f9af 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt @@ -22,7 +22,7 @@ class AsyncAPIYamlSchemaInspection: LocalInspectionTool() { private val asyncAPIJsonSchemaProvider = service() override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean, session: LocalInspectionToolSession): PsiElementVisitor { - if (!asyncAPISpecificationDetector.isAsyncAPIYamlSchema(holder.file)) { + if (!asyncAPISpecificationDetector.isAsyncAPIYamlSpecification(holder.file)) { return PsiElementVisitor.EMPTY_VISITOR } From bc25013599fc522209bc524b679bb550e62db3ca Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:52:29 +0400 Subject: [PATCH 37/57] refactor: change schema in names to specification --- .../AsyncAPISpecificationHtmlRenderer.kt | 6 ++-- .../idea/extensions/web/StaticServer.kt | 12 +++---- .../plugin/idea/extensions/web/UrlProvider.kt | 36 +++++++++---------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt index e41d134..5377758 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt @@ -60,7 +60,7 @@ class AsyncAPISpecificationHtmlRenderer { return specificationTemplate.readText(Charsets.UTF_8) .replace( "url: '',", - "url: '${urlProvider.schema(temporalSpecificationUrl)}'," + "url: '${urlProvider.specification(temporalSpecificationUrl)}'," ) .replace( "", @@ -95,13 +95,13 @@ class AsyncAPISpecificationHtmlRenderer { private fun localReferenceToFileUrl(localReference: String, specificationFile: VirtualFile): String { val rawFileReference = localReference.removePrefix("\"").removeSuffix("\"") val fileReference = rawFileReference.split("#/").getOrNull(0) - val schemaReference = rawFileReference.split("#/").getOrNull(1) + val specificationComponentReference = rawFileReference.split("#/").getOrNull(1) fileReference ?: return rawFileReference val referencedFile = specificationFile.parent.findFileByRelativePath(fileReference) referencedFile ?: return fileReference - return urlProvider.reference(referencedFile.path, schemaReference) + return urlProvider.reference(referencedFile.path, specificationComponentReference) } private fun saveAsTemporalFile(specification: String, isJson: Boolean): String { diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/StaticServer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/StaticServer.kt index 848c782..ce47320 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/StaticServer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/StaticServer.kt @@ -49,10 +49,10 @@ class StaticServer : HttpRequestHandler() { } } } - UrlProvider.UrlType.SCHEMA_FILE, UrlProvider.UrlType.REFERENCED_SCHEMA_FILE -> { + UrlProvider.UrlType.SPECIFICATION_FILE, UrlProvider.UrlType.REFERENCED_SPECIFICATION_COMPONENT_FILE -> { object : ResourceHandler { override fun handle(resourceUrl: String): Resource? { - return resolveSchemaResource(resourceUrl) + return resolveSpecificationComponent(resourceUrl) } } } @@ -66,8 +66,8 @@ class StaticServer : HttpRequestHandler() { } val resourceParameterName = when (urlType) { - UrlProvider.UrlType.HTML_FILE, UrlProvider.UrlType.SCHEMA_FILE -> UrlProvider.SCHEMA_PARAMETER_NAME - UrlProvider.UrlType.REFERENCED_SCHEMA_FILE -> UrlProvider.REFERENCED_SCHEMA_PARAMETER_NAME + UrlProvider.UrlType.HTML_FILE, UrlProvider.UrlType.SPECIFICATION_FILE -> UrlProvider.SPECIFICATION_PARAMETER_NAME + UrlProvider.UrlType.REFERENCED_SPECIFICATION_COMPONENT_FILE -> UrlProvider.REFERENCED_SPECIFICATION_COMPONENT_PARAMETER_NAME UrlProvider.UrlType.RESOURCE_FILE -> UrlProvider.RESOURCE_PARAMETER_NAME } @@ -104,8 +104,8 @@ class StaticServer : HttpRequestHandler() { response.send(context.channel(), request) } - private fun resolveSchemaResource(resourceUrl: String): Resource? { - val requestedFile = File(resourceUrl) + private fun resolveSpecificationComponent(specificationComponentUrl: String): Resource? { + val requestedFile = File(specificationComponentUrl) if (!requestedFile.exists()) { return null } diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/UrlProvider.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/UrlProvider.kt index 6e12d10..b12d5e3 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/UrlProvider.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/web/UrlProvider.kt @@ -47,27 +47,27 @@ class UrlProvider { } private fun renderParams(request: OpenInBrowserRequest, file: VirtualFile): String { - val schemaUrl = URLEncoder.encode(file.path, StandardCharsets.UTF_8.toString()) + val specificationUrl = URLEncoder.encode(file.path, StandardCharsets.UTF_8.toString()) val projectUrl = URLEncoder.encode(request.project.presentableUrl, StandardCharsets.UTF_8.toString()) val projectName = URLEncoder.encode(request.project.name, StandardCharsets.UTF_8.toString()) - return "$SCHEMA_PARAMETER_NAME=$schemaUrl" + + return "$SPECIFICATION_PARAMETER_NAME=$specificationUrl" + "&projectUrl=$projectUrl" + "&projectName=$projectName" + "&_ij_reload=RELOAD_ON_SAVE" } - fun reference(fileUrl: String, schemaReference: String?): String { - val url = Urls.parseEncoded("$staticServerUrl/$resourcesRequest?${referenceParams(fileUrl, schemaReference)}") + fun reference(fileUrl: String, specificationComponentReference: String?): String { + val url = Urls.parseEncoded("$staticServerUrl/$resourcesRequest?${referenceParams(fileUrl, specificationComponentReference)}") return staticServerManager.addAuthToken(url!!).toExternalForm() } - private fun referenceParams(fileUrl: String, schemaReference: String?): String { - return if (schemaReference != null) { - "$REFERENCED_SCHEMA_PARAMETER_NAME=$fileUrl#/$schemaReference" + private fun referenceParams(fileUrl: String, specificationComponentReference: String?): String { + return if (specificationComponentReference != null) { + "$REFERENCED_SPECIFICATION_COMPONENT_PARAMETER_NAME=$fileUrl#/$specificationComponentReference" } else { - "$REFERENCED_SCHEMA_PARAMETER_NAME=$fileUrl" + "$REFERENCED_SPECIFICATION_COMPONENT_PARAMETER_NAME=$fileUrl" } } @@ -77,8 +77,8 @@ class UrlProvider { return staticServerManager.addAuthToken(url!!).toExternalForm() } - fun schema(schemaUrl: String): String { - val url = Urls.parseEncoded("$staticServerUrl/$resourcesRequest?$SCHEMA_PARAMETER_NAME=$schemaUrl") + fun specification(specificationUrl: String): String { + val url = Urls.parseEncoded("$staticServerUrl/$resourcesRequest?$SPECIFICATION_PARAMETER_NAME=$specificationUrl") return staticServerManager.addAuthToken(url!!).toExternalForm() } @@ -91,10 +91,10 @@ class UrlProvider { if (urlDecoder.path().startsWith("/$resourcesRequest")) { var urlType: UrlType? = null - if (urlDecoder.parameters().contains(REFERENCED_SCHEMA_PARAMETER_NAME)) { - urlType = UrlType.REFERENCED_SCHEMA_FILE - } else if (urlDecoder.parameters().contains(SCHEMA_PARAMETER_NAME)) { - urlType = UrlType.SCHEMA_FILE + if (urlDecoder.parameters().contains(REFERENCED_SPECIFICATION_COMPONENT_PARAMETER_NAME)) { + urlType = UrlType.REFERENCED_SPECIFICATION_COMPONENT_FILE + } else if (urlDecoder.parameters().contains(SPECIFICATION_PARAMETER_NAME)) { + urlType = UrlType.SPECIFICATION_FILE } else if (urlDecoder.parameters().contains(RESOURCE_PARAMETER_NAME)) { urlType = UrlType.RESOURCE_FILE } @@ -115,15 +115,15 @@ class UrlProvider { enum class UrlType { HTML_FILE, - SCHEMA_FILE, - REFERENCED_SCHEMA_FILE, + SPECIFICATION_FILE, + REFERENCED_SPECIFICATION_COMPONENT_FILE, RESOURCE_FILE } companion object { - const val SCHEMA_PARAMETER_NAME = "schemaUrl" - const val REFERENCED_SCHEMA_PARAMETER_NAME = "referenceUrl" + const val SPECIFICATION_PARAMETER_NAME = "specificationUrl" + const val REFERENCED_SPECIFICATION_COMPONENT_PARAMETER_NAME = "specificationComponentReferenceUrl" const val RESOURCE_PARAMETER_NAME = "resourceUrl" } From cd1d1a34e7cb2a5d01090d31ee777f5ab27f823f Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 01:58:22 +0400 Subject: [PATCH 38/57] refactor: rename AsyncAPI specification templates --- .../plugin/idea/actions/CreateAsyncAPISpecification.kt | 8 ++++---- src/main/resources/META-INF/plugin.xml | 6 ++++-- ...n).json.ft => AsyncAPI specification 2 (json).json.ft} | 0 ...l).yaml.ft => AsyncAPI specification 2 (yaml).yaml.ft} | 0 ...n).json.ft => AsyncAPI specification 3 (json).json.ft} | 0 ...l).yaml.ft => AsyncAPI specification 3 (yaml).yaml.ft} | 0 6 files changed, 8 insertions(+), 6 deletions(-) rename src/main/resources/fileTemplates/internal/{AsyncAPI schema (json).json.ft => AsyncAPI specification 2 (json).json.ft} (100%) rename src/main/resources/fileTemplates/internal/{AsyncAPI schema (yaml).yaml.ft => AsyncAPI specification 2 (yaml).yaml.ft} (100%) rename src/main/resources/fileTemplates/internal/{AsyncAPI schema 3 (json).json.ft => AsyncAPI specification 3 (json).json.ft} (100%) rename src/main/resources/fileTemplates/internal/{AsyncAPI schema 3 (yaml).yaml.ft => AsyncAPI specification 3 (yaml).yaml.ft} (100%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/actions/CreateAsyncAPISpecification.kt b/src/main/kotlin/com/asyncapi/plugin/idea/actions/CreateAsyncAPISpecification.kt index a102166..f45c420 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/actions/CreateAsyncAPISpecification.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/actions/CreateAsyncAPISpecification.kt @@ -19,10 +19,10 @@ class CreateAsyncAPISpecification: CreateFileFromTemplateAction( override fun buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) { builder .setTitle("New API Specification") - .addKind("AsyncAPI 2 (.yaml)", Icons.ASYNCAPI_ICON, "AsyncAPI schema (yaml).yaml") - .addKind("AsyncAPI 2 (.json)", Icons.ASYNCAPI_ICON, "AsyncAPI schema (json).json") - .addKind("AsyncAPI 3 (.yaml)", Icons.ASYNCAPI_ICON, "AsyncAPI schema 3 (yaml).yaml") - .addKind("AsyncAPI 3 (.json)", Icons.ASYNCAPI_ICON, "AsyncAPI schema 3 (json).json") + .addKind("AsyncAPI 2 (.yaml)", Icons.ASYNCAPI_ICON, "AsyncAPI specification 2 (yaml).yaml") + .addKind("AsyncAPI 2 (.json)", Icons.ASYNCAPI_ICON, "AsyncAPI specification 2 (json).json") + .addKind("AsyncAPI 3 (.yaml)", Icons.ASYNCAPI_ICON, "AsyncAPI specification 3 (yaml).yaml") + .addKind("AsyncAPI 3 (.json)", Icons.ASYNCAPI_ICON, "AsyncAPI specification 3 (json).json") } override fun getActionName(directory: PsiDirectory?, newName: String, templateName: String?): String { diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index b107e14..aafa03b 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -34,8 +34,10 @@ - - + + + + diff --git a/src/main/resources/fileTemplates/internal/AsyncAPI schema (json).json.ft b/src/main/resources/fileTemplates/internal/AsyncAPI specification 2 (json).json.ft similarity index 100% rename from src/main/resources/fileTemplates/internal/AsyncAPI schema (json).json.ft rename to src/main/resources/fileTemplates/internal/AsyncAPI specification 2 (json).json.ft diff --git a/src/main/resources/fileTemplates/internal/AsyncAPI schema (yaml).yaml.ft b/src/main/resources/fileTemplates/internal/AsyncAPI specification 2 (yaml).yaml.ft similarity index 100% rename from src/main/resources/fileTemplates/internal/AsyncAPI schema (yaml).yaml.ft rename to src/main/resources/fileTemplates/internal/AsyncAPI specification 2 (yaml).yaml.ft diff --git a/src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (json).json.ft b/src/main/resources/fileTemplates/internal/AsyncAPI specification 3 (json).json.ft similarity index 100% rename from src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (json).json.ft rename to src/main/resources/fileTemplates/internal/AsyncAPI specification 3 (json).json.ft diff --git a/src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (yaml).yaml.ft b/src/main/resources/fileTemplates/internal/AsyncAPI specification 3 (yaml).yaml.ft similarity index 100% rename from src/main/resources/fileTemplates/internal/AsyncAPI schema 3 (yaml).yaml.ft rename to src/main/resources/fileTemplates/internal/AsyncAPI specification 3 (yaml).yaml.ft From a894a7ac563b7438cd5caca9551347f31613bcb4 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 02:03:19 +0400 Subject: [PATCH 39/57] refactor: rename AsyncAPI*SchemaInspection to AsyncAPI*SpecificationInspection --- ...spection.kt => AsyncAPIJsonSpecificationInspection.kt} | 2 +- ...spection.kt => AsyncAPIYamlSpecificationInspection.kt} | 2 +- src/main/resources/META-INF/plugin.xml | 6 +++--- ...cAPIJsonSchema.html => AsyncAPIJsonSpecification.html} | 0 ...cAPIYamlSchema.html => AsyncAPIYamlSpecification.html} | 0 ...=> AbstractAsyncAPIJsonSpecificationInspectionTest.kt} | 8 ++++---- ...Test.kt => AsyncAPIJsonSpecificationInspectionTest.kt} | 4 ++-- ...Test.kt => AsyncAPIJsonSpecificationInspectionTest.kt} | 4 ++-- ...Test.kt => AsyncAPIJsonSpecificationInspectionTest.kt} | 4 ++-- ...Test.kt => AsyncAPIJsonSpecificationInspectionTest.kt} | 4 ++-- ...Test.kt => AsyncAPIJsonSpecificationInspectionTest.kt} | 4 ++-- ...Test.kt => AsyncAPIJsonSpecificationInspectionTest.kt} | 4 ++-- ...Test.kt => AsyncAPIJsonSpecificationInspectionTest.kt} | 4 ++-- ...Test.kt => AsyncAPIJsonSpecificationInspectionTest.kt} | 4 ++-- 14 files changed, 25 insertions(+), 25 deletions(-) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/{AsyncAPIJsonSchemaInspection.kt => AsyncAPIJsonSpecificationInspection.kt} (96%) rename src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/{AsyncAPIYamlSchemaInspection.kt => AsyncAPIYamlSpecificationInspection.kt} (97%) rename src/main/resources/inspectionDescriptions/{AsyncAPIJsonSchema.html => AsyncAPIJsonSpecification.html} (100%) rename src/main/resources/inspectionDescriptions/{AsyncAPIYamlSchema.html => AsyncAPIYamlSpecification.html} (100%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/{AbstractAsyncAPIJsonSchemaInspectionTest.kt => AbstractAsyncAPIJsonSpecificationInspectionTest.kt} (67%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/{AsyncAPIJsonSchemaInspectionTest.kt => AsyncAPIJsonSpecificationInspectionTest.kt} (67%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/{AsyncAPIJsonSchemaInspectionTest.kt => AsyncAPIJsonSpecificationInspectionTest.kt} (67%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/{AsyncAPIJsonSchemaInspectionTest.kt => AsyncAPIJsonSpecificationInspectionTest.kt} (67%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/{AsyncAPIJsonSchemaInspectionTest.kt => AsyncAPIJsonSpecificationInspectionTest.kt} (67%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/{AsyncAPIJsonSchemaInspectionTest.kt => AsyncAPIJsonSpecificationInspectionTest.kt} (67%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/{AsyncAPIJsonSchemaInspectionTest.kt => AsyncAPIJsonSpecificationInspectionTest.kt} (67%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/{AsyncAPIJsonSchemaInspectionTest.kt => AsyncAPIJsonSpecificationInspectionTest.kt} (67%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/{AsyncAPIJsonSchemaInspectionTest.kt => AsyncAPIJsonSpecificationInspectionTest.kt} (67%) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSpecificationInspection.kt similarity index 96% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSpecificationInspection.kt index b725760..8613610 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSchemaInspection.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIJsonSpecificationInspection.kt @@ -15,7 +15,7 @@ import com.jetbrains.jsonSchema.impl.JsonSchemaComplianceChecker /** * @author Pavel Bodiachevskii */ -class AsyncAPIJsonSchemaInspection: LocalInspectionTool() { +class AsyncAPIJsonSpecificationInspection: LocalInspectionTool() { private val asyncAPISpecificationDetector = AsyncAPISpecificationDetector() private val asyncAPIJsonSchemaProvider = service() diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSpecificationInspection.kt similarity index 97% rename from src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt rename to src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSpecificationInspection.kt index 405f9af..5a1dccc 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSchemaInspection.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPIYamlSpecificationInspection.kt @@ -16,7 +16,7 @@ import org.jetbrains.yaml.psi.YamlPsiElementVisitor /** * @author Pavel Bodiachevskii */ -class AsyncAPIYamlSchemaInspection: LocalInspectionTool() { +class AsyncAPIYamlSpecificationInspection: LocalInspectionTool() { private val asyncAPISpecificationDetector = AsyncAPISpecificationDetector() private val asyncAPIJsonSchemaProvider = service() diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index aafa03b..70394d4 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -42,9 +42,9 @@ - - - + + + diff --git a/src/main/resources/inspectionDescriptions/AsyncAPIJsonSchema.html b/src/main/resources/inspectionDescriptions/AsyncAPIJsonSpecification.html similarity index 100% rename from src/main/resources/inspectionDescriptions/AsyncAPIJsonSchema.html rename to src/main/resources/inspectionDescriptions/AsyncAPIJsonSpecification.html diff --git a/src/main/resources/inspectionDescriptions/AsyncAPIYamlSchema.html b/src/main/resources/inspectionDescriptions/AsyncAPIYamlSpecification.html similarity index 100% rename from src/main/resources/inspectionDescriptions/AsyncAPIYamlSchema.html rename to src/main/resources/inspectionDescriptions/AsyncAPIYamlSpecification.html diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSchemaInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSpecificationInspectionTest.kt similarity index 67% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSchemaInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSpecificationInspectionTest.kt index 1173fae..e88c3b5 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSchemaInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSpecificationInspectionTest.kt @@ -1,26 +1,26 @@ package com.asyncapi.plugin.idea.inspection -import com.asyncapi.plugin.idea.extensions.inspection.AsyncAPIJsonSchemaInspection +import com.asyncapi.plugin.idea.extensions.inspection.AsyncAPIJsonSpecificationInspection import com.intellij.testFramework.fixtures.BasePlatformTestCase /** * @author Pavel Bodiachevskii * @since 1.6.0 */ -abstract class AbstractAsyncAPIJsonSchemaInspectionTest: BasePlatformTestCase() { +abstract class AbstractAsyncAPIJsonSpecificationInspectionTest: BasePlatformTestCase() { override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.0.0" fun `test - with extra keys`() { myFixture.configureByFile("extra keys.json") - myFixture.enableInspections(AsyncAPIJsonSchemaInspection::class.java) + myFixture.enableInspections(AsyncAPIJsonSpecificationInspection::class.java) myFixture.checkHighlighting() } fun `test - without channels`() { myFixture.configureByFile("without channels.json") - myFixture.enableInspections(AsyncAPIJsonSchemaInspection::class.java) + myFixture.enableInspections(AsyncAPIJsonSpecificationInspection::class.java) myFixture.checkHighlighting() } diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/AsyncAPIJsonSchemaInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 67% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/AsyncAPIJsonSchemaInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/AsyncAPIJsonSpecificationInspectionTest.kt index 2959097..1433e31 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/AsyncAPIJsonSchemaInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,12 +1,12 @@ package com.asyncapi.plugin.idea.inspection.unknown -import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSchemaInspectionTest +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest /** * @author Pavel Bodiachevskii * @since 1.6.0 */ -class AsyncAPIJsonSchemaInspectionTest: AbstractAsyncAPIJsonSchemaInspectionTest() { +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { override fun getTestDataPath(): String = "src/test/testData/json/inspection/unknown" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/AsyncAPIJsonSchemaInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 67% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/AsyncAPIJsonSchemaInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/AsyncAPIJsonSpecificationInspectionTest.kt index 361cf1b..b611de5 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/AsyncAPIJsonSchemaInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,12 +1,12 @@ package com.asyncapi.plugin.idea.inspection.v2_0_0 -import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSchemaInspectionTest +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest /** * @author Pavel Bodiachevskii * @since 1.6.0 */ -class AsyncAPIJsonSchemaInspectionTest: AbstractAsyncAPIJsonSchemaInspectionTest() { +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.0.0" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/AsyncAPIJsonSchemaInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 67% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/AsyncAPIJsonSchemaInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/AsyncAPIJsonSpecificationInspectionTest.kt index a51bf70..f58517c 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/AsyncAPIJsonSchemaInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,12 +1,12 @@ package com.asyncapi.plugin.idea.inspection.v2_1_0 -import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSchemaInspectionTest +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest /** * @author Pavel Bodiachevskii * @since 1.6.0 */ -class AsyncAPIJsonSchemaInspectionTest: AbstractAsyncAPIJsonSchemaInspectionTest() { +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.1.0" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/AsyncAPIJsonSchemaInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 67% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/AsyncAPIJsonSchemaInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/AsyncAPIJsonSpecificationInspectionTest.kt index eca6ddc..ff008a8 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/AsyncAPIJsonSchemaInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,12 +1,12 @@ package com.asyncapi.plugin.idea.inspection.v2_2_0 -import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSchemaInspectionTest +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest /** * @author Pavel Bodiachevskii * @since 1.6.0 */ -class AsyncAPIJsonSchemaInspectionTest: AbstractAsyncAPIJsonSchemaInspectionTest() { +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.2.0" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/AsyncAPIJsonSchemaInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 67% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/AsyncAPIJsonSchemaInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/AsyncAPIJsonSpecificationInspectionTest.kt index 88d091a..965ad3c 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/AsyncAPIJsonSchemaInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,12 +1,12 @@ package com.asyncapi.plugin.idea.inspection.v2_3_0 -import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSchemaInspectionTest +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest /** * @author Pavel Bodiachevskii * @since 1.6.0 */ -class AsyncAPIJsonSchemaInspectionTest: AbstractAsyncAPIJsonSchemaInspectionTest() { +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.3.0" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/AsyncAPIJsonSchemaInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 67% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/AsyncAPIJsonSchemaInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/AsyncAPIJsonSpecificationInspectionTest.kt index aaeba5f..87f7e1f 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/AsyncAPIJsonSchemaInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,12 +1,12 @@ package com.asyncapi.plugin.idea.inspection.v2_4_0 -import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSchemaInspectionTest +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest /** * @author Pavel Bodiachevskii * @since 1.6.0 */ -class AsyncAPIJsonSchemaInspectionTest: AbstractAsyncAPIJsonSchemaInspectionTest() { +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.4.0" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/AsyncAPIJsonSchemaInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 67% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/AsyncAPIJsonSchemaInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/AsyncAPIJsonSpecificationInspectionTest.kt index 1edad93..b08dfbe 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/AsyncAPIJsonSchemaInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,12 +1,12 @@ package com.asyncapi.plugin.idea.inspection.v2_5_0 -import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSchemaInspectionTest +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest /** * @author Pavel Bodiachevskii * @since 1.6.0 */ -class AsyncAPIJsonSchemaInspectionTest: AbstractAsyncAPIJsonSchemaInspectionTest() { +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.5.0" diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/AsyncAPIJsonSchemaInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 67% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/AsyncAPIJsonSchemaInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/AsyncAPIJsonSpecificationInspectionTest.kt index 0469c72..eb3cf3c 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/AsyncAPIJsonSchemaInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,12 +1,12 @@ package com.asyncapi.plugin.idea.inspection.v2_6_0 -import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSchemaInspectionTest +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest /** * @author Pavel Bodiachevskii * @since 2.3.0 */ -class AsyncAPIJsonSchemaInspectionTest: AbstractAsyncAPIJsonSchemaInspectionTest() { +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.6.0" From acbb641a91e34f0edc14a371bc445a55c75cc5c6 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 02:04:24 +0400 Subject: [PATCH 40/57] refactor: change schema in names to specification --- src/main/resources/META-INF/plugin.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 70394d4..a03342b 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -33,7 +33,7 @@ - + @@ -54,7 +54,7 @@ - + From e849d3b224e43dd96139bf2f229b79ff6e7c0d06 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 02:10:15 +0400 Subject: [PATCH 41/57] refactor: move xpath tests to correct package --- .../plugin/idea/_core/{ => xpath}/JsonFileXPathTest.kt | 3 +-- .../plugin/idea/_core/{ => xpath}/YamlFileXPathTest.kt | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) rename src/test/kotlin/com/asyncapi/plugin/idea/_core/{ => xpath}/JsonFileXPathTest.kt (95%) rename src/test/kotlin/com/asyncapi/plugin/idea/_core/{ => xpath}/YamlFileXPathTest.kt (95%) diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/JsonFileXPathTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPathTest.kt similarity index 95% rename from src/test/kotlin/com/asyncapi/plugin/idea/_core/JsonFileXPathTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPathTest.kt index 0c410c5..68dbcea 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/JsonFileXPathTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPathTest.kt @@ -1,6 +1,5 @@ -package com.asyncapi.plugin.idea._core +package com.asyncapi.plugin.idea._core.xpath -import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath import com.intellij.json.psi.JsonFile import com.intellij.lang.Language import com.intellij.psi.PsiFileFactory diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/YamlFileXPathTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPathTest.kt similarity index 95% rename from src/test/kotlin/com/asyncapi/plugin/idea/_core/YamlFileXPathTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPathTest.kt index 81533d8..58b6c7f 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/YamlFileXPathTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPathTest.kt @@ -1,6 +1,5 @@ -package com.asyncapi.plugin.idea._core +package com.asyncapi.plugin.idea._core.xpath -import com.asyncapi.plugin.idea._core.xpath.YamlFileXPath import com.intellij.lang.Language import com.intellij.psi.PsiFileFactory import com.intellij.testFramework.fixtures.BasePlatformTestCase From 8511a13e6588468b5065df7bf1ca3077ac39f20b Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 02:35:34 +0400 Subject: [PATCH 42/57] text: PsiFileXPath v3 --- .../_core/xpath/{ => v2}/JsonFileXPathTest.kt | 23 ++++---- .../_core/xpath/{ => v2}/YamlFileXPathTest.kt | 23 ++++---- .../idea/_core/xpath/v3/JsonFileXPathTest.kt | 55 ++++++++++++++++++ .../idea/_core/xpath/v3/YamlFileXPathTest.kt | 56 +++++++++++++++++++ 4 files changed, 135 insertions(+), 22 deletions(-) rename src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/{ => v2}/JsonFileXPathTest.kt (77%) rename src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/{ => v2}/YamlFileXPathTest.kt (78%) create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v3/JsonFileXPathTest.kt create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v3/YamlFileXPathTest.kt diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPathTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v2/JsonFileXPathTest.kt similarity index 77% rename from src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPathTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v2/JsonFileXPathTest.kt index 68dbcea..c25f93c 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/JsonFileXPathTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v2/JsonFileXPathTest.kt @@ -1,5 +1,6 @@ -package com.asyncapi.plugin.idea._core.xpath +package com.asyncapi.plugin.idea._core.xpath.v2 +import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath import com.intellij.json.psi.JsonFile import com.intellij.lang.Language import com.intellij.psi.PsiFileFactory @@ -12,40 +13,40 @@ import junit.framework.TestCase class JsonFileXPathTest: BasePlatformTestCase() { fun `test - 2_0_0`() { - test("asyncapi", "2.0.0") + run("asyncapi", "2.0.0") } fun `test - 2_1_0`() { - test("asyncapi", "2.1.0") + run("asyncapi", "2.1.0") } fun `test - 2_2_0`() { - test("asyncapi", "2.2.0") + run("asyncapi", "2.2.0") } fun `test - 2_3_0`() { - test("asyncapi", "2.3.0") + run("asyncapi", "2.3.0") } fun `test - 2_4_0`() { - test("asyncapi", "2.4.0") + run("asyncapi", "2.4.0") } fun `test - 2_5_0`() { - test("asyncapi", "2.5.0") + run("asyncapi", "2.5.0") } fun `test - 2_6_0`() { - test("asyncapi", "2.6.0") + run("asyncapi", "2.6.0") } - fun test(asyncapi: String, version: String) { + private fun run(asyncapi: String, version: String) { val psiFileFactory = PsiFileFactory.getInstance(project) - val asyncAPISchema = this.javaClass.getResource("/$asyncapi-$version.json").readText() + val asyncAPISpecification = this.javaClass.getResource("/$asyncapi-$version.json").readText() val asyncAPIPSI = psiFileFactory.createFileFromText( "$asyncapi-$version.json", Language.findLanguageByID("JSON")!!, - asyncAPISchema + asyncAPISpecification ) as JsonFile collectReferencesToMessages(asyncAPIPSI) diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPathTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v2/YamlFileXPathTest.kt similarity index 78% rename from src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPathTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v2/YamlFileXPathTest.kt index 58b6c7f..cd7388f 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/YamlFileXPathTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v2/YamlFileXPathTest.kt @@ -1,5 +1,6 @@ -package com.asyncapi.plugin.idea._core.xpath +package com.asyncapi.plugin.idea._core.xpath.v2 +import com.asyncapi.plugin.idea._core.xpath.YamlFileXPath import com.intellij.lang.Language import com.intellij.psi.PsiFileFactory import com.intellij.testFramework.fixtures.BasePlatformTestCase @@ -13,40 +14,40 @@ import org.jetbrains.yaml.psi.YAMLFile class YamlFileXPathTest: BasePlatformTestCase() { fun `test - 2_0_0`() { - test("asyncapi", "2.0.0") + run("asyncapi", "2.0.0") } fun `test - 2_1_0`() { - test("asyncapi", "2.1.0") + run("asyncapi", "2.1.0") } fun `test - 2_2_0`() { - test("asyncapi", "2.2.0") + run("asyncapi", "2.2.0") } fun `test - 2_3_0`() { - test("asyncapi", "2.3.0") + run("asyncapi", "2.3.0") } fun `test - 2_4_0`() { - test("asyncapi", "2.4.0") + run("asyncapi", "2.4.0") } fun `test - 2_5_0`() { - test("asyncapi", "2.5.0") + run("asyncapi", "2.5.0") } fun `test - 2_6_0`() { - test("asyncapi", "2.6.0") + run("asyncapi", "2.6.0") } - fun test(asyncapi: String, version: String) { + fun run(asyncapi: String, version: String) { val psiFileFactory = PsiFileFactory.getInstance(project) - val asyncAPISchema = this.javaClass.getResource("/$asyncapi-$version.yaml").readText() + val asyncAPISpecification = this.javaClass.getResource("/$asyncapi-$version.yaml").readText() val asyncAPIPSI = psiFileFactory.createFileFromText( "$asyncapi-$version.yaml", Language.findInstance(YAMLLanguage::class.java), - asyncAPISchema + asyncAPISpecification ) as YAMLFile collectReferencesToMessages(asyncAPIPSI) diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v3/JsonFileXPathTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v3/JsonFileXPathTest.kt new file mode 100644 index 0000000..5512474 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v3/JsonFileXPathTest.kt @@ -0,0 +1,55 @@ +package com.asyncapi.plugin.idea._core.xpath.v3 + +import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath +import com.intellij.json.psi.JsonFile +import com.intellij.lang.Language +import com.intellij.psi.PsiFileFactory +import com.intellij.testFramework.fixtures.BasePlatformTestCase +import junit.framework.TestCase + +/** + * @author Pavel Bodiachevskii + */ +class JsonFileXPathTest: BasePlatformTestCase() { + + fun `test - 3_0_0`() { + run("asyncapi", "3.0.0") + } + + private fun run(asyncapi: String, version: String) { + val psiFileFactory = PsiFileFactory.getInstance(project) + val asyncAPISpecification = this.javaClass.getResource("/$asyncapi-$version.json").readText() + val asyncAPIPSI = psiFileFactory.createFileFromText( + "$asyncapi-$version.json", + Language.findLanguageByID("JSON")!!, + asyncAPISpecification + ) as JsonFile + + collectReferencesToMessages(asyncAPIPSI) + collectReferencesToChannels(asyncAPIPSI) + collectAsyncAPI(asyncAPIPSI, version) + } + + private fun collectReferencesToMessages(asyncAPI: JsonFile) { + val userSignedUp = listOf( + "#/components/messages/UserSignedUp", + ) + + TestCase.assertEquals(userSignedUp, JsonFileXPath.findText(asyncAPI, "$.channels.*.messages.*.\$ref")) + TestCase.assertEquals(userSignedUp, JsonFileXPath.findText(asyncAPI, "$.channels.userSignedup.messages.*.\$ref")) + } + + private fun collectReferencesToChannels(asyncAPI: JsonFile) { + val userSignedup = listOf( + "#/channels/userSignedup", + ) + + TestCase.assertEquals(userSignedup, JsonFileXPath.findText(asyncAPI, "$.operations.*.channel.\$ref")) + TestCase.assertEquals(userSignedup, JsonFileXPath.findText(asyncAPI, "$.operations.processUserSignups.channel.\$ref")) + } + + private fun collectAsyncAPI(asyncAPI: JsonFile, version: String) { + TestCase.assertEquals(listOf(version), JsonFileXPath.findText(asyncAPI, "$.asyncapi")) + } + +} \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v3/YamlFileXPathTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v3/YamlFileXPathTest.kt new file mode 100644 index 0000000..1cf9317 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/xpath/v3/YamlFileXPathTest.kt @@ -0,0 +1,56 @@ +package com.asyncapi.plugin.idea._core.xpath.v3 + +import com.asyncapi.plugin.idea._core.xpath.YamlFileXPath +import com.intellij.lang.Language +import com.intellij.psi.PsiFileFactory +import com.intellij.testFramework.fixtures.BasePlatformTestCase +import junit.framework.TestCase +import org.jetbrains.yaml.YAMLLanguage +import org.jetbrains.yaml.psi.YAMLFile + +/** + * @author Pavel Bodiachevskii + */ +class YamlFileXPathTest: BasePlatformTestCase() { + + fun `test - 3_0_0`() { + run("asyncapi", "3.0.0") + } + + fun run(asyncapi: String, version: String) { + val psiFileFactory = PsiFileFactory.getInstance(project) + val asyncAPISpecification = this.javaClass.getResource("/$asyncapi-$version.yaml").readText() + val asyncAPIPSI = psiFileFactory.createFileFromText( + "$asyncapi-$version.yaml", + Language.findInstance(YAMLLanguage::class.java), + asyncAPISpecification + ) as YAMLFile + + collectReferencesToMessages(asyncAPIPSI) + collectReferencesToChannels(asyncAPIPSI) + collectAsyncAPI(asyncAPIPSI, version) + } + + private fun collectReferencesToMessages(asyncAPI: YAMLFile) { + val userSignedUp = listOf( + "#/components/messages/UserSignedUp", + ) + + TestCase.assertEquals(userSignedUp, YamlFileXPath.findText(asyncAPI, "$.channels.*.messages.*.\$ref")) + TestCase.assertEquals(userSignedUp, YamlFileXPath.findText(asyncAPI, "$.channels.userSignedup.messages.*.\$ref")) + } + + private fun collectReferencesToChannels(asyncAPI: YAMLFile) { + val userSignedup = listOf( + "#/channels/userSignedup", + ) + + TestCase.assertEquals(userSignedup, YamlFileXPath.findText(asyncAPI, "$.operations.*.channel.\$ref")) + TestCase.assertEquals(userSignedup, YamlFileXPath.findText(asyncAPI, "$.operations.processUserSignups.channel.\$ref")) + } + + private fun collectAsyncAPI(asyncAPI: YAMLFile, version: String) { + TestCase.assertEquals(listOf(version), YamlFileXPath.findText(asyncAPI, "$.asyncapi")) + } + +} \ No newline at end of file From 3b50e1fda424f2cd216c4e34e784dd971203b27f Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 02:41:46 +0400 Subject: [PATCH 43/57] refactor: change schema in names to specification --- .../_core/AsyncAPIJsonSchemaProviderTest.kt | 54 +++++++++---------- .../reference/JsonFileVariantsProviderTest.kt | 10 ++-- .../reference/YamlFileVariantsProviderTest.kt | 10 ++-- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProviderTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProviderTest.kt index 683e463..d6eba68 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProviderTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPIJsonSchemaProviderTest.kt @@ -50,14 +50,14 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertNull(asyncAPIJsonSchemaProvider.provide(asyncAPIPSI, project)) } - fun `test (json) - provide when file is not AsyncAPI schema`() { + fun `test (json) - provide when file is not AsyncAPI specification`() { val psiFileFactory = PsiFileFactory.getInstance(project) val asyncAPIPSI = psiFileFactory.createFileFromText( "asyncapi-2.0.0.json", Language.findLanguageByID("JSON")!!, """ { - "type": "AsyncAPI schema" + "type": "AsyncAPI specification" } """.trimIndent() ) as JsonFile @@ -67,13 +67,13 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertNull(asyncAPIJsonSchemaProvider.provide(asyncAPIPSI, project)) } - fun `test (yaml) - provide when file is not AsyncAPI schema`() { + fun `test (yaml) - provide when file is not AsyncAPI specification`() { val psiFileFactory = PsiFileFactory.getInstance(project) val asyncAPIPSI = psiFileFactory.createFileFromText( "asyncapi-2.0.0.yaml", YAMLLanguage.INSTANCE, """ - type: AsyncAPI schema + type: AsyncAPI specification """.trimIndent() ) as YAMLFile @@ -82,7 +82,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertNull(asyncAPIJsonSchemaProvider.provide(asyncAPIPSI, project)) } - fun `test (yaml) - provide when file is 2_0_0 AsyncAPI schema`() { + fun `test (yaml) - provide when file is 2_0_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.0.0", false) TestCase.assertNotNull(asyncAPIPSI) @@ -93,7 +93,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.0.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (yaml) - provide when file is 2_1_0 AsyncAPI schema`() { + fun `test (yaml) - provide when file is 2_1_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.1.0", false) TestCase.assertNotNull(asyncAPIPSI) @@ -104,7 +104,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.1.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (yaml) - provide when file is 2_2_0 AsyncAPI schema`() { + fun `test (yaml) - provide when file is 2_2_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.2.0", false) TestCase.assertNotNull(asyncAPIPSI) @@ -115,7 +115,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.2.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (yaml) - provide when file is 2_3_0 AsyncAPI schema`() { + fun `test (yaml) - provide when file is 2_3_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.3.0", false) TestCase.assertNotNull(asyncAPIPSI) @@ -126,7 +126,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.3.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (yaml) - provide when file is 2_4_0 AsyncAPI schema`() { + fun `test (yaml) - provide when file is 2_4_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.4.0", false) TestCase.assertNotNull(asyncAPIPSI) @@ -137,7 +137,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.4.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (yaml) - provide when file is 2_5_0 AsyncAPI schema`() { + fun `test (yaml) - provide when file is 2_5_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.5.0", false) TestCase.assertNotNull(asyncAPIPSI) @@ -148,7 +148,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.5.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (yaml) - provide when file is 2_6_0 AsyncAPI schema`() { + fun `test (yaml) - provide when file is 2_6_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.6.0", false) TestCase.assertNotNull(asyncAPIPSI) @@ -159,7 +159,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.6.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (yaml) - provide when file is 3_0_0 AsyncAPI schema`() { + fun `test (yaml) - provide when file is 3_0_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-3.0.0", false) TestCase.assertNotNull(asyncAPIPSI) @@ -170,7 +170,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-3.0.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (yaml) - v2 provide when file is AsyncAPI schema with unknown version`() { + fun `test (yaml) - v2 provide when file is AsyncAPI specification with unknown version`() { val asyncAPIPSI = prepareFile("asyncapi-2.99.99", false) TestCase.assertNotNull(asyncAPIPSI) @@ -180,7 +180,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertNull(jsonSchemaObject) } - fun `test (yaml) - v3 provide when file is AsyncAPI schema with unknown version`() { + fun `test (yaml) - v3 provide when file is AsyncAPI specification with unknown version`() { val asyncAPIPSI = prepareFile("asyncapi-3.99.99", false) TestCase.assertNotNull(asyncAPIPSI) @@ -190,7 +190,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertNull(jsonSchemaObject) } - fun `test (json) - provide when file is 2_0_0 AsyncAPI schema`() { + fun `test (json) - provide when file is 2_0_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.0.0", true) TestCase.assertNotNull(asyncAPIPSI) @@ -201,7 +201,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.0.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (json) - provide when file is 2_1_0 AsyncAPI schema`() { + fun `test (json) - provide when file is 2_1_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.1.0", true) TestCase.assertNotNull(asyncAPIPSI) @@ -212,7 +212,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.1.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (json) - provide when file is 2_2_0 AsyncAPI schema`() { + fun `test (json) - provide when file is 2_2_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.2.0", true) TestCase.assertNotNull(asyncAPIPSI) @@ -223,7 +223,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.2.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (json) - provide when file is 2_3_0 AsyncAPI schema`() { + fun `test (json) - provide when file is 2_3_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.3.0", true) TestCase.assertNotNull(asyncAPIPSI) @@ -234,7 +234,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.3.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (json) - provide when file is 2_4_0 AsyncAPI schema`() { + fun `test (json) - provide when file is 2_4_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.4.0", true) TestCase.assertNotNull(asyncAPIPSI) @@ -245,7 +245,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.4.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (json) - provide when file is 2_5_0 AsyncAPI schema`() { + fun `test (json) - provide when file is 2_5_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.5.0", true) TestCase.assertNotNull(asyncAPIPSI) @@ -256,7 +256,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.5.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (json) - provide when file is 2_6_0 AsyncAPI schema`() { + fun `test (json) - provide when file is 2_6_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-2.6.0", true) TestCase.assertNotNull(asyncAPIPSI) @@ -267,7 +267,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-2.6.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (json) - provide when file is 3_0_0 AsyncAPI schema`() { + fun `test (json) - provide when file is 3_0_0 AsyncAPI specification`() { val asyncAPIPSI = prepareFile("asyncapi-3.0.0", true) TestCase.assertNotNull(asyncAPIPSI) @@ -278,7 +278,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertEquals("/schema/asyncapi-3.0.0.json", jsonSchemaObject!!.fileUrl!!.takeLast(27)) } - fun `test (json) - v2 provide when file is AsyncAPI schema with unknown version`() { + fun `test (json) - v2 provide when file is AsyncAPI specification with unknown version`() { val asyncAPIPSI = prepareFile("asyncapi-2.99.99", true) TestCase.assertNotNull(asyncAPIPSI) @@ -288,7 +288,7 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { TestCase.assertNull(jsonSchemaObject) } - fun `test (json) - v3 provide when file is AsyncAPI schema with unknown version`() { + fun `test (json) - v3 provide when file is AsyncAPI specification with unknown version`() { val asyncAPIPSI = prepareFile("asyncapi-3.99.99", true) TestCase.assertNotNull(asyncAPIPSI) @@ -307,19 +307,19 @@ class AsyncAPIJsonSchemaProviderTest: BasePlatformTestCase() { "$fileName.yaml" } - val asyncAPISchema = this.javaClass.getResource("/$name").readText() + val asyncAPISpecification = this.javaClass.getResource("/$name").readText() return if (isJson) { psiFileFactory.createFileFromText( name, Language.findLanguageByID("JSON")!!, - asyncAPISchema + asyncAPISpecification ) as JsonFile } else { psiFileFactory.createFileFromText( name, YAMLLanguage.INSTANCE, - asyncAPISchema + asyncAPISpecification ) as YAMLFile } } diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/JsonFileVariantsProviderTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/JsonFileVariantsProviderTest.kt index 8da1dab..edcad72 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/JsonFileVariantsProviderTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/JsonFileVariantsProviderTest.kt @@ -53,11 +53,11 @@ class JsonFileVariantsProviderTest: BasePlatformTestCase() { private fun testCompletion(asyncapi: String) { val psiFileFactory = PsiFileFactory.getInstance(project) - val asyncAPISchema = this.javaClass.getResource("/$asyncapi.json").readText() + val asyncAPISpecification = this.javaClass.getResource("/$asyncapi.json").readText() val asyncAPIPSI = psiFileFactory.createFileFromText( "$asyncapi.json", Language.findLanguageByID("JSON")!!, - asyncAPISchema + asyncAPISpecification ) as JsonFile TestCase.assertEquals(listOf("#/components", "#/components/messages"), collectVariants("#/co", asyncAPIPSI)) @@ -131,13 +131,13 @@ class JsonFileVariantsProviderTest: BasePlatformTestCase() { TestCase.assertTrue("In case of wrong property name variants must be empty", collectVariants("#/$%^^", asyncAPIPSI).isEmpty()) } - private fun collectVariants(xpath: String, schema: JsonFile): List { + private fun collectVariants(xpath: String, specification: JsonFile): List { val psiPath = JsonFileXPath.compileXPath(xpath) - val foundPsiElements = JsonFileXPath.findPsi(schema, psiPath, true) + val foundPsiElements = JsonFileXPath.findPsi(specification, psiPath, true) return JsonFileVariantsProvider( foundPsiElements.filterIsInstance(), - schema.name, + specification.name, psiPath ).variants().map { it.lookupString } } diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/YamlFileVariantsProviderTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/YamlFileVariantsProviderTest.kt index f65a883..a2582b6 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/YamlFileVariantsProviderTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/YamlFileVariantsProviderTest.kt @@ -54,11 +54,11 @@ class YamlFileVariantsProviderTest: BasePlatformTestCase() { fun testCompletion(asyncapi: String) { val psiFileFactory = PsiFileFactory.getInstance(project) - val asyncAPISchema = this.javaClass.getResource("/$asyncapi.yaml").readText() + val asyncAPISpecification = this.javaClass.getResource("/$asyncapi.yaml").readText() val asyncAPIPSI = psiFileFactory.createFileFromText( "$asyncapi.yaml", YAMLLanguage.INSTANCE, - asyncAPISchema + asyncAPISpecification ) as YAMLFile TestCase.assertEquals(listOf("#/components", "#/components/messages"), collectVariants("#/co", asyncAPIPSI)) @@ -132,13 +132,13 @@ class YamlFileVariantsProviderTest: BasePlatformTestCase() { TestCase.assertTrue("In case of wrong property name variants must be empty", collectVariants("#/$%^^", asyncAPIPSI).isEmpty()) } - private fun collectVariants(xpath: String, schema: YAMLFile): List { + private fun collectVariants(xpath: String, specification: YAMLFile): List { val psiPath = JsonFileXPath.compileXPath(xpath) - val foundPsiElements = YamlFileXPath.findPsi(schema, psiPath, true) + val foundPsiElements = YamlFileXPath.findPsi(specification, psiPath, true) return YamlFileVariantsProvider( foundPsiElements.filterIsInstance(), - schema.name, + specification.name, psiPath ).variants().map { it.lookupString } } From efd1432dee29a8c99a2d503557f3b61dd90256c4 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 02:51:10 +0400 Subject: [PATCH 44/57] refactor: move v2 inspection tests to correct package --- .../AsyncAPIJsonSpecificationInspectionTest.kt | 2 +- .../AsyncAPIJsonSpecificationInspectionTest.kt | 2 +- .../AsyncAPIJsonSpecificationInspectionTest.kt | 2 +- .../AsyncAPIJsonSpecificationInspectionTest.kt | 2 +- .../AsyncAPIJsonSpecificationInspectionTest.kt | 2 +- .../AsyncAPIJsonSpecificationInspectionTest.kt | 2 +- .../AsyncAPIJsonSpecificationInspectionTest.kt | 2 +- .../AsyncAPIJsonSpecificationInspectionTest.kt | 4 ++-- .../_0_0/AsyncAPIJsonSpecificationInspectionTest.kt | 13 +++++++++++++ .../inspection/{unknown => 2.99.99}/extra keys.json | 0 .../{unknown => 2.99.99}/without channels.json | 0 11 files changed, 22 insertions(+), 9 deletions(-) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/{v2_0_0 => v2/_0_0}/AsyncAPIJsonSpecificationInspectionTest.kt (86%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/{v2_1_0 => v2/_1_0}/AsyncAPIJsonSpecificationInspectionTest.kt (86%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/{v2_2_0 => v2/_2_0}/AsyncAPIJsonSpecificationInspectionTest.kt (86%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/{v2_3_0 => v2/_3_0}/AsyncAPIJsonSpecificationInspectionTest.kt (86%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/{v2_4_0 => v2/_4_0}/AsyncAPIJsonSpecificationInspectionTest.kt (86%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/{v2_5_0 => v2/_5_0}/AsyncAPIJsonSpecificationInspectionTest.kt (86%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/{v2_6_0 => v2/_6_0}/AsyncAPIJsonSpecificationInspectionTest.kt (86%) rename src/test/kotlin/com/asyncapi/plugin/idea/inspection/{unknown => v2/_99_99}/AsyncAPIJsonSpecificationInspectionTest.kt (79%) create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt rename src/test/testData/json/inspection/{unknown => 2.99.99}/extra keys.json (100%) rename src/test/testData/json/inspection/{unknown => 2.99.99}/without channels.json (100%) diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 86% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/AsyncAPIJsonSpecificationInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt index b611de5..f576cf4 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_0_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.inspection.v2_0_0 +package com.asyncapi.plugin.idea.inspection.v2._0_0 import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_1_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 86% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/AsyncAPIJsonSpecificationInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_1_0/AsyncAPIJsonSpecificationInspectionTest.kt index f58517c..f31e447 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_1_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_1_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.inspection.v2_1_0 +package com.asyncapi.plugin.idea.inspection.v2._1_0 import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_2_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 86% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/AsyncAPIJsonSpecificationInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_2_0/AsyncAPIJsonSpecificationInspectionTest.kt index ff008a8..74f319c 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_2_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_2_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.inspection.v2_2_0 +package com.asyncapi.plugin.idea.inspection.v2._2_0 import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_3_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 86% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/AsyncAPIJsonSpecificationInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_3_0/AsyncAPIJsonSpecificationInspectionTest.kt index 965ad3c..f28f0a5 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_3_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_3_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.inspection.v2_3_0 +package com.asyncapi.plugin.idea.inspection.v2._3_0 import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_4_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 86% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/AsyncAPIJsonSpecificationInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_4_0/AsyncAPIJsonSpecificationInspectionTest.kt index 87f7e1f..924dda9 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_4_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_4_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.inspection.v2_4_0 +package com.asyncapi.plugin.idea.inspection.v2._4_0 import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_5_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 86% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/AsyncAPIJsonSpecificationInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_5_0/AsyncAPIJsonSpecificationInspectionTest.kt index b08dfbe..98c0984 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_5_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_5_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.inspection.v2_5_0 +package com.asyncapi.plugin.idea.inspection.v2._5_0 import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_6_0/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 86% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/AsyncAPIJsonSpecificationInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_6_0/AsyncAPIJsonSpecificationInspectionTest.kt index eb3cf3c..bef19c2 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2_6_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_6_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.inspection.v2_6_0 +package com.asyncapi.plugin.idea.inspection.v2._6_0 import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt similarity index 79% rename from src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/AsyncAPIJsonSpecificationInspectionTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt index 1433e31..f92c172 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/unknown/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.inspection.unknown +package com.asyncapi.plugin.idea.inspection.v2._99_99 import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest @@ -8,6 +8,6 @@ import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInsp */ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { - override fun getTestDataPath(): String = "src/test/testData/json/inspection/unknown" + override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.99.99" } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt new file mode 100644 index 0000000..5cc955b --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -0,0 +1,13 @@ +package com.asyncapi.plugin.idea.inspection.v3._0_0 + +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest + +/** + * @author Pavel Bodiachevskii + * @since 1.6.0 + */ +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { + + override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.0.0" + +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/unknown/extra keys.json b/src/test/testData/json/inspection/2.99.99/extra keys.json similarity index 100% rename from src/test/testData/json/inspection/unknown/extra keys.json rename to src/test/testData/json/inspection/2.99.99/extra keys.json diff --git a/src/test/testData/json/inspection/unknown/without channels.json b/src/test/testData/json/inspection/2.99.99/without channels.json similarity index 100% rename from src/test/testData/json/inspection/unknown/without channels.json rename to src/test/testData/json/inspection/2.99.99/without channels.json From b018e6e1c0417442b05a7a324afdd85fede862c0 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 03:03:11 +0400 Subject: [PATCH 45/57] test: v3 AsyncAPI inspection --- ...AsyncAPIJsonSpecificationInspectionTest.kt | 6 ++- ...AsyncAPIJsonSpecificationInspectionTest.kt | 2 + ...AsyncAPIJsonSpecificationInspectionTest.kt | 2 + ...AsyncAPIJsonSpecificationInspectionTest.kt | 2 + ...AsyncAPIJsonSpecificationInspectionTest.kt | 2 + ...AsyncAPIJsonSpecificationInspectionTest.kt | 2 + ...AsyncAPIJsonSpecificationInspectionTest.kt | 2 + ...AsyncAPIJsonSpecificationInspectionTest.kt | 2 + ...AsyncAPIJsonSpecificationInspectionTest.kt | 2 + ...AsyncAPIJsonSpecificationInspectionTest.kt | 4 +- ...AsyncAPIJsonSpecificationInspectionTest.kt | 15 ++++++ .../json/inspection/3.0.0/extra keys.json | 48 +++++++++++++++++++ .../json/inspection/3.0.0/without info.json | 34 +++++++++++++ .../json/inspection/3.99.99/extra keys.json | 47 ++++++++++++++++++ .../json/inspection/3.99.99/without info.json | 34 +++++++++++++ 15 files changed, 201 insertions(+), 3 deletions(-) create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt create mode 100644 src/test/testData/json/inspection/3.0.0/extra keys.json create mode 100644 src/test/testData/json/inspection/3.0.0/without info.json create mode 100644 src/test/testData/json/inspection/3.99.99/extra keys.json create mode 100644 src/test/testData/json/inspection/3.99.99/without info.json diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSpecificationInspectionTest.kt index e88c3b5..dd1e2cb 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/AbstractAsyncAPIJsonSpecificationInspectionTest.kt @@ -11,6 +11,8 @@ abstract class AbstractAsyncAPIJsonSpecificationInspectionTest: BasePlatformTest override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.0.0" + abstract fun specificationWithoutRequiredProperty(): String + fun `test - with extra keys`() { myFixture.configureByFile("extra keys.json") myFixture.enableInspections(AsyncAPIJsonSpecificationInspection::class.java) @@ -18,8 +20,8 @@ abstract class AbstractAsyncAPIJsonSpecificationInspectionTest: BasePlatformTest myFixture.checkHighlighting() } - fun `test - without channels`() { - myFixture.configureByFile("without channels.json") + fun `test - without required property`() { + myFixture.configureByFile(specificationWithoutRequiredProperty()) myFixture.enableInspections(AsyncAPIJsonSpecificationInspection::class.java) myFixture.checkHighlighting() diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt index f576cf4..1a30d50 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -10,4 +10,6 @@ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecification override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.0.0" + override fun specificationWithoutRequiredProperty(): String = "without channels.json" + } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_1_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_1_0/AsyncAPIJsonSpecificationInspectionTest.kt index f31e447..964593f 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_1_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_1_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -10,4 +10,6 @@ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecification override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.1.0" + override fun specificationWithoutRequiredProperty(): String = "without channels.json" + } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_2_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_2_0/AsyncAPIJsonSpecificationInspectionTest.kt index 74f319c..89aec8a 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_2_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_2_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -10,4 +10,6 @@ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecification override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.2.0" + override fun specificationWithoutRequiredProperty(): String = "without channels.json" + } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_3_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_3_0/AsyncAPIJsonSpecificationInspectionTest.kt index f28f0a5..b77c8a5 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_3_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_3_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -10,4 +10,6 @@ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecification override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.3.0" + override fun specificationWithoutRequiredProperty(): String = "without channels.json" + } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_4_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_4_0/AsyncAPIJsonSpecificationInspectionTest.kt index 924dda9..86258e4 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_4_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_4_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -10,4 +10,6 @@ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecification override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.4.0" + override fun specificationWithoutRequiredProperty(): String = "without channels.json" + } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_5_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_5_0/AsyncAPIJsonSpecificationInspectionTest.kt index 98c0984..16cdc7a 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_5_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_5_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -10,4 +10,6 @@ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecification override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.5.0" + override fun specificationWithoutRequiredProperty(): String = "without channels.json" + } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_6_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_6_0/AsyncAPIJsonSpecificationInspectionTest.kt index bef19c2..6196063 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_6_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_6_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -10,4 +10,6 @@ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecification override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.6.0" + override fun specificationWithoutRequiredProperty(): String = "without channels.json" + } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt index f92c172..1892aef 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v2/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt @@ -10,4 +10,6 @@ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecification override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.99.99" + override fun specificationWithoutRequiredProperty(): String = "without channels.json" + } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt index 5cc955b..1957d8a 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_0_0/AsyncAPIJsonSpecificationInspectionTest.kt @@ -8,6 +8,8 @@ import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInsp */ class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { - override fun getTestDataPath(): String = "src/test/testData/json/inspection/2.0.0" + override fun getTestDataPath(): String = "src/test/testData/json/inspection/3.0.0" + + override fun specificationWithoutRequiredProperty(): String = "without info.json" } \ No newline at end of file diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt new file mode 100644 index 0000000..fcf2ed7 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/inspection/v3/_99_99/AsyncAPIJsonSpecificationInspectionTest.kt @@ -0,0 +1,15 @@ +package com.asyncapi.plugin.idea.inspection.v3._99_99 + +import com.asyncapi.plugin.idea.inspection.AbstractAsyncAPIJsonSpecificationInspectionTest + +/** + * @author Pavel Bodiachevskii + * @since 1.6.0 + */ +class AsyncAPIJsonSpecificationInspectionTest: AbstractAsyncAPIJsonSpecificationInspectionTest() { + + override fun getTestDataPath(): String = "src/test/testData/json/inspection/3.99.99" + + override fun specificationWithoutRequiredProperty(): String = "without info.json" + +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/3.0.0/extra keys.json b/src/test/testData/json/inspection/3.0.0/extra keys.json new file mode 100644 index 0000000..576d49d --- /dev/null +++ b/src/test/testData/json/inspection/3.0.0/extra keys.json @@ -0,0 +1,48 @@ +{ + "asyncapi": "3.0.0", + "revision": "1.72.22", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:", + "website": "https://asyncapi.com" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/messages/UserSignedUp" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/3.0.0/without info.json b/src/test/testData/json/inspection/3.0.0/without info.json new file mode 100644 index 0000000..5448e3a --- /dev/null +++ b/src/test/testData/json/inspection/3.0.0/without info.json @@ -0,0 +1,34 @@ +{ + "asyncapi": "3.0.0", + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + }, + "UserSignedOut": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/3.99.99/extra keys.json b/src/test/testData/json/inspection/3.99.99/extra keys.json new file mode 100644 index 0000000..1f88220 --- /dev/null +++ b/src/test/testData/json/inspection/3.99.99/extra keys.json @@ -0,0 +1,47 @@ +{ + "asyncapi": "3.99.99", + "revision": "1.72.22", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/messages/UserSignedUp" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/inspection/3.99.99/without info.json b/src/test/testData/json/inspection/3.99.99/without info.json new file mode 100644 index 0000000..683fd4d --- /dev/null +++ b/src/test/testData/json/inspection/3.99.99/without info.json @@ -0,0 +1,34 @@ +{ + "asyncapi": "3.99.99", + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + }, + "UserSignedOut": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + } + } + } + } + } + } +} \ No newline at end of file From c4295db0053b07667b056019593d76db5e132603 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 03:10:18 +0400 Subject: [PATCH 46/57] refactor: move v2 psi references tests to correct package --- .../idea/psi/reference/{ => v2}/JsonFileVariantsProviderTest.kt | 2 +- .../idea/psi/reference/{ => v2}/YamlFileVariantsProviderTest.kt | 2 +- .../reference/{v2_0_0 => v2/_0_0}/JsonReferenceVariantsTest.kt | 2 +- .../reference/{v2_0_0 => v2/_0_0}/YamlReferenceVariantsTest.kt | 2 +- .../reference/{v2_1_0 => v2/_1_0}/JsonReferenceVariantsTest.kt | 2 +- .../reference/{v2_1_0 => v2/_1_0}/YamlReferenceVariantsTest.kt | 2 +- .../reference/{v2_2_0 => v2/_2_0}/JsonReferenceVariantsTest.kt | 2 +- .../reference/{v2_2_0 => v2/_2_0}/YamlReferenceVariantsTest.kt | 2 +- .../reference/{v2_3_0 => v2/_3_0}/JsonReferenceVariantsTest.kt | 2 +- .../reference/{v2_3_0 => v2/_3_0}/YamlReferenceVariantsTest.kt | 2 +- .../reference/{v2_4_0 => v2/_4_0}/JsonReferenceVariantsTest.kt | 2 +- .../reference/{v2_4_0 => v2/_4_0}/YamlReferenceVariantsTest.kt | 2 +- .../reference/{v2_5_0 => v2/_5_0}/JsonReferenceVariantsTest.kt | 2 +- .../reference/{v2_5_0 => v2/_5_0}/YamlReferenceVariantsTest.kt | 2 +- .../reference/{v2_6_0 => v2/_6_0}/JsonReferenceVariantsTest.kt | 2 +- .../reference/{v2_6_0 => v2/_6_0}/YamlReferenceVariantsTest.kt | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{ => v2}/JsonFileVariantsProviderTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{ => v2}/YamlFileVariantsProviderTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_0_0 => v2/_0_0}/JsonReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_0_0 => v2/_0_0}/YamlReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_1_0 => v2/_1_0}/JsonReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_1_0 => v2/_1_0}/YamlReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_2_0 => v2/_2_0}/JsonReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_2_0 => v2/_2_0}/YamlReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_3_0 => v2/_3_0}/JsonReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_3_0 => v2/_3_0}/YamlReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_4_0 => v2/_4_0}/JsonReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_4_0 => v2/_4_0}/YamlReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_5_0 => v2/_5_0}/JsonReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_5_0 => v2/_5_0}/YamlReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_6_0 => v2/_6_0}/JsonReferenceVariantsTest.kt (99%) rename src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/{v2_6_0 => v2/_6_0}/YamlReferenceVariantsTest.kt (99%) diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/JsonFileVariantsProviderTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/JsonFileVariantsProviderTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/JsonFileVariantsProviderTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/JsonFileVariantsProviderTest.kt index edcad72..90775c1 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/JsonFileVariantsProviderTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/JsonFileVariantsProviderTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference +package com.asyncapi.plugin.idea.psi.reference.v2 import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath import com.asyncapi.plugin.idea.extensions.psi.reference.JsonFileVariantsProvider diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/YamlFileVariantsProviderTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/YamlFileVariantsProviderTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/YamlFileVariantsProviderTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/YamlFileVariantsProviderTest.kt index a2582b6..3a02401 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/YamlFileVariantsProviderTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/YamlFileVariantsProviderTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference +package com.asyncapi.plugin.idea.psi.reference.v2 import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath import com.asyncapi.plugin.idea._core.xpath.YamlFileXPath diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_0_0/JsonReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_0_0/JsonReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_0_0/JsonReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_0_0/JsonReferenceVariantsTest.kt index b595311..d3645e6 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_0_0/JsonReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_0_0/JsonReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_0_0 +package com.asyncapi.plugin.idea.psi.reference.v2._0_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_0_0/YamlReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_0_0/YamlReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_0_0/YamlReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_0_0/YamlReferenceVariantsTest.kt index 3bcca38..f89072b 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_0_0/YamlReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_0_0/YamlReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_0_0 +package com.asyncapi.plugin.idea.psi.reference.v2._0_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_1_0/JsonReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_1_0/JsonReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_1_0/JsonReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_1_0/JsonReferenceVariantsTest.kt index 0d336a0..f6805d3 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_1_0/JsonReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_1_0/JsonReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_1_0 +package com.asyncapi.plugin.idea.psi.reference.v2._1_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_1_0/YamlReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_1_0/YamlReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_1_0/YamlReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_1_0/YamlReferenceVariantsTest.kt index 911d8e7..47e9ef6 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_1_0/YamlReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_1_0/YamlReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_1_0 +package com.asyncapi.plugin.idea.psi.reference.v2._1_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_2_0/JsonReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_2_0/JsonReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_2_0/JsonReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_2_0/JsonReferenceVariantsTest.kt index 7e58edb..5e5670a 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_2_0/JsonReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_2_0/JsonReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_2_0 +package com.asyncapi.plugin.idea.psi.reference.v2._2_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_2_0/YamlReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_2_0/YamlReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_2_0/YamlReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_2_0/YamlReferenceVariantsTest.kt index 3d8b58b..62b7250 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_2_0/YamlReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_2_0/YamlReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_2_0 +package com.asyncapi.plugin.idea.psi.reference.v2._2_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_3_0/JsonReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_3_0/JsonReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_3_0/JsonReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_3_0/JsonReferenceVariantsTest.kt index 43a783e..64c802b 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_3_0/JsonReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_3_0/JsonReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_3_0 +package com.asyncapi.plugin.idea.psi.reference.v2._3_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_3_0/YamlReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_3_0/YamlReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_3_0/YamlReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_3_0/YamlReferenceVariantsTest.kt index daf37a3..4590ea0 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_3_0/YamlReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_3_0/YamlReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_3_0 +package com.asyncapi.plugin.idea.psi.reference.v2._3_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_4_0/JsonReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_4_0/JsonReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_4_0/JsonReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_4_0/JsonReferenceVariantsTest.kt index 64a7539..6b0034d 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_4_0/JsonReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_4_0/JsonReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_4_0 +package com.asyncapi.plugin.idea.psi.reference.v2._4_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_4_0/YamlReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_4_0/YamlReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_4_0/YamlReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_4_0/YamlReferenceVariantsTest.kt index b73e612..5cb6dd1 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_4_0/YamlReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_4_0/YamlReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_4_0 +package com.asyncapi.plugin.idea.psi.reference.v2._4_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_5_0/JsonReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_5_0/JsonReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_5_0/JsonReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_5_0/JsonReferenceVariantsTest.kt index 2355090..7cb7d9b 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_5_0/JsonReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_5_0/JsonReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_5_0 +package com.asyncapi.plugin.idea.psi.reference.v2._5_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_5_0/YamlReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_5_0/YamlReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_5_0/YamlReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_5_0/YamlReferenceVariantsTest.kt index 635e100..c523d6e 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_5_0/YamlReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_5_0/YamlReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_5_0 +package com.asyncapi.plugin.idea.psi.reference.v2._5_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_6_0/JsonReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_6_0/JsonReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_6_0/JsonReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_6_0/JsonReferenceVariantsTest.kt index a6fca1e..d7b5f09 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_6_0/JsonReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_6_0/JsonReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_6_0 +package com.asyncapi.plugin.idea.psi.reference.v2._6_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_6_0/YamlReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_6_0/YamlReferenceVariantsTest.kt similarity index 99% rename from src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_6_0/YamlReferenceVariantsTest.kt rename to src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_6_0/YamlReferenceVariantsTest.kt index 89576de..e90691b 100644 --- a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2_6_0/YamlReferenceVariantsTest.kt +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v2/_6_0/YamlReferenceVariantsTest.kt @@ -1,4 +1,4 @@ -package com.asyncapi.plugin.idea.psi.reference.v2_6_0 +package com.asyncapi.plugin.idea.psi.reference.v2._6_0 import com.intellij.codeInsight.completion.CompletionType import com.intellij.testFramework.fixtures.BasePlatformTestCase From ba1075e8e4ab73e3dd953d81f531e43e1290186f Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 03:16:06 +0400 Subject: [PATCH 47/57] test: AsyncAPI v3 json completion - variants provider test --- .../v3/JsonFileVariantsProviderTest.kt | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/JsonFileVariantsProviderTest.kt diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/JsonFileVariantsProviderTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/JsonFileVariantsProviderTest.kt new file mode 100644 index 0000000..3989539 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/JsonFileVariantsProviderTest.kt @@ -0,0 +1,125 @@ +package com.asyncapi.plugin.idea.psi.reference.v3 + +import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath +import com.asyncapi.plugin.idea.extensions.psi.reference.JsonFileVariantsProvider +import com.intellij.json.psi.JsonElement +import com.intellij.json.psi.JsonFile +import com.intellij.lang.Language +import com.intellij.psi.PsiFileFactory +import com.intellij.testFramework.fixtures.BasePlatformTestCase +import junit.framework.TestCase + +/* + LightPlatformCodeInsightTestCase + LightCompletionTestCase + CodeInsightFixtureTestCase + */ + +/** + * @author Pavel Bodiachevskii + */ +//class JsonSchemaReferenceCompletionTest: LightJavaCodeInsightFixtureTestCase() { +//class JsonSchemaReferenceCompletionTest: CompletionAutoPopupTestCase() { +//class JsonSchemaReferenceCompletionTest: BasePlatformTestCase() { +class JsonFileVariantsProviderTest: BasePlatformTestCase() { + + override fun getTestDataPath(): String { + return "src/test/testData" + } + + fun `test completion - 3_0_0`() { + testCompletion("asyncapi-3.0.0") + } + + private fun testCompletion(asyncapi: String) { + val psiFileFactory = PsiFileFactory.getInstance(project) + val asyncAPISpecification = this.javaClass.getResource("/$asyncapi.json").readText() + val asyncAPIPSI = psiFileFactory.createFileFromText( + "$asyncapi.json", + Language.findLanguageByID("JSON")!!, + asyncAPISpecification + ) as JsonFile + + TestCase.assertEquals(listOf("#/components", "#/components/messages"), collectVariants("#/co", asyncAPIPSI)) + TestCase.assertEquals(listOf("#/components", "#/components/messages"), collectVariants("#/comp", asyncAPIPSI)) + TestCase.assertEquals(listOf("#/components", "#/components/messages"), collectVariants("#/components", asyncAPIPSI)) + TestCase.assertEquals( + listOf( + "#/components/messages", + "#/components/messages/UserSignedUp", + ), + collectVariants("#/components/m", asyncAPIPSI) + ) + TestCase.assertEquals( + listOf( + "#/components/messages/UserSignedUp", + "#/components/messages/UserSignedUp/payload", + ), + collectVariants("#/components/messages/u", asyncAPIPSI) + ) + + TestCase.assertEquals( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + "#/operations", + "#/operations/processUserSignups", + "#/asyncapi" + ), + collectVariants("#/i", asyncAPIPSI) + ) + TestCase.assertEquals( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + ), + collectVariants("#/in", asyncAPIPSI) + ) + TestCase.assertEquals( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + ), + collectVariants("#/inf", asyncAPIPSI) + ) + + TestCase.assertEquals( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + "#/channels", + "#/channels/userSignedup", + "#/operations", + "#/operations/processUserSignups", + "#/components", + "#/components/messages", + "#/asyncapi", + ), + collectVariants("#/", asyncAPIPSI) + ) + + TestCase.assertTrue("In case of wrong property name variants must be empty", collectVariants("#/qwerty", asyncAPIPSI).isEmpty()) + TestCase.assertTrue("In case of wrong property name variants must be empty", collectVariants("#/123", asyncAPIPSI).isEmpty()) + TestCase.assertTrue("In case of wrong property name variants must be empty", collectVariants("#/$%^^", asyncAPIPSI).isEmpty()) + } + + private fun collectVariants(xpath: String, specification: JsonFile): List { + val psiPath = JsonFileXPath.compileXPath(xpath) + val foundPsiElements = JsonFileXPath.findPsi(specification, psiPath, true) + + return JsonFileVariantsProvider( + foundPsiElements.filterIsInstance(), + specification.name, + psiPath + ).variants().map { it.lookupString } + } + +} \ No newline at end of file From de0714e6e3aeeeb8aac05363db2fca9690de7131 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 03:18:54 +0400 Subject: [PATCH 48/57] test: AsyncAPI v3 yaml completion - variants provider test --- .../v3/YamlFileVariantsProviderTest.kt | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/YamlFileVariantsProviderTest.kt diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/YamlFileVariantsProviderTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/YamlFileVariantsProviderTest.kt new file mode 100644 index 0000000..f493b80 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/YamlFileVariantsProviderTest.kt @@ -0,0 +1,126 @@ +package com.asyncapi.plugin.idea.psi.reference.v3 + +import com.asyncapi.plugin.idea._core.xpath.JsonFileXPath +import com.asyncapi.plugin.idea._core.xpath.YamlFileXPath +import com.asyncapi.plugin.idea.extensions.psi.reference.YamlFileVariantsProvider +import com.intellij.psi.PsiFileFactory +import com.intellij.testFramework.fixtures.BasePlatformTestCase +import junit.framework.TestCase +import org.jetbrains.yaml.YAMLLanguage +import org.jetbrains.yaml.psi.YAMLFile +import org.jetbrains.yaml.psi.YAMLPsiElement + +/* + LightPlatformCodeInsightTestCase + LightCompletionTestCase + CodeInsightFixtureTestCase + */ + +/** + * @author Pavel Bodiachevskii + */ +//class JsonSchemaReferenceCompletionTest: LightJavaCodeInsightFixtureTestCase() { +//class JsonSchemaReferenceCompletionTest: CompletionAutoPopupTestCase() { +//class JsonSchemaReferenceCompletionTest: BasePlatformTestCase() { +class YamlFileVariantsProviderTest: BasePlatformTestCase() { + + override fun getTestDataPath(): String { + return "src/test/testData" + } + + fun `test completion - 3_0_0`() { + testCompletion("asyncapi-3.0.0") + } + + fun testCompletion(asyncapi: String) { + val psiFileFactory = PsiFileFactory.getInstance(project) + val asyncAPISpecification = this.javaClass.getResource("/$asyncapi.yaml").readText() + val asyncAPIPSI = psiFileFactory.createFileFromText( + "$asyncapi.yaml", + YAMLLanguage.INSTANCE, + asyncAPISpecification + ) as YAMLFile + + TestCase.assertEquals(listOf("#/components", "#/components/messages"), collectVariants("#/co", asyncAPIPSI)) + TestCase.assertEquals(listOf("#/components", "#/components/messages"), collectVariants("#/comp", asyncAPIPSI)) + TestCase.assertEquals(listOf("#/components", "#/components/messages"), collectVariants("#/components", asyncAPIPSI)) + TestCase.assertEquals( + listOf( + "#/components/messages", + "#/components/messages/UserSignedUp", + ), + collectVariants("#/components/m", asyncAPIPSI) + ) + TestCase.assertEquals( + listOf( + "#/components/messages/UserSignedUp", + "#/components/messages/UserSignedUp/payload", + ), + collectVariants("#/components/messages/u", asyncAPIPSI) + ) + + TestCase.assertEquals( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + "#/operations", + "#/operations/processUserSignups", + "#/asyncapi" + ), + collectVariants("#/i", asyncAPIPSI) + ) + TestCase.assertEquals( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + ), + collectVariants("#/in", asyncAPIPSI) + ) + TestCase.assertEquals( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + ), + collectVariants("#/inf", asyncAPIPSI) + ) + + TestCase.assertEquals( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + "#/channels", + "#/channels/userSignedup", + "#/operations", + "#/operations/processUserSignups", + "#/components", + "#/components/messages", + "#/asyncapi", + ), + collectVariants("#/", asyncAPIPSI) + ) + + TestCase.assertTrue("In case of wrong property name variants must be empty", collectVariants("#/qwerty", asyncAPIPSI).isEmpty()) + TestCase.assertTrue("In case of wrong property name variants must be empty", collectVariants("#/123", asyncAPIPSI).isEmpty()) + TestCase.assertTrue("In case of wrong property name variants must be empty", collectVariants("#/$%^^", asyncAPIPSI).isEmpty()) + } + + private fun collectVariants(xpath: String, specification: YAMLFile): List { + val psiPath = JsonFileXPath.compileXPath(xpath) + val foundPsiElements = YamlFileXPath.findPsi(specification, psiPath, true) + + return YamlFileVariantsProvider( + foundPsiElements.filterIsInstance(), + specification.name, + psiPath + ).variants().map { it.lookupString } + } + +} \ No newline at end of file From 4b345ef2791bd2c8c1091594c2ff93a38fcdc87a Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 03:40:19 +0400 Subject: [PATCH 49/57] test: AsyncAPI v3 json completion - reference variants provider test --- .../v3/_0_0/JsonReferenceVariantsTest.kt | 164 ++++++++++++++++++ .../json/reference/completion/3.0.0/$^^.json | 46 +++++ .../json/reference/completion/3.0.0/123.json | 46 +++++ .../json/reference/completion/3.0.0/_.json | 46 +++++ .../json/reference/completion/3.0.0/co.json | 46 +++++ .../json/reference/completion/3.0.0/comp.json | 46 +++++ .../completion/3.0.0/components.json | 46 +++++ .../completion/3.0.0/components_m.json | 46 +++++ .../3.0.0/components_messages_u.json | 46 +++++ .../json/reference/completion/3.0.0/i.json | 46 +++++ .../json/reference/completion/3.0.0/in.json | 46 +++++ .../json/reference/completion/3.0.0/inf.json | 46 +++++ .../reference/completion/3.0.0/qwerty.json | 46 +++++ .../json/reference/completion/3.0.0/ref.json | 3 + .../reference/completion/3.0.0/reference.json | 46 +++++ 15 files changed, 765 insertions(+) create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/_0_0/JsonReferenceVariantsTest.kt create mode 100644 src/test/testData/json/reference/completion/3.0.0/$^^.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/123.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/_.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/co.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/comp.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/components.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/components_m.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/components_messages_u.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/i.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/in.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/inf.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/qwerty.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/ref.json create mode 100644 src/test/testData/json/reference/completion/3.0.0/reference.json diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/_0_0/JsonReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/_0_0/JsonReferenceVariantsTest.kt new file mode 100644 index 0000000..bd3df4c --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/_0_0/JsonReferenceVariantsTest.kt @@ -0,0 +1,164 @@ +package com.asyncapi.plugin.idea.psi.reference.v3._0_0 + +import com.intellij.codeInsight.completion.CompletionType +import com.intellij.testFramework.fixtures.BasePlatformTestCase + +/** + * @author Pavel Bodiachevskii + */ +class JsonReferenceVariantsTest: BasePlatformTestCase() { + + override fun getTestDataPath(): String = "src/test/testData/json/reference/completion/3.0.0" + + fun `test co`() { + myFixture.configureByFile("co.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue(listOf("#/components", "#/components/messages").containsAll(variants)) + } + + fun `test comp`() { + myFixture.configureByFile("comp.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue(listOf("#/components", "#/components/messages").containsAll(variants)) + } + + fun `test components`() { + myFixture.configureByFile("components.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue(listOf("#/components", "#/components/messages").containsAll(variants)) + } + + fun `test components_m`() { + myFixture.configureByFile("components_m.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/components/messages", + "#/components/messages/UserSignedUp", + "#/components/messages/UserSignedOut" + ).containsAll(variants) + ) + } + + fun `test components_messages_u`() { + myFixture.configureByFile("components_messages_u.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/components/messages/UserSignedUp", + "#/components/messages/UserSignedUp/payload", + ).containsAll(variants) + ) + } + + fun `test i`() { + myFixture.configureByFile("i.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + "#/asyncapi" + ).containsAll(variants) + ) + } + + fun `test in`() { + myFixture.configureByFile("in.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description" + ).containsAll(variants) + ) + } + + fun `test inf`() { + myFixture.configureByFile("inf.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description" + ).containsAll(variants) + ) + } + + fun `test `() { + myFixture.configureByFile("_.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + "#/channels", + "#/channels/userSignedup", + "#/operations", + "#/operations/processUserSignups", + "#/components", + "#/components/messages", + "#/asyncapi", + ).containsAll(variants) + ) + } + + fun `test qwerty`() { + myFixture.configureByFile("qwerty.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue("In case of wrong property name variants must be empty", variants.isEmpty()) + } + + fun `test 123`() { + myFixture.configureByFile("123.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue("In case of wrong property name variants must be empty", variants.isEmpty()) + } + + fun `test $^^`() { + myFixture.configureByFile("\$^^.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue("In case of wrong property name variants must be empty", variants.isEmpty()) + } + + fun `test referenced file`() { + myFixture.configureByFiles("reference.json", "ref.json") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertEquals(listOf("./ref.json#/reference"), variants) + } + +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/$^^.json b/src/test/testData/json/reference/completion/3.0.0/$^^.json new file mode 100644 index 0000000..f184351 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/$^^.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/$^^" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/123.json b/src/test/testData/json/reference/completion/3.0.0/123.json new file mode 100644 index 0000000..b2f10a4 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/123.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/123" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/_.json b/src/test/testData/json/reference/completion/3.0.0/_.json new file mode 100644 index 0000000..a78dde7 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/_.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/co.json b/src/test/testData/json/reference/completion/3.0.0/co.json new file mode 100644 index 0000000..56013e5 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/co.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/co" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/comp.json b/src/test/testData/json/reference/completion/3.0.0/comp.json new file mode 100644 index 0000000..a4191e8 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/comp.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/comp" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/components.json b/src/test/testData/json/reference/completion/3.0.0/components.json new file mode 100644 index 0000000..73c4cda --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/components.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/components_m.json b/src/test/testData/json/reference/completion/3.0.0/components_m.json new file mode 100644 index 0000000..1cfc594 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/components_m.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/m" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/components_messages_u.json b/src/test/testData/json/reference/completion/3.0.0/components_messages_u.json new file mode 100644 index 0000000..75934c2 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/components_messages_u.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/components/messages/u" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/i.json b/src/test/testData/json/reference/completion/3.0.0/i.json new file mode 100644 index 0000000..fa63545 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/i.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/i" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/in.json b/src/test/testData/json/reference/completion/3.0.0/in.json new file mode 100644 index 0000000..93eb1a4 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/in.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/in" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/inf.json b/src/test/testData/json/reference/completion/3.0.0/inf.json new file mode 100644 index 0000000..fa6cb83 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/inf.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/inf" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/qwerty.json b/src/test/testData/json/reference/completion/3.0.0/qwerty.json new file mode 100644 index 0000000..ff0dad8 --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/qwerty.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "#/qwerty" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/ref.json b/src/test/testData/json/reference/completion/3.0.0/ref.json new file mode 100644 index 0000000..e34190b --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/ref.json @@ -0,0 +1,3 @@ +{ + "reference": "reference value" +} \ No newline at end of file diff --git a/src/test/testData/json/reference/completion/3.0.0/reference.json b/src/test/testData/json/reference/completion/3.0.0/reference.json new file mode 100644 index 0000000..20029dd --- /dev/null +++ b/src/test/testData/json/reference/completion/3.0.0/reference.json @@ -0,0 +1,46 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Account Service", + "version": "1.0.0", + "description": "This service is in charge of processing user signups :rocket:" + }, + "channels": { + "userSignedup": { + "address": "user/signedup", + "messages": { + "userSignedupMessage": { + "$ref": "./ref.json#/r" + } + } + } + }, + "operations": { + "processUserSignups": { + "action": "receive", + "channel": { + "$ref": "#/channels/userSignedup" + } + } + }, + "components": { + "messages": { + "UserSignedUp": { + "payload": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "Email of the user" + } + } + } + } + } + } +} \ No newline at end of file From a0e00d6f713402679861894b0868c3145f114705 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 03:48:56 +0400 Subject: [PATCH 50/57] test: AsyncAPI v3 yaml completion - reference variants provider test --- .../v3/_0_0/YamlReferenceVariantsTest.kt | 163 ++++++++++++++++++ .../yaml/reference/completion/3.0.0/$^^.yaml | 30 ++++ .../yaml/reference/completion/3.0.0/123.yaml | 30 ++++ .../yaml/reference/completion/3.0.0/_.yaml | 30 ++++ .../yaml/reference/completion/3.0.0/co.yaml | 30 ++++ .../yaml/reference/completion/3.0.0/comp.yaml | 30 ++++ .../completion/3.0.0/components.yaml | 30 ++++ .../completion/3.0.0/components_m.yaml | 30 ++++ .../3.0.0/components_messages_u.yaml | 30 ++++ .../yaml/reference/completion/3.0.0/i.yaml | 30 ++++ .../yaml/reference/completion/3.0.0/in.yaml | 30 ++++ .../yaml/reference/completion/3.0.0/inf.yaml | 30 ++++ .../reference/completion/3.0.0/qwerty.yaml | 30 ++++ .../yaml/reference/completion/3.0.0/ref.yaml | 2 + .../reference/completion/3.0.0/reference.yaml | 30 ++++ 15 files changed, 555 insertions(+) create mode 100644 src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/_0_0/YamlReferenceVariantsTest.kt create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/$^^.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/123.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/_.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/co.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/comp.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/components.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/components_m.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/components_messages_u.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/i.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/in.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/inf.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/qwerty.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/ref.yaml create mode 100644 src/test/testData/yaml/reference/completion/3.0.0/reference.yaml diff --git a/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/_0_0/YamlReferenceVariantsTest.kt b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/_0_0/YamlReferenceVariantsTest.kt new file mode 100644 index 0000000..d1f72e5 --- /dev/null +++ b/src/test/kotlin/com/asyncapi/plugin/idea/psi/reference/v3/_0_0/YamlReferenceVariantsTest.kt @@ -0,0 +1,163 @@ +package com.asyncapi.plugin.idea.psi.reference.v3._0_0 + +import com.intellij.codeInsight.completion.CompletionType +import com.intellij.testFramework.fixtures.BasePlatformTestCase + +/** + * @author Pavel Bodiachevskii + */ +class YamlReferenceVariantsTest: BasePlatformTestCase() { + + override fun getTestDataPath(): String = "src/test/testData/yaml/reference/completion/3.0.0" + + fun `test co`() { + myFixture.configureByFile("co.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue(listOf("#/components", "#/components/messages").containsAll(variants)) + } + + fun `test comp`() { + myFixture.configureByFile("comp.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue(listOf("#/components", "#/components/messages").containsAll(variants)) + } + + fun `test components`() { + myFixture.configureByFile("components.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue(listOf("#/components", "#/components/messages").containsAll(variants)) + } + + fun `test components_m`() { + myFixture.configureByFile("components_m.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/components/messages", + "#/components/messages/UserSignedUp", + ).containsAll(variants) + ) + } + + fun `test components_messages_u`() { + myFixture.configureByFile("components_messages_u.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/components/messages/UserSignedUp", + "#/components/messages/UserSignedUp/payload", + ).containsAll(variants) + ) + } + + fun `test i`() { + myFixture.configureByFile("i.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + "#/asyncapi" + ).containsAll(variants) + ) + } + + fun `test in`() { + myFixture.configureByFile("in.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description" + ).containsAll(variants) + ) + } + + fun `test inf`() { + myFixture.configureByFile("inf.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description" + ).containsAll(variants) + ) + } + + fun `test `() { + myFixture.configureByFile("_.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue( + listOf( + "#/info", + "#/info/title", + "#/info/version", + "#/info/description", + "#/channels", + "#/channels/userSignedup", + "#/operations", + "#/operations/processUserSignups", + "#/components", + "#/components/messages", + "#/asyncapi", + ).containsAll(variants) + ) + } + + fun `test qwerty`() { + myFixture.configureByFile("qwerty.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue("In case of wrong property name variants must be empty", variants.isEmpty()) + } + + fun `test 123`() { + myFixture.configureByFile("123.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue("In case of wrong property name variants must be empty", variants.isEmpty()) + } + + fun `test $^^`() { + myFixture.configureByFile("\$^^.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertTrue("In case of wrong property name variants must be empty", variants.isEmpty()) + } + + fun `test referenced file`() { + myFixture.configureByFiles("reference.yaml", "ref.yaml") + myFixture.complete(CompletionType.BASIC, 1) + val variants = myFixture.lookupElementStrings ?: emptyList() + + assertEquals(listOf("./ref.yaml#/reference"), variants) + } + +} \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/$^^.yaml b/src/test/testData/yaml/reference/completion/3.0.0/$^^.yaml new file mode 100644 index 0000000..cf3e1fc --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/$^^.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/components/$^^" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/123.yaml b/src/test/testData/yaml/reference/completion/3.0.0/123.yaml new file mode 100644 index 0000000..bc42808 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/123.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/123" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/_.yaml b/src/test/testData/yaml/reference/completion/3.0.0/_.yaml new file mode 100644 index 0000000..12c2b87 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/_.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/co.yaml b/src/test/testData/yaml/reference/completion/3.0.0/co.yaml new file mode 100644 index 0000000..75dff49 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/co.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/co" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/comp.yaml b/src/test/testData/yaml/reference/completion/3.0.0/comp.yaml new file mode 100644 index 0000000..53801c0 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/comp.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/comp" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/components.yaml b/src/test/testData/yaml/reference/completion/3.0.0/components.yaml new file mode 100644 index 0000000..8629ba6 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/components.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/components" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/components_m.yaml b/src/test/testData/yaml/reference/completion/3.0.0/components_m.yaml new file mode 100644 index 0000000..e71ef25 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/components_m.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/components/m" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/components_messages_u.yaml b/src/test/testData/yaml/reference/completion/3.0.0/components_messages_u.yaml new file mode 100644 index 0000000..3335fdf --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/components_messages_u.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/components/messages/u" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/i.yaml b/src/test/testData/yaml/reference/completion/3.0.0/i.yaml new file mode 100644 index 0000000..8878ef3 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/i.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/i" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/in.yaml b/src/test/testData/yaml/reference/completion/3.0.0/in.yaml new file mode 100644 index 0000000..78b3f80 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/in.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/in" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/inf.yaml b/src/test/testData/yaml/reference/completion/3.0.0/inf.yaml new file mode 100644 index 0000000..321cee4 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/inf.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/inf" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/qwerty.yaml b/src/test/testData/yaml/reference/completion/3.0.0/qwerty.yaml new file mode 100644 index 0000000..6735f9f --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/qwerty.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "#/qwerty" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file diff --git a/src/test/testData/yaml/reference/completion/3.0.0/ref.yaml b/src/test/testData/yaml/reference/completion/3.0.0/ref.yaml new file mode 100644 index 0000000..cfb3610 --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/ref.yaml @@ -0,0 +1,2 @@ +--- +reference: reference value diff --git a/src/test/testData/yaml/reference/completion/3.0.0/reference.yaml b/src/test/testData/yaml/reference/completion/3.0.0/reference.yaml new file mode 100644 index 0000000..0c9257e --- /dev/null +++ b/src/test/testData/yaml/reference/completion/3.0.0/reference.yaml @@ -0,0 +1,30 @@ +--- +asyncapi: 3.0.0 +info: + title: Account Service + version: 1.0.0 + description: "This service is in charge of processing user signups :rocket:" +channels: + userSignedup: + address: "user/signedup" + messages: + userSignedupMessage: + $ref: "./ref.yaml#/r" +operations: + processUserSignups: + action: "receive" + channel: + $ref: "#/channels/userSignedup" +components: + messages: + UserSignedUp: + payload: + type: object + properties: + displayName: + type: string + description: Name of the user + email: + type: string + format: email + description: Email of the user \ No newline at end of file From 098ffa1dea8636bdf0af1c614e94c91b4d2bfe48 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Tue, 12 Dec 2023 03:57:55 +0400 Subject: [PATCH 51/57] feat: AsyncAPISpecificationDetector detect v3 and v2 --- .../AsyncAPISpecificationDetector.kt | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt index 1d02298..eae6e5f 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/inspection/AsyncAPISpecificationDetector.kt @@ -1,6 +1,7 @@ package com.asyncapi.plugin.idea.extensions.inspection -import com.asyncapi.plugin.idea.extensions.index.v2.AsyncAPISpecificationIndex +import com.asyncapi.plugin.idea.extensions.index.v2.AsyncAPISpecificationIndex as AsyncAPISpecificationIndexV2 +import com.asyncapi.plugin.idea.extensions.index.v3.AsyncAPISpecificationIndex as AsyncAPISpecificationIndexV3 import com.intellij.json.psi.JsonFile import com.intellij.psi.PsiFile import com.intellij.psi.search.GlobalSearchScope @@ -18,7 +19,8 @@ class AsyncAPISpecificationDetector { return false } - return indexedAsyncAPISpecifications(psiFile).contains(psiFile.virtualFile?.path) + return v2IndexedAsyncAPISpecifications(psiFile).contains(psiFile.virtualFile?.path) + || v3IndexedAsyncAPISpecifications(psiFile).contains(psiFile.virtualFile?.path) } fun isAsyncAPIYamlSpecification(psiFile: PsiFile?): Boolean { @@ -27,7 +29,8 @@ class AsyncAPISpecificationDetector { return false } - return indexedAsyncAPISpecifications(psiFile).contains(psiFile.virtualFile?.path) + return v2IndexedAsyncAPISpecifications(psiFile).contains(psiFile.virtualFile?.path) + || v3IndexedAsyncAPISpecifications(psiFile).contains(psiFile.virtualFile?.path) } fun isAsyncAPISpecification(psiFile: PsiFile?): Boolean { @@ -45,7 +48,8 @@ class AsyncAPISpecificationDetector { return false } - return indexedAsyncAPISpecificationReferences(psiFile).contains(psiFile.virtualFile?.path) + return v2IndexedAsyncAPISpecificationReferences(psiFile).contains(psiFile.virtualFile?.path) + || v3IndexedAsyncAPISpecificationReferences(psiFile).contains(psiFile.virtualFile?.path) } private fun isAsyncAPISpecificationYamlComponent(psiFile: PsiFile?): Boolean { @@ -54,7 +58,8 @@ class AsyncAPISpecificationDetector { return false } - return indexedAsyncAPISpecificationReferences(psiFile).contains(psiFile.virtualFile?.path) + return v2IndexedAsyncAPISpecificationReferences(psiFile).contains(psiFile.virtualFile?.path) + || v3IndexedAsyncAPISpecificationReferences(psiFile).contains(psiFile.virtualFile?.path) } fun isAsyncAPISpecificationComponent(psiFile: PsiFile?): Boolean { @@ -66,20 +71,36 @@ class AsyncAPISpecificationDetector { } } - private fun indexedAsyncAPISpecifications(asyncapiSpecification: PsiFile): List { + private fun v2IndexedAsyncAPISpecifications(asyncapiSpecification: PsiFile): List { return FileBasedIndex.getInstance().getValues( - AsyncAPISpecificationIndex.asyncapiIndexId, - AsyncAPISpecificationIndex.asyncapi, + AsyncAPISpecificationIndexV2.asyncapiIndexId, + AsyncAPISpecificationIndexV2.asyncapi, GlobalSearchScope.allScope(asyncapiSpecification.project) ).flatten() } - private fun indexedAsyncAPISpecificationReferences(asyncapiSpecification: PsiFile): List { + private fun v3IndexedAsyncAPISpecifications(asyncapiSpecification: PsiFile): List { return FileBasedIndex.getInstance().getValues( - AsyncAPISpecificationIndex.asyncapiIndexId, - AsyncAPISpecificationIndex.references, + AsyncAPISpecificationIndexV3.asyncapiIndexId, + AsyncAPISpecificationIndexV3.asyncapi, + GlobalSearchScope.allScope(asyncapiSpecification.project) + ).flatten() + } + + private fun v2IndexedAsyncAPISpecificationReferences(asyncapiSpecification: PsiFile): List { + return FileBasedIndex.getInstance().getValues( + AsyncAPISpecificationIndexV2.asyncapiIndexId, + AsyncAPISpecificationIndexV2.references, GlobalSearchScope.allScope(asyncapiSpecification.project) ).flatten() } + private fun v3IndexedAsyncAPISpecificationReferences(asyncapiSpecification: PsiFile): List { + return FileBasedIndex.getInstance().getValues( + AsyncAPISpecificationIndexV3.asyncapiIndexId, + AsyncAPISpecificationIndexV3.references, + GlobalSearchScope.allScope(asyncapiSpecification.project) + ).flatten() + } + } \ No newline at end of file From 8da26ae318573613b6f373b83d58e1ebe527e88c Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Thu, 14 Dec 2023 01:29:36 +0400 Subject: [PATCH 52/57] feat: v3 collect referenced components --- .../plugin/idea/_core/xpath/PsiFileXPath.kt | 2 +- .../index/v3/AsyncAPISpecificationIndex.kt | 63 +++++++++++ ...syncAPISpecificationReferencesCollector.kt | 106 +++++++++++++++++- 3 files changed, 169 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt index 4522984..b711988 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/xpath/PsiFileXPath.kt @@ -5,7 +5,7 @@ import com.intellij.psi.PsiFile /** * Dummy implementation of XPath for [PsiFile]. - * + * // TODO: Support collections * @author Pavel Bodiachevskii */ abstract class PsiFileXPath { diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt index 57447e0..edd0b1c 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationIndex.kt @@ -59,6 +59,69 @@ class AsyncAPISpecificationIndex: FileBasedIndexExtension>() @JvmStatic val references = "references" + @JvmStatic + val tags = "tags" + + @JvmStatic + val externalDocs = "externalDocs" + + @JvmStatic + val servers = "servers" + + @JvmStatic + val serverVariables = "serverVariables" + + @JvmStatic + val serverBindings = "serverBindings" + + @JvmStatic + val channels = "channels" + + @JvmStatic + val channelParameters = "channelParameters" + + @JvmStatic + val channelBindings = "channelBindings" + + @JvmStatic + val operations = "operations" + + @JvmStatic + val operationBindings = "operationBindings" + + @JvmStatic + val operationTraits = "operationTraits" + + @JvmStatic + val operationReplies = "operationReplies" + + @JvmStatic + val operationReplyAddresses = "operationReplyAddresses" + + @JvmStatic + val messages = "messages" + + @JvmStatic + val messageHeaders = "messageHeaders" + + @JvmStatic + val messagePayloads = "messagePayloads" + + @JvmStatic + val messageCorrelationIds = "messageCorrelationIds" + + @JvmStatic + val messageBindings = "messageBindings" + + @JvmStatic + val messageTraits = "messageTraits" + + @JvmStatic + val schemas = "schemas" + + @JvmStatic + val securitySchemes = "securitySchemes" + } } \ No newline at end of file diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationReferencesCollector.kt b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationReferencesCollector.kt index add5c2c..32d593d 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationReferencesCollector.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/extensions/index/v3/AsyncAPISpecificationReferencesCollector.kt @@ -13,7 +13,111 @@ class AsyncAPISpecificationReferencesCollector( ): AbstractAsyncAPISpecificationReferencesCollector(asyncAPISpecification, asyncAPISpecificationDir) { override fun possibleReferencesLocation(): Map> { - return emptyMap() + return mapOf( + AsyncAPISpecificationIndex.tags to setOf( + "\$.info.tags.*.\$ref", + "\$.servers.*.tags.*.\$ref", + "\$.channels.*.tags.*.\$ref", + "\$.operations.*.tags.*.\$ref", + "\$.channels.*.messages.*.tags.*.\$ref", + "\$.operations.*.messages.*.tags.*.\$ref", + "\$.components.tags.*.\$ref", + ), + AsyncAPISpecificationIndex.externalDocs to setOf( + "\$.info.externalDocs.\$ref", + "\$.servers.*.externalDocs.\$ref", + "\$.channels.*.externalDocs.\$ref", + "\$.operations.*.externalDocs.\$ref", + "\$.channels.*.messages.*.externalDocs.\$ref", + "\$.operations.*.messages.*.externalDocs.\$ref", + "\$.components.externalDocs.*.\$ref", + ), + AsyncAPISpecificationIndex.servers to setOf( + "\$.servers.*.\$ref", + "\$.channels.*.servers.*.\$ref", + "\$.components.servers.*.\$ref", + ), + AsyncAPISpecificationIndex.serverVariables to setOf( + "\$.servers.*.variables.*.\$ref", + "\$.components.serverVariables.*.\$ref", + ), + AsyncAPISpecificationIndex.serverBindings to setOf( + "\$.servers.*.bindings.*.\$ref", + "\$.components.serverBindings.*.\$ref", + ), + AsyncAPISpecificationIndex.channels to setOf( + "\$.channels.*.\$ref", + "\$.operations.*.channel.\$ref", + "\$.operations.*.reply.*.channel.\$ref", + "\$.components.replies.*.channel.\$ref", + "\$.components.channels.*.\$ref", + ), + AsyncAPISpecificationIndex.channelParameters to setOf( + "\$.channels.*.parameters.*.\$ref", + "\$.components.parameters.*.\$ref", + ), + AsyncAPISpecificationIndex.channelBindings to setOf( + "\$.channels.*.bindings.*.\$ref", + "\$.components.channelBindings.*.\$ref", + ), + AsyncAPISpecificationIndex.operations to setOf( + "\$.operations.*.\$ref", + "\$.components.operations.*.\$ref", + ), + AsyncAPISpecificationIndex.operationBindings to setOf( + "\$.operations.*.bindings.*.\$ref", + "\$.components.operationBindings.*.\$ref", + ), + AsyncAPISpecificationIndex.operationTraits to setOf( + "\$.operations.*.traits.*.\$ref", + "\$.components.operationTraits.*.\$ref", + ), + AsyncAPISpecificationIndex.operationReplies to setOf( + "\$.operations.*.reply.*.\$ref", + "\$.components.replies.*.\$ref", + ),AsyncAPISpecificationIndex.operationReplyAddresses to setOf( + "\$.operations.*.reply.*.address.\$ref", + "\$.components.replies.*.address.\$ref", + ), + AsyncAPISpecificationIndex.messages to setOf( + "\$.channels.*.messages.*.\$ref", + "\$.operations.*.messages.*.\$ref", + "\$.operations.*.reply.*.messages.*.\$ref", + "\$.components.replies.*.messages.*.\$ref", + "\$.components.messages.*.\$ref", + ), + AsyncAPISpecificationIndex.messageHeaders to setOf( + "\$.channels.*.messages.*.headers.\$ref", + "\$.operations.*.messages.*.headers.\$ref", + ), + AsyncAPISpecificationIndex.messagePayloads to setOf( + "\$.channels.*.messages.*.payload.\$ref", + "\$.operations.*.messages.*.payload.\$ref", + ), + AsyncAPISpecificationIndex.messageCorrelationIds to setOf( + "\$.channels.*.messages.*.correlationId.\$ref", + "\$.operations.*.messages.*.correlationId.\$ref", + "\$.components.correlationIds.*.\$ref", + ), + AsyncAPISpecificationIndex.messageBindings to setOf( + "\$.channels.*.messages.*.bindings.*.\$ref", + "\$.operations.*.messages.*.bindings.*.\$ref", + "\$.components.messageBindings.*.\$ref", + ), + AsyncAPISpecificationIndex.messageTraits to setOf( + "\$.channels.*.messages.*.traits.*.\$ref", + "\$.operations.*.messages.*.traits.*.\$ref", + "\$.components.messageTraits.*.\$ref", + ), + AsyncAPISpecificationIndex.securitySchemes to setOf( + "\$.servers.*.security.*.\$ref", + "\$.operations.*.security.*.\$ref", + "\$.components.securitySchemes.*.\$ref", + ), + AsyncAPISpecificationIndex.schemas to setOf( + "\$.components.schemas.*.\$ref", + ), + ) } } \ No newline at end of file From 07d669ecef391dae26fe5cb3ba326eb0e5de2be6 Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Fri, 15 Dec 2023 03:32:16 +0400 Subject: [PATCH 53/57] feat: preview v3 --- .../AsyncAPISpecificationHtmlRenderer.kt | 4 +- .../ui/default(1.0.0-next.48).min.css | 5 -- src/main/resources/ui/default(1.2.6).min.css | 5 ++ src/main/resources/ui/index(1.0.0-next.48).js | 51 ------------------- src/main/resources/ui/index(1.2.6).js | 32 ++++++++++++ 5 files changed, 39 insertions(+), 58 deletions(-) delete mode 100644 src/main/resources/ui/default(1.0.0-next.48).min.css create mode 100644 src/main/resources/ui/default(1.2.6).min.css delete mode 100644 src/main/resources/ui/index(1.0.0-next.48).js create mode 100644 src/main/resources/ui/index(1.2.6).js diff --git a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt index 5377758..4f7468b 100644 --- a/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt +++ b/src/main/kotlin/com/asyncapi/plugin/idea/_core/AsyncAPISpecificationHtmlRenderer.kt @@ -28,8 +28,8 @@ class AsyncAPISpecificationHtmlRenderer { private val urlProvider = service() private val specificationTemplateUrl = "/ui/index.html" - private val specificationTemplateCssUrl = "default(1.0.0-next.48).min.css" - private val specificationTemplateJsUrl = "index(1.0.0-next.48).js" + private val specificationTemplateCssUrl = "default(1.2.6).min.css" + private val specificationTemplateJsUrl = "index(1.2.6).js" fun render(request: FullHttpRequest, specificationUrl: String?): String { specificationUrl ?: return "specification: not found." diff --git a/src/main/resources/ui/default(1.0.0-next.48).min.css b/src/main/resources/ui/default(1.0.0-next.48).min.css deleted file mode 100644 index 156b75e..0000000 --- a/src/main/resources/ui/default(1.0.0-next.48).min.css +++ /dev/null @@ -1,5 +0,0 @@ -.aui-root .hljs{display:block;overflow-x:auto;padding:.5em;background:#011627;color:#d6deeb}.aui-root .hljs-keyword{color:#c792ea;font-style:italic}.aui-root .hljs-built_in{color:#addb67;font-style:italic}.aui-root .hljs-type{color:#82aaff}.aui-root .hljs-literal{color:#ff5874}.aui-root .hljs-number{color:#f78c6c}.aui-root .hljs-regexp{color:#5ca7e4}.aui-root .hljs-string{color:#ecc48d}.aui-root .hljs-subst{color:#d3423e}.aui-root .hljs-symbol{color:#82aaff}.aui-root .hljs-class{color:#ffcb8b}.aui-root .hljs-function{color:#82aaff}.aui-root .hljs-title{color:#dcdcaa;font-style:italic}.aui-root .hljs-params{color:#7fdbca}.aui-root .hljs-comment{color:#637777;font-style:italic}.aui-root .hljs-doctag{color:#7fdbca}.aui-root .hljs-meta,.aui-root .hljs-meta-keyword{color:#82aaff}.aui-root .hljs-meta-string{color:#ecc48d}.aui-root .hljs-section{color:#82b1ff}.aui-root .hljs-attr,.aui-root .hljs-builtin-name,.aui-root .hljs-name,.aui-root .hljs-tag{color:#7fdbca}.aui-root .hljs-attribute{color:#80cbc4}.aui-root .hljs-variable{color:#addb67}.aui-root .hljs-bullet{color:#d9f5dd}.aui-root .hljs-code{color:#80cbc4}.aui-root .hljs-emphasis{color:#c792ea;font-style:italic}.aui-root .hljs-strong{color:#addb67;font-weight:700}.aui-root .hljs-formula{color:#c792ea}.aui-root .hljs-link{color:#ff869a}.aui-root .hljs-quote{color:#697098;font-style:italic}.aui-root .hljs-selector-tag{color:#ff6363}.aui-root .hljs-selector-id{color:#fad430}.aui-root .hljs-selector-class{color:#addb67;font-style:italic}.aui-root .hljs-selector-attr,.aui-root .hljs-selector-pseudo{color:#c792ea;font-style:italic}.aui-root .hljs-template-tag{color:#c792ea}.aui-root .hljs-template-variable{color:#addb67}.aui-root .hljs-addition{color:#addb67;font-style:italic}.aui-root .hljs-deletion{color:rgba(239,83,80,.5647058823529412);font-style:italic} - -/*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com*/ - -/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */.aui-root html{-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.15;-webkit-text-size-adjust:100%}.aui-root body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji}.aui-root hr{height:0;color:inherit}.aui-root abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.aui-root b,.aui-root strong{font-weight:bolder}.aui-root code,.aui-root kbd,.aui-root pre,.aui-root samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}.aui-root small{font-size:80%}.aui-root sub,.aui-root sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.aui-root sub{bottom:-.25em}.aui-root sup{top:-.5em}.aui-root table{text-indent:0;border-color:inherit}.aui-root button,.aui-root input,.aui-root optgroup,.aui-root select,.aui-root textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}.aui-root button,.aui-root select{text-transform:none}.aui-root [type=button],.aui-root button{-webkit-appearance:button}.aui-root legend{padding:0}.aui-root progress{vertical-align:baseline}.aui-root summary{display:list-item}.aui-root blockquote,.aui-root dd,.aui-root dl,.aui-root figure,.aui-root h1,.aui-root h2,.aui-root h3,.aui-root h4,.aui-root h5,.aui-root h6,.aui-root hr,.aui-root p,.aui-root pre{margin:0}.aui-root button{background-color:transparent;background-image:none}.aui-root fieldset{margin:0;padding:0}.aui-root ol,.aui-root ul{list-style:none;margin:0;padding:0}.aui-root html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}.aui-root body{font-family:inherit;line-height:inherit}.aui-root *,.aui-root :after,.aui-root :before{box-sizing:border-box;border:0 solid}.aui-root hr{border-top-width:1px}.aui-root img{border-style:solid}.aui-root textarea{resize:vertical}.aui-root input::-moz-placeholder, .aui-root textarea::-moz-placeholder{opacity:1;color:#cbd5e0}.aui-root input:-ms-input-placeholder, .aui-root textarea:-ms-input-placeholder{opacity:1;color:#cbd5e0}.aui-root input::placeholder,.aui-root textarea::placeholder{opacity:1;color:#cbd5e0}.aui-root button{cursor:pointer}.aui-root table{border-collapse:collapse}.aui-root h1,.aui-root h2,.aui-root h3,.aui-root h4,.aui-root h5,.aui-root h6{font-size:inherit;font-weight:inherit}.aui-root a{color:inherit;text-decoration:inherit}.aui-root button,.aui-root input,.aui-root optgroup,.aui-root select,.aui-root textarea{padding:0;line-height:inherit;color:inherit}.aui-root code,.aui-root kbd,.aui-root pre,.aui-root samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.aui-root audio,.aui-root canvas,.aui-root embed,.aui-root iframe,.aui-root img,.aui-root object,.aui-root svg,.aui-root video{display:block;vertical-align:middle}.aui-root img,.aui-root video{max-width:100%;height:auto}.aui-root [hidden]{display:none}.aui-root *,.aui-root :after,.aui-root :before{--tw-border-opacity:1;border-color:rgba(203,213,224,var(--tw-border-opacity))}.aui-root .prose{color:#4a5568;max-width:65ch}.aui-root .prose [class~=lead]{color:#718096;font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.aui-root .prose a{color:#1a202c;text-decoration:underline;font-weight:500}.aui-root .prose strong{color:#1a202c;font-weight:600}.aui-root .prose ol[type=a]{--list-counter-style:lower-alpha}.aui-root .prose ol[type=i]{--list-counter-style:lower-roman}.aui-root .prose ol[type="1"]{--list-counter-style:decimal}.aui-root .prose ol>li{position:relative;padding-left:1.75em}.aui-root .prose ol>li:before{content:counter(list-item,var(--list-counter-style,decimal)) ".";position:absolute;font-weight:400;color:#a0aec0;left:0}.aui-root .prose ul>li{position:relative;padding-left:1.75em}.aui-root .prose ul>li:before{content:"";position:absolute;background-color:#e2e8f0;border-radius:50%;width:.375em;height:.375em;top:.6875em;left:.25em}.aui-root .prose hr{border-color:#edf2f7;border-top-width:1px;margin-top:3em;margin-bottom:3em}.aui-root .prose blockquote{font-weight:500;font-style:italic;color:#1a202c;border-left-width:.25rem;border-left-color:#edf2f7;quotes:"\201C""\201D""\2018""\2019";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.aui-root .prose blockquote p:first-of-type:before{content:open-quote}.aui-root .prose blockquote p:last-of-type:after{content:close-quote}.aui-root .prose h1{color:#1a202c;font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.aui-root .prose h2{color:#1a202c;font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.aui-root .prose h3{color:#1a202c;font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.aui-root .prose h4{color:#1a202c;font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.aui-root .prose figure figcaption{color:#a0aec0;font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.aui-root .prose code{color:#1a202c;font-weight:600;font-size:.875em}.aui-root .prose code:after,.aui-root .prose code:before{content:"`"}.aui-root .prose a code{color:#1a202c}.aui-root .prose pre{color:#edf2f7;background-color:#1a202c;overflow-x:auto;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.aui-root .prose pre code{background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:400;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.aui-root .prose pre code:after,.aui-root .prose pre code:before{content:none}.aui-root .prose table{width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.aui-root .prose thead{color:#1a202c;font-weight:600;border-bottom-width:1px;border-bottom-color:#e2e8f0}.aui-root .prose thead th{vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.aui-root .prose tbody tr{border-bottom-width:1px;border-bottom-color:#edf2f7}.aui-root .prose tbody tr:last-child{border-bottom-width:0}.aui-root .prose tbody td{vertical-align:top;padding:.5714286em}.aui-root .prose{font-size:1rem;line-height:1.75}.aui-root .prose p{margin-top:1.25em;margin-bottom:1.25em}.aui-root .prose figure,.aui-root .prose img,.aui-root .prose video{margin-top:2em;margin-bottom:2em}.aui-root .prose figure>*{margin-top:0;margin-bottom:0}.aui-root .prose h2 code{font-size:.875em}.aui-root .prose h3 code{font-size:.9em}.aui-root .prose ol,.aui-root .prose ul{margin-top:1.25em;margin-bottom:1.25em}.aui-root .prose li{margin-top:.5em;margin-bottom:.5em}.aui-root .prose>ul>li p{margin-top:.75em;margin-bottom:.75em}.aui-root .prose>ul>li>:first-child{margin-top:1.25em}.aui-root .prose>ul>li>:last-child{margin-bottom:1.25em}.aui-root .prose>ol>li>:first-child{margin-top:1.25em}.aui-root .prose>ol>li>:last-child{margin-bottom:1.25em}.aui-root .prose ol ol,.aui-root .prose ol ul,.aui-root .prose ul ol,.aui-root .prose ul ul{margin-top:.75em;margin-bottom:.75em}.aui-root .prose h2+*,.aui-root .prose h3+*,.aui-root .prose h4+*,.aui-root .prose hr+*{margin-top:0}.aui-root .prose thead th:first-child{padding-left:0}.aui-root .prose thead th:last-child{padding-right:0}.aui-root .prose tbody td:first-child{padding-left:0}.aui-root .prose tbody td:last-child{padding-right:0}.aui-root .prose>:first-child{margin-top:0}.aui-root .prose>:last-child{margin-bottom:0}@media (min-width:1024px){.aui-root .container\:base .burger-menu{display:none}}@media (min-width:1024px){.aui-root .container\:base .sidebar{position:relative;display:block;height:auto;width:16rem}}@media (min-width:1024px){.aui-root .container\:base .sidebar--content{width:14rem}}.aui-root .container\:xl .sidebar--content{position:absolute;left:50%;transform:translate(-50%)}@media (min-width:1536px){.aui-root .container\:base .panel-item{display:flex}}.aui-root .container\:xl .panel-item{display:block}@media (min-width:1536px){.aui-root .container\:base .panel--center .panel-item--center{width:58.333333%}}@media (min-width:1536px){.aui-root .container\:base .panel--center .panel-item--right{width:41.666667%}}.aui-root .container\:xl .panel--center .panel-item--center,.aui-root .container\:xl .panel--center .panel-item--right{width:100%}@media (min-width:1536px){.aui-root .container\:base .examples{margin-top:0;padding:0}}.aui-root .container\:base .panel--right{display:none}@media (min-width:1536px){.aui-root .container\:base .panel--right{display:block;width:41.666667%}}.aui-root .container\:xl .panel--right{display:none}.aui-root .prose pre{white-space:pre-wrap}.aui-root .fixed{position:fixed}.aui-root .absolute{position:absolute}.aui-root .relative{position:relative}.aui-root .top-0{top:0}.aui-root .right-0{right:0}.aui-root .right-8{right:2rem}.aui-root .bottom-16{bottom:4rem}.aui-root .z-10{z-index:10}.aui-root .z-20{z-index:20}.aui-root .z-30{z-index:30}.aui-root .mx-2{margin-left:.5rem;margin-right:.5rem}.aui-root .-mx-8{margin-left:-2rem;margin-right:-2rem}.aui-root .my-2{margin-top:.5rem;margin-bottom:.5rem}.aui-root .mt-1{margin-top:.25rem}.aui-root .mt-2{margin-top:.5rem}.aui-root .mt-4{margin-top:1rem}.aui-root .mt-9{margin-top:2.25rem}.aui-root .mt-10{margin-top:2.5rem}.aui-root .mt-16{margin-top:4rem}.aui-root .mr-1{margin-right:.25rem}.aui-root .mr-2{margin-right:.5rem}.aui-root .mb-2{margin-bottom:.5rem}.aui-root .mb-3{margin-bottom:.75rem}.aui-root .mb-4{margin-bottom:1rem}.aui-root .mb-12{margin-bottom:3rem}.aui-root .-mb-1{margin-bottom:-.25rem}.aui-root .ml-0{margin-left:0}.aui-root .ml-1{margin-left:.25rem}.aui-root .ml-2{margin-left:.5rem}.aui-root .ml-0\.5{margin-left:.125rem}.aui-root .block{display:block}.aui-root .inline-block{display:inline-block}.aui-root .flex{display:flex}.aui-root .table{display:table}.aui-root .hidden{display:none}.aui-root .h-5{height:1.25rem}.aui-root .h-6{height:1.5rem}.aui-root .h-16{height:4rem}.aui-root .h-full{height:100%}.aui-root .max-h-screen{max-height:100vh}.aui-root .w-5{width:1.25rem}.aui-root .w-16{width:4rem}.aui-root .w-20{width:5rem}.aui-root .w-64{width:16rem}.aui-root .w-full{width:100%}.aui-root .min-w-1\/4{min-width:25%}.aui-root .max-w-none{max-width:none}.aui-root .flex-1{flex:1 1 0%}.aui-root .transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.aui-root .-rotate-180{--tw-rotate:-180deg}.aui-root .-rotate-90{--tw-rotate:-90deg}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}.aui-root .cursor-pointer{cursor:pointer}.aui-root .flex-wrap{flex-wrap:wrap}.aui-root .items-center{align-items:center}.aui-root .justify-center{justify-content:center}.aui-root .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem*var(--tw-space-x-reverse));margin-left:calc(0.5rem*(1 - var(--tw-space-x-reverse)))}.aui-root .space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.5rem*var(--tw-space-y-reverse))}.aui-root .overflow-auto{overflow:auto}.aui-root .overflow-y-auto{overflow-y:auto}.aui-root .whitespace-pre-wrap{white-space:pre-wrap}.aui-root .break-words{overflow-wrap:break-word}.aui-root .break-all{word-break:break-all}.aui-root .rounded{border-radius:.25rem}.aui-root .rounded-full{border-radius:9999px}.aui-root .border{border-width:1px}.aui-root .border-l-8{border-left-width:8px}.aui-root .border-solid{border-style:solid}.aui-root .border-gray-400{--tw-border-opacity:1;border-color:rgba(203,213,224,var(--tw-border-opacity))}.aui-root .border-red-500{--tw-border-opacity:1;border-color:rgba(245,101,101,var(--tw-border-opacity))}.aui-root .border-orange-300{--tw-border-opacity:1;border-color:rgba(251,211,141,var(--tw-border-opacity))}.aui-root .border-green-600{--tw-border-opacity:1;border-color:rgba(56,161,105,var(--tw-border-opacity))}.aui-root .border-blue-300{--tw-border-opacity:1;border-color:rgba(144,205,244,var(--tw-border-opacity))}.aui-root .border-blue-600{--tw-border-opacity:1;border-color:rgba(49,130,206,var(--tw-border-opacity))}.aui-root .border-purple-300{--tw-border-opacity:1;border-color:rgba(214,188,250,var(--tw-border-opacity))}.aui-root .bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.aui-root .bg-gray-100{--tw-bg-opacity:1;background-color:rgba(247,250,252,var(--tw-bg-opacity))}.aui-root .bg-gray-200{--tw-bg-opacity:1;background-color:rgba(237,242,247,var(--tw-bg-opacity))}.aui-root .bg-gray-800{--tw-bg-opacity:1;background-color:rgba(45,55,72,var(--tw-bg-opacity))}.aui-root .bg-yellow-600{--tw-bg-opacity:1;background-color:rgba(214,158,46,var(--tw-bg-opacity))}.aui-root .bg-green-600{--tw-bg-opacity:1;background-color:rgba(56,161,105,var(--tw-bg-opacity))}.aui-root .bg-teal-500{--tw-bg-opacity:1;background-color:rgba(56,178,172,var(--tw-bg-opacity))}.aui-root .bg-blue-400{--tw-bg-opacity:1;background-color:rgba(99,179,237,var(--tw-bg-opacity))}.aui-root .bg-blue-500{--tw-bg-opacity:1;background-color:rgba(66,153,225,var(--tw-bg-opacity))}.aui-root .bg-blue-600{--tw-bg-opacity:1;background-color:rgba(49,130,206,var(--tw-bg-opacity))}.aui-root .bg-indigo-400{--tw-bg-opacity:1;background-color:rgba(127,156,245,var(--tw-bg-opacity))}.aui-root .bg-purple-600{--tw-bg-opacity:1;background-color:rgba(128,90,213,var(--tw-bg-opacity))}.aui-root .hover\:bg-orange-300:hover{--tw-bg-opacity:1;background-color:rgba(251,211,141,var(--tw-bg-opacity))}.aui-root .hover\:bg-blue-300:hover{--tw-bg-opacity:1;background-color:rgba(144,205,244,var(--tw-bg-opacity))}.aui-root .hover\:bg-purple-300:hover{--tw-bg-opacity:1;background-color:rgba(214,188,250,var(--tw-bg-opacity))}.aui-root .fill-current{fill:currentColor}.aui-root .p-1{padding:.25rem}.aui-root .p-2{padding:.5rem}.aui-root .p-4{padding:1rem}.aui-root .p-8{padding:2rem}.aui-root .px-1{padding-left:.25rem;padding-right:.25rem}.aui-root .px-2{padding-left:.5rem;padding-right:.5rem}.aui-root .px-3{padding-left:.75rem;padding-right:.75rem}.aui-root .px-4{padding-left:1rem;padding-right:1rem}.aui-root .px-8{padding-left:2rem;padding-right:2rem}.aui-root .py-0{padding-top:0;padding-bottom:0}.aui-root .py-1{padding-top:.25rem;padding-bottom:.25rem}.aui-root .py-2{padding-top:.5rem;padding-bottom:.5rem}.aui-root .py-4{padding-top:1rem;padding-bottom:1rem}.aui-root .py-8{padding-top:2rem;padding-bottom:2rem}.aui-root .py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.aui-root .pt-8{padding-top:2rem}.aui-root .pb-16{padding-bottom:4rem}.aui-root .text-left{text-align:left}.aui-root .text-center{text-align:center}.aui-root .align-baseline{vertical-align:baseline}.aui-root .font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.aui-root .font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.aui-root .text-xs{font-size:.75rem}.aui-root .text-sm{font-size:.875rem}.aui-root .text-base{font-size:1rem}.aui-root .text-lg{font-size:1.125rem}.aui-root .text-2xl{font-size:1.5rem}.aui-root .text-3xl{font-size:1.875rem}.aui-root .text-4xl{font-size:2.25rem}.aui-root .font-thin{font-weight:100}.aui-root .font-extralight{font-weight:200}.aui-root .font-light{font-weight:300}.aui-root .font-bold{font-weight:700}.aui-root .uppercase{text-transform:uppercase}.aui-root .lowercase{text-transform:lowercase}.aui-root .capitalize{text-transform:capitalize}.aui-root .italic{font-style:italic}.aui-root .leading-normal{line-height:1.5}.aui-root .text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.aui-root .text-gray-200{--tw-text-opacity:1;color:rgba(237,242,247,var(--tw-text-opacity))}.aui-root .text-gray-500{--tw-text-opacity:1;color:rgba(160,174,192,var(--tw-text-opacity))}.aui-root .text-gray-600{--tw-text-opacity:1;color:rgba(113,128,150,var(--tw-text-opacity))}.aui-root .text-gray-700{--tw-text-opacity:1;color:rgba(74,85,104,var(--tw-text-opacity))}.aui-root .text-gray-800{--tw-text-opacity:1;color:rgba(45,55,72,var(--tw-text-opacity))}.aui-root .text-red-600{--tw-text-opacity:1;color:rgba(229,62,62,var(--tw-text-opacity))}.aui-root .text-orange-500{--tw-text-opacity:1;color:rgba(237,137,54,var(--tw-text-opacity))}.aui-root .text-orange-600{--tw-text-opacity:1;color:rgba(221,107,32,var(--tw-text-opacity))}.aui-root .text-green-600{--tw-text-opacity:1;color:rgba(56,161,105,var(--tw-text-opacity))}.aui-root .text-teal-500{--tw-text-opacity:1;color:rgba(56,178,172,var(--tw-text-opacity))}.aui-root .text-blue-500{--tw-text-opacity:1;color:rgba(66,153,225,var(--tw-text-opacity))}.aui-root .text-purple-500{--tw-text-opacity:1;color:rgba(159,122,234,var(--tw-text-opacity))}.aui-root .hover\:text-gray-900:hover{--tw-text-opacity:1;color:rgba(26,32,44,var(--tw-text-opacity))}.aui-root .hover\:text-orange-600:hover{--tw-text-opacity:1;color:rgba(221,107,32,var(--tw-text-opacity))}.aui-root .hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgba(49,130,206,var(--tw-text-opacity))}.aui-root .hover\:text-purple-600:hover{--tw-text-opacity:1;color:rgba(128,90,213,var(--tw-text-opacity))}.aui-root .underline{text-decoration:underline}.aui-root .no-underline{text-decoration:none}.aui-root *,.aui-root :after,.aui-root :before{--tw-shadow:0 0 transparent}.aui-root .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06)}.aui-root .shadow,.aui-root .shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.aui-root .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -1px rgba(0,0,0,0.06)}.aui-root .focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.aui-root *,.aui-root :after,.aui-root :before{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(66,153,225,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent}.aui-root .filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.aui-root .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.aui-root .duration-150{transition-duration:.15s}.aui-root .ease-linear{transition-timing-function:linear}@media (min-width:768px){.aui-root .md\:flex{display:flex}}@media (min-width:1536px){.aui-root .\32xl\:mx-0{margin-left:0;margin-right:0}.aui-root .\32xl\:w-7\/12{width:58.333333%}.aui-root .\32xl\:rounded{border-radius:.25rem}.aui-root .\32xl\:px-4{padding-left:1rem;padding-right:1rem}} \ No newline at end of file diff --git a/src/main/resources/ui/default(1.2.6).min.css b/src/main/resources/ui/default(1.2.6).min.css new file mode 100644 index 0000000..97f8d3d --- /dev/null +++ b/src/main/resources/ui/default(1.2.6).min.css @@ -0,0 +1,5 @@ +.aui-root .hljs{display:block;overflow-x:auto;padding:.5em;background:#011627;color:#d6deeb}.aui-root .hljs-keyword{color:#c792ea;font-style:italic}.aui-root .hljs-built_in{color:#addb67;font-style:italic}.aui-root .hljs-type{color:#82aaff}.aui-root .hljs-literal{color:#ff5874}.aui-root .hljs-number{color:#f78c6c}.aui-root .hljs-regexp{color:#5ca7e4}.aui-root .hljs-string{color:#ecc48d}.aui-root .hljs-subst{color:#d3423e}.aui-root .hljs-symbol{color:#82aaff}.aui-root .hljs-class{color:#ffcb8b}.aui-root .hljs-function{color:#82aaff}.aui-root .hljs-title{color:#dcdcaa;font-style:italic}.aui-root .hljs-params{color:#7fdbca}.aui-root .hljs-comment{color:#637777;font-style:italic}.aui-root .hljs-doctag{color:#7fdbca}.aui-root .hljs-meta,.aui-root .hljs-meta-keyword{color:#82aaff}.aui-root .hljs-meta-string{color:#ecc48d}.aui-root .hljs-section{color:#82b1ff}.aui-root .hljs-attr,.aui-root .hljs-builtin-name,.aui-root .hljs-name,.aui-root .hljs-tag{color:#7fdbca}.aui-root .hljs-attribute{color:#80cbc4}.aui-root .hljs-variable{color:#addb67}.aui-root .hljs-bullet{color:#d9f5dd}.aui-root .hljs-code{color:#80cbc4}.aui-root .hljs-emphasis{color:#c792ea;font-style:italic}.aui-root .hljs-strong{color:#addb67;font-weight:700}.aui-root .hljs-formula{color:#c792ea}.aui-root .hljs-link{color:#ff869a}.aui-root .hljs-quote{color:#697098;font-style:italic}.aui-root .hljs-selector-tag{color:#ff6363}.aui-root .hljs-selector-id{color:#fad430}.aui-root .hljs-selector-class{color:#addb67;font-style:italic}.aui-root .hljs-selector-attr,.aui-root .hljs-selector-pseudo{color:#c792ea;font-style:italic}.aui-root .hljs-template-tag{color:#c792ea}.aui-root .hljs-template-variable{color:#addb67}.aui-root .hljs-addition{color:#addb67;font-style:italic}.aui-root .hljs-deletion{color:rgba(239,83,80,.5647058823529412);font-style:italic} + +/*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com*/ + +/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */.aui-root html{-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.15;-webkit-text-size-adjust:100%}.aui-root body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji}.aui-root hr{height:0;color:inherit}.aui-root abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.aui-root b,.aui-root strong{font-weight:bolder}.aui-root code,.aui-root kbd,.aui-root pre,.aui-root samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}.aui-root small{font-size:80%}.aui-root sub,.aui-root sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.aui-root sub{bottom:-.25em}.aui-root sup{top:-.5em}.aui-root table{text-indent:0;border-color:inherit}.aui-root button,.aui-root input,.aui-root optgroup,.aui-root select,.aui-root textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}.aui-root button,.aui-root select{text-transform:none}.aui-root [type=button],.aui-root button{-webkit-appearance:button}.aui-root legend{padding:0}.aui-root progress{vertical-align:baseline}.aui-root summary{display:list-item}.aui-root blockquote,.aui-root dd,.aui-root dl,.aui-root figure,.aui-root h1,.aui-root h2,.aui-root h3,.aui-root h4,.aui-root h5,.aui-root h6,.aui-root hr,.aui-root p,.aui-root pre{margin:0}.aui-root button{background-color:transparent;background-image:none}.aui-root fieldset{margin:0;padding:0}.aui-root ol,.aui-root ul{list-style:none;margin:0;padding:0}.aui-root html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}.aui-root body{font-family:inherit;line-height:inherit}.aui-root *,.aui-root :after,.aui-root :before{box-sizing:border-box;border:0 solid}.aui-root hr{border-top-width:1px}.aui-root img{border-style:solid}.aui-root textarea{resize:vertical}.aui-root input::-moz-placeholder, .aui-root textarea::-moz-placeholder{opacity:1;color:#cbd5e0}.aui-root input:-ms-input-placeholder, .aui-root textarea:-ms-input-placeholder{opacity:1;color:#cbd5e0}.aui-root input::placeholder,.aui-root textarea::placeholder{opacity:1;color:#cbd5e0}.aui-root button{cursor:pointer}.aui-root table{border-collapse:collapse}.aui-root h1,.aui-root h2,.aui-root h3,.aui-root h4,.aui-root h5,.aui-root h6{font-size:inherit;font-weight:inherit}.aui-root a{color:inherit;text-decoration:inherit}.aui-root button,.aui-root input,.aui-root optgroup,.aui-root select,.aui-root textarea{padding:0;line-height:inherit;color:inherit}.aui-root code,.aui-root kbd,.aui-root pre,.aui-root samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.aui-root audio,.aui-root canvas,.aui-root embed,.aui-root iframe,.aui-root img,.aui-root object,.aui-root svg,.aui-root video{display:block;vertical-align:middle}.aui-root img,.aui-root video{max-width:100%;height:auto}.aui-root [hidden]{display:none}.aui-root *,.aui-root :after,.aui-root :before{--tw-border-opacity:1;border-color:rgba(203,213,224,var(--tw-border-opacity))}.aui-root .container{width:100%}@media (min-width:640px){.aui-root .container{max-width:640px}}@media (min-width:768px){.aui-root .container{max-width:768px}}@media (min-width:1024px){.aui-root .container{max-width:1024px}}@media (min-width:1280px){.aui-root .container{max-width:1280px}}@media (min-width:1536px){.aui-root .container{max-width:1536px}}.aui-root .prose{color:#4a5568;max-width:65ch}.aui-root .prose [class~=lead]{color:#718096;font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.aui-root .prose a{color:#1a202c;text-decoration:underline;font-weight:500}.aui-root .prose strong{color:#1a202c;font-weight:600}.aui-root .prose ol[type=a]{--list-counter-style:lower-alpha}.aui-root .prose ol[type=i]{--list-counter-style:lower-roman}.aui-root .prose ol[type="1"]{--list-counter-style:decimal}.aui-root .prose ol>li{position:relative;padding-left:1.75em}.aui-root .prose ol>li:before{content:counter(list-item,var(--list-counter-style,decimal)) ".";position:absolute;font-weight:400;color:#a0aec0;left:0}.aui-root .prose ul>li{position:relative;padding-left:1.75em}.aui-root .prose ul>li:before{content:"";position:absolute;background-color:#e2e8f0;border-radius:50%;width:.375em;height:.375em;top:.6875em;left:.25em}.aui-root .prose hr{border-color:#edf2f7;border-top-width:1px;margin-top:3em;margin-bottom:3em}.aui-root .prose blockquote{font-weight:500;font-style:italic;color:#1a202c;border-left-width:.25rem;border-left-color:#edf2f7;quotes:"\201C""\201D""\2018""\2019";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.aui-root .prose blockquote p:first-of-type:before{content:open-quote}.aui-root .prose blockquote p:last-of-type:after{content:close-quote}.aui-root .prose h1{color:#1a202c;font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.aui-root .prose h2{color:#1a202c;font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.aui-root .prose h3{color:#1a202c;font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.aui-root .prose h4{color:#1a202c;font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.aui-root .prose figure figcaption{color:#a0aec0;font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.aui-root .prose code{color:#1a202c;font-weight:600;font-size:.875em}.aui-root .prose code:after,.aui-root .prose code:before{content:"`"}.aui-root .prose a code{color:#1a202c}.aui-root .prose pre{color:#edf2f7;background-color:#1a202c;overflow-x:auto;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.aui-root .prose pre code{background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:400;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.aui-root .prose pre code:after,.aui-root .prose pre code:before{content:none}.aui-root .prose table{width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.aui-root .prose thead{color:#1a202c;font-weight:600;border-bottom-width:1px;border-bottom-color:#e2e8f0}.aui-root .prose thead th{vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.aui-root .prose tbody tr{border-bottom-width:1px;border-bottom-color:#edf2f7}.aui-root .prose tbody tr:last-child{border-bottom-width:0}.aui-root .prose tbody td{vertical-align:top;padding:.5714286em}.aui-root .prose{font-size:1rem;line-height:1.75}.aui-root .prose p{margin-top:1.25em;margin-bottom:1.25em}.aui-root .prose figure,.aui-root .prose img,.aui-root .prose video{margin-top:2em;margin-bottom:2em}.aui-root .prose figure>*{margin-top:0;margin-bottom:0}.aui-root .prose h2 code{font-size:.875em}.aui-root .prose h3 code{font-size:.9em}.aui-root .prose ol,.aui-root .prose ul{margin-top:1.25em;margin-bottom:1.25em}.aui-root .prose li{margin-top:.5em;margin-bottom:.5em}.aui-root .prose>ul>li p{margin-top:.75em;margin-bottom:.75em}.aui-root .prose>ul>li>:first-child{margin-top:1.25em}.aui-root .prose>ul>li>:last-child{margin-bottom:1.25em}.aui-root .prose>ol>li>:first-child{margin-top:1.25em}.aui-root .prose>ol>li>:last-child{margin-bottom:1.25em}.aui-root .prose ol ol,.aui-root .prose ol ul,.aui-root .prose ul ol,.aui-root .prose ul ul{margin-top:.75em;margin-bottom:.75em}.aui-root .prose h2+*,.aui-root .prose h3+*,.aui-root .prose h4+*,.aui-root .prose hr+*{margin-top:0}.aui-root .prose thead th:first-child{padding-left:0}.aui-root .prose thead th:last-child{padding-right:0}.aui-root .prose tbody td:first-child{padding-left:0}.aui-root .prose tbody td:last-child{padding-right:0}.aui-root .prose>:first-child{margin-top:0}.aui-root .prose>:last-child{margin-bottom:0}@media (min-width:1024px){.aui-root .container\:base .burger-menu{display:none}}@media (min-width:1024px){.aui-root .container\:base .sidebar{position:relative;display:block;height:auto;width:16rem}}@media (min-width:1024px){.aui-root .container\:base .sidebar--content{width:14rem}}.aui-root .container\:xl .sidebar--content{position:absolute;left:50%;transform:translate(-50%)}@media (min-width:1536px){.aui-root .container\:base .panel-item{display:flex}}.aui-root .container\:xl .panel-item{display:block}@media (min-width:1536px){.aui-root .container\:base .panel--center .panel-item--center{width:58.333333%}}@media (min-width:1536px){.aui-root .container\:base .panel--center .panel-item--right{width:41.666667%}}.aui-root .container\:xl .panel--center .panel-item--center,.aui-root .container\:xl .panel--center .panel-item--right{width:100%}@media (min-width:1536px){.aui-root .container\:base .examples{margin-top:0}}.aui-root .container\:base .panel--right{display:none}@media (min-width:1536px){.aui-root .container\:base .panel--right{display:block;width:41.666667%}}.aui-root .container\:xl .panel--right{display:none}.aui-root .prose pre{white-space:pre-wrap}.aui-root .fixed{position:fixed}.aui-root .absolute{position:absolute}.aui-root .relative{position:relative}.aui-root .top-0{top:0}.aui-root .right-0{right:0}.aui-root .right-8{right:2rem}.aui-root .bottom-16{bottom:4rem}.aui-root .z-10{z-index:10}.aui-root .z-20{z-index:20}.aui-root .z-30{z-index:30}.aui-root .mx-2{margin-left:.5rem;margin-right:.5rem}.aui-root .-mx-8{margin-left:-2rem;margin-right:-2rem}.aui-root .my-2{margin-top:.5rem;margin-bottom:.5rem}.aui-root .mt-1{margin-top:.25rem}.aui-root .mt-2{margin-top:.5rem}.aui-root .mt-4{margin-top:1rem}.aui-root .mt-9{margin-top:2.25rem}.aui-root .mt-10{margin-top:2.5rem}.aui-root .mt-16{margin-top:4rem}.aui-root .mr-1{margin-right:.25rem}.aui-root .mr-2{margin-right:.5rem}.aui-root .mb-2{margin-bottom:.5rem}.aui-root .mb-3{margin-bottom:.75rem}.aui-root .mb-4{margin-bottom:1rem}.aui-root .mb-12{margin-bottom:3rem}.aui-root .-mb-1{margin-bottom:-.25rem}.aui-root .ml-0{margin-left:0}.aui-root .ml-1{margin-left:.25rem}.aui-root .ml-2{margin-left:.5rem}.aui-root .ml-0\.5{margin-left:.125rem}.aui-root .block{display:block}.aui-root .inline-block{display:inline-block}.aui-root .flex{display:flex}.aui-root .table{display:table}.aui-root .hidden{display:none}.aui-root .h-5{height:1.25rem}.aui-root .h-6{height:1.5rem}.aui-root .h-8{height:2rem}.aui-root .h-11{height:2.75rem}.aui-root .h-16{height:4rem}.aui-root .h-full{height:100%}.aui-root .max-h-screen{max-height:100vh}.aui-root .w-1{width:.25rem}.aui-root .w-5{width:1.25rem}.aui-root .w-16{width:4rem}.aui-root .w-20{width:5rem}.aui-root .w-64{width:16rem}.aui-root .w-full{width:100%}.aui-root .min-w-1\/4{min-width:25%}.aui-root .max-w-none{max-width:none}.aui-root .flex-1{flex:1 1 0%}.aui-root .transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.aui-root .-rotate-180{--tw-rotate:-180deg}.aui-root .-rotate-90{--tw-rotate:-90deg}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}.aui-root .cursor-pointer{cursor:pointer}.aui-root .flex-wrap{flex-wrap:wrap}.aui-root .items-center{align-items:center}.aui-root .justify-center{justify-content:center}.aui-root .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem*var(--tw-space-x-reverse));margin-left:calc(0.5rem*(1 - var(--tw-space-x-reverse)))}.aui-root .space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.5rem*var(--tw-space-y-reverse))}.aui-root .overflow-auto{overflow:auto}.aui-root .overflow-y-auto{overflow-y:auto}.aui-root .whitespace-pre-wrap{white-space:pre-wrap}.aui-root .break-words{overflow-wrap:break-word}.aui-root .break-all{word-break:break-all}.aui-root .rounded{border-radius:.25rem}.aui-root .rounded-full{border-radius:9999px}.aui-root .rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.aui-root .border{border-width:1px}.aui-root .border-l-8{border-left-width:8px}.aui-root .border-solid{border-style:solid}.aui-root .border-gray-400{--tw-border-opacity:1;border-color:rgba(203,213,224,var(--tw-border-opacity))}.aui-root .border-red-500{--tw-border-opacity:1;border-color:rgba(245,101,101,var(--tw-border-opacity))}.aui-root .border-red-600{--tw-border-opacity:1;border-color:rgba(229,62,62,var(--tw-border-opacity))}.aui-root .border-orange-300{--tw-border-opacity:1;border-color:rgba(251,211,141,var(--tw-border-opacity))}.aui-root .border-orange-600{--tw-border-opacity:1;border-color:rgba(221,107,32,var(--tw-border-opacity))}.aui-root .border-green-600{--tw-border-opacity:1;border-color:rgba(56,161,105,var(--tw-border-opacity))}.aui-root .border-blue-300{--tw-border-opacity:1;border-color:rgba(144,205,244,var(--tw-border-opacity))}.aui-root .border-blue-600{--tw-border-opacity:1;border-color:rgba(49,130,206,var(--tw-border-opacity))}.aui-root .border-purple-300{--tw-border-opacity:1;border-color:rgba(214,188,250,var(--tw-border-opacity))}.aui-root .bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.aui-root .bg-gray-100{--tw-bg-opacity:1;background-color:rgba(247,250,252,var(--tw-bg-opacity))}.aui-root .bg-gray-200{--tw-bg-opacity:1;background-color:rgba(237,242,247,var(--tw-bg-opacity))}.aui-root .bg-gray-800{--tw-bg-opacity:1;background-color:rgba(45,55,72,var(--tw-bg-opacity))}.aui-root .bg-yellow-600{--tw-bg-opacity:1;background-color:rgba(214,158,46,var(--tw-bg-opacity))}.aui-root .bg-green-600{--tw-bg-opacity:1;background-color:rgba(56,161,105,var(--tw-bg-opacity))}.aui-root .bg-teal-500{--tw-bg-opacity:1;background-color:rgba(56,178,172,var(--tw-bg-opacity))}.aui-root .bg-blue-400{--tw-bg-opacity:1;background-color:rgba(99,179,237,var(--tw-bg-opacity))}.aui-root .bg-blue-500{--tw-bg-opacity:1;background-color:rgba(66,153,225,var(--tw-bg-opacity))}.aui-root .bg-blue-600{--tw-bg-opacity:1;background-color:rgba(49,130,206,var(--tw-bg-opacity))}.aui-root .bg-indigo-400{--tw-bg-opacity:1;background-color:rgba(127,156,245,var(--tw-bg-opacity))}.aui-root .bg-purple-600{--tw-bg-opacity:1;background-color:rgba(128,90,213,var(--tw-bg-opacity))}.aui-root .hover\:bg-orange-300:hover{--tw-bg-opacity:1;background-color:rgba(251,211,141,var(--tw-bg-opacity))}.aui-root .hover\:bg-blue-300:hover{--tw-bg-opacity:1;background-color:rgba(144,205,244,var(--tw-bg-opacity))}.aui-root .hover\:bg-purple-300:hover{--tw-bg-opacity:1;background-color:rgba(214,188,250,var(--tw-bg-opacity))}.aui-root .fill-current{fill:currentColor}.aui-root .p-1{padding:.25rem}.aui-root .p-2{padding:.5rem}.aui-root .p-4{padding:1rem}.aui-root .p-8{padding:2rem}.aui-root .px-1{padding-left:.25rem;padding-right:.25rem}.aui-root .px-2{padding-left:.5rem;padding-right:.5rem}.aui-root .px-3{padding-left:.75rem;padding-right:.75rem}.aui-root .px-4{padding-left:1rem;padding-right:1rem}.aui-root .px-8{padding-left:2rem;padding-right:2rem}.aui-root .py-0{padding-top:0;padding-bottom:0}.aui-root .py-1{padding-top:.25rem;padding-bottom:.25rem}.aui-root .py-2{padding-top:.5rem;padding-bottom:.5rem}.aui-root .py-4{padding-top:1rem;padding-bottom:1rem}.aui-root .py-8{padding-top:2rem;padding-bottom:2rem}.aui-root .py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.aui-root .pt-8{padding-top:2rem}.aui-root .pb-16{padding-bottom:4rem}.aui-root .text-left{text-align:left}.aui-root .text-center{text-align:center}.aui-root .align-baseline{vertical-align:baseline}.aui-root .font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.aui-root .font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.aui-root .text-xs{font-size:.75rem}.aui-root .text-sm{font-size:.875rem}.aui-root .text-base{font-size:1rem}.aui-root .text-lg{font-size:1.125rem}.aui-root .text-2xl{font-size:1.5rem}.aui-root .text-3xl{font-size:1.875rem}.aui-root .text-4xl{font-size:2.25rem}.aui-root .font-thin{font-weight:100}.aui-root .font-extralight{font-weight:200}.aui-root .font-light{font-weight:300}.aui-root .font-bold{font-weight:700}.aui-root .uppercase{text-transform:uppercase}.aui-root .lowercase{text-transform:lowercase}.aui-root .capitalize{text-transform:capitalize}.aui-root .italic{font-style:italic}.aui-root .leading-normal{line-height:1.5}.aui-root .text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.aui-root .text-gray-200{--tw-text-opacity:1;color:rgba(237,242,247,var(--tw-text-opacity))}.aui-root .text-gray-500{--tw-text-opacity:1;color:rgba(160,174,192,var(--tw-text-opacity))}.aui-root .text-gray-600{--tw-text-opacity:1;color:rgba(113,128,150,var(--tw-text-opacity))}.aui-root .text-gray-700{--tw-text-opacity:1;color:rgba(74,85,104,var(--tw-text-opacity))}.aui-root .text-gray-800{--tw-text-opacity:1;color:rgba(45,55,72,var(--tw-text-opacity))}.aui-root .text-red-600{--tw-text-opacity:1;color:rgba(229,62,62,var(--tw-text-opacity))}.aui-root .text-orange-500{--tw-text-opacity:1;color:rgba(237,137,54,var(--tw-text-opacity))}.aui-root .text-orange-600{--tw-text-opacity:1;color:rgba(221,107,32,var(--tw-text-opacity))}.aui-root .text-green-600{--tw-text-opacity:1;color:rgba(56,161,105,var(--tw-text-opacity))}.aui-root .text-teal-500{--tw-text-opacity:1;color:rgba(56,178,172,var(--tw-text-opacity))}.aui-root .text-blue-500{--tw-text-opacity:1;color:rgba(66,153,225,var(--tw-text-opacity))}.aui-root .text-purple-500{--tw-text-opacity:1;color:rgba(159,122,234,var(--tw-text-opacity))}.aui-root .hover\:text-gray-900:hover{--tw-text-opacity:1;color:rgba(26,32,44,var(--tw-text-opacity))}.aui-root .hover\:text-orange-600:hover{--tw-text-opacity:1;color:rgba(221,107,32,var(--tw-text-opacity))}.aui-root .hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgba(49,130,206,var(--tw-text-opacity))}.aui-root .hover\:text-purple-600:hover{--tw-text-opacity:1;color:rgba(128,90,213,var(--tw-text-opacity))}.aui-root .underline{text-decoration:underline}.aui-root .no-underline{text-decoration:none}.aui-root *,.aui-root :after,.aui-root :before{--tw-shadow:0 0 transparent}.aui-root .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06)}.aui-root .shadow,.aui-root .shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.aui-root .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -1px rgba(0,0,0,0.06)}.aui-root .focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.aui-root *,.aui-root :after,.aui-root :before{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(66,153,225,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent}.aui-root .filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.aui-root .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.aui-root .duration-150{transition-duration:.15s}.aui-root .ease-linear{transition-timing-function:linear}.aui-root .break-anywhere{overflow-wrap:anywhere}@media (min-width:768px){.aui-root .md\:flex{display:flex}}@media (min-width:1536px){.aui-root .\32xl\:mx-0{margin-left:0;margin-right:0}.aui-root .\32xl\:w-7\/12{width:58.333333%}.aui-root .\32xl\:rounded{border-radius:.25rem}.aui-root .\32xl\:px-4{padding-left:1rem;padding-right:1rem}} \ No newline at end of file diff --git a/src/main/resources/ui/index(1.0.0-next.48).js b/src/main/resources/ui/index(1.0.0-next.48).js deleted file mode 100644 index 1479147..0000000 --- a/src/main/resources/ui/index(1.0.0-next.48).js +++ /dev/null @@ -1,51 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("AsyncApiStandalone",[],t):"object"==typeof exports?exports.AsyncApiStandalone=t():e.AsyncApiStandalone=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=309)}([function(e,t,n){"use strict";e.exports=n(76)},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"l",(function(){return i})),n.d(t,"j",(function(){return o})),n.d(t,"k",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"f",(function(){return c})),n.d(t,"i",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"e",(function(){return p})),n.d(t,"d",(function(){return f})),n.d(t,"g",(function(){return h})),n.d(t,"b",(function(){return d}));var r="https://www.iana.org/assignments/media-types",i="https://github.com/asyncapi/parser-js/validation-errors",o="Terms of service",a="Support",s="External Docs",c="PUB",u="SUB",l="Servers",p="Operations",f="Messages",h="Schemas",d="Error"},function(e,t){const n=e.exports,r=(e,t,n,r)=>{if("string"!=typeof t||!e)return null;const i=e[String(t)];return void 0===i?null:n?new n(i,r):i};n.createMapOfType=(e,t,n)=>{const r={};return e?(Object.entries(e).forEach(([e,i])=>{r[String(e)]=new t(i,n)}),r):r},n.getMapValueOfType=(e,t,n,i)=>r(e,t,n,i),n.getMapValueByKey=(e,t)=>r(e,t),n.mix=(e,...t)=>{let n=!1;if(t.some((function(t){return e===t||(n=Object.keys(t).some(t=>e.prototype.hasOwnProperty(t)),n)})))throw n?new Error(`invalid mix function: model ${e.name} has at least one method that it is trying to replace by mixin`):new Error(`invalid mix function: cannot use the model ${e.name} as a mixin`);return t.forEach(t=>Object.assign(e.prototype,t)),e}},function(e,t,n){const r=n(26);e.exports=class{constructor(e){if(null==e)throw new r(`Invalid JSON to instantiate the ${this.constructor.name} object.`);this._json=e}json(e){return void 0===e?this._json:this._json?this._json[String(e)]:void 0}}},function(e,t){const n={hasExtensions(){return!!this.extensionKeys().length},extensions(){const e={};return Object.entries(this._json).forEach(([t,n])=>{/^x-[\w\d\.\-\_]+$/.test(t)&&(e[String(t)]=n)}),e},extensionKeys(){return Object.keys(this.extensions())},extKeys(){return this.extensionKeys()},hasExtension(e){return!!e.startsWith("x-")&&!!this._json[String(e)]},extension(e){return e.startsWith("x-")?this._json[String(e)]:null},hasExt(e){return this.hasExtension(e)},ext(e){return this.extension(e)}};e.exports=n},,function(e,t,n){"use strict";(function(e){ - /*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ - var r=n(87),i=n(88),o=n(66);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return L(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return D(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-c),o=n;o>=0;o--){for(var p=!0,f=0;fi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function D(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+p<=n)switch(p){case 1:u<128&&(l=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,p=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=p}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),l=e.slice(t,n),p=0;pi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function $(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function O(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function F(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function I(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,o){return o||I(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return o||I(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUInt8=function(e,t){return t||T(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||T(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||T(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||T(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||T(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||T(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||T(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||T(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||$(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);$(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);$(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||$(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(13))},function(e,t,n){const{getMapValueByKey:r}=n(2),i={hasDescription(){return!!this._json.description},description(){return r(this._json,"description")}};e.exports=i},,function(e,t,n){"use strict";function r(e){return void 0!==e.url}var i;n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i})),function(e){e.PUBLISH="publish",e.SUBSCRIBE="subscribe"}(i||(i={}))},,function(e,t,n){const{createMapOfType:r,getMapValueOfType:i,mix:o}=n(2),a=n(3),{xParserCircle:s,xParserCircleProps:c}=n(27),u=n(7),l=n(17),p=n(4);class f extends a{constructor(e,t){super(e),this.options=t||{}}uid(){return this.$id()||this.ext("x-parser-schema-id")}$id(){return this._json.$id}multipleOf(){return this._json.multipleOf}maximum(){return this._json.maximum}exclusiveMaximum(){return this._json.exclusiveMaximum}minimum(){return this._json.minimum}exclusiveMinimum(){return this._json.exclusiveMinimum}maxLength(){return this._json.maxLength}minLength(){return this._json.minLength}pattern(){return this._json.pattern}maxItems(){return this._json.maxItems}minItems(){return this._json.minItems}uniqueItems(){return!!this._json.uniqueItems}maxProperties(){return this._json.maxProperties}minProperties(){return this._json.minProperties}required(){return this._json.required}enum(){return this._json.enum}type(){return this._json.type}allOf(){return this._json.allOf?this._json.allOf.map(e=>new f(e,{parent:this})):null}oneOf(){return this._json.oneOf?this._json.oneOf.map(e=>new f(e,{parent:this})):null}anyOf(){return this._json.anyOf?this._json.anyOf.map(e=>new f(e,{parent:this})):null}not(){return this._json.not?new f(this._json.not,{parent:this}):null}items(){return this._json.items?Array.isArray(this._json.items)?this._json.items.map(e=>new f(e,{parent:this})):new f(this._json.items,{parent:this}):null}properties(){return r(this._json.properties,f,{parent:this})}property(e){return i(this._json.properties,e,f,{parent:this})}additionalProperties(){const e=this._json.additionalProperties;if(null!=e)return"boolean"==typeof e?e:new f(e,{parent:this})}additionalItems(){const e=this._json.additionalItems;if(null!=e)return new f(e,{parent:this})}patternProperties(){return r(this._json.patternProperties,f,{parent:this})}const(){return this._json.const}contains(){return this._json.contains?new f(this._json.contains,{parent:this}):null}dependencies(){if(!this._json.dependencies)return null;const e={};return Object.entries(this._json.dependencies).forEach(([t,n])=>{e[String(t)]=Array.isArray(n)?n:new f(n,{parent:this})}),e}propertyNames(){return this._json.propertyNames?new f(this._json.propertyNames,{parent:this}):null}if(){return this._json.if?new f(this._json.if,{parent:this}):null}then(){return this._json.then?new f(this._json.then,{parent:this}):null}else(){return this._json.else?new f(this._json.else,{parent:this}):null}format(){return this._json.format}contentEncoding(){return this._json.contentEncoding}contentMediaType(){return this._json.contentMediaType}definitions(){return r(this._json.definitions,f,{parent:this})}title(){return this._json.title}default(){return this._json.default}deprecated(){return this._json.deprecated}discriminator(){return this._json.discriminator}readOnly(){return!!this._json.readOnly}writeOnly(){return!!this._json.writeOnly}examples(){return this._json.examples}isBooleanSchema(){return"boolean"==typeof this._json}isCircular(){if(this.ext(s))return!0;let e=this.options.parent;for(;e;){if(e._json===this._json)return!0;e=e.options&&e.options.parent}return!1}circularSchema(){let e=this.options.parent;for(;e;){if(e._json===this._json)return e;e=e.options&&e.options.parent}}hasCircularProps(){return Array.isArray(this.ext(c))?this.ext(c).length>0:Object.entries(this.properties()||{}).map(([e,t])=>{if(t.isCircular())return e}).filter(Boolean).length>0}circularProps(){return Array.isArray(this.ext(c))?this.ext(c):Object.entries(this.properties()||{}).map(([e,t])=>{if(t.isCircular())return e}).filter(Boolean)}}e.exports=o(f,u,l,p)},function(e,t,n){"use strict";var r=n(56),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===i.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){a[String(t)]=e}))})),a),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,u=[],l=!1,p=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):p=-1,u.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++p1)for(var n=1;n/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const c=e=>!!e.kind;class u{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=a(e)}openNode(e){if(!c(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){c(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{l._collapse(e)}))}}class p extends l{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new u(this,this.options).value()}finalize(){return!0}}function f(e){return e?"string"==typeof e?e:e.source:null}const h=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const d="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",m={begin:"\\\\[\\s\\S]",relevance:0},y={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[m]},g={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[m]},v={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},b=function(e,t,n={}){const r=s({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(v),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},x=b("//","$"),w=b("/\\*","\\*/"),E=b("#","$"),_={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},j={className:"number",begin:d,relevance:0},S={className:"number",begin:"\\b(0b[01]+)",relevance:0},D={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},A={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[m,{begin:/\[/,end:/\]/,relevance:0,contains:[m]}]}]},k={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},C={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},P={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var T=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:d,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>f(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),s({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:m,APOS_STRING_MODE:y,QUOTE_STRING_MODE:g,PHRASAL_WORDS_MODE:v,COMMENT:b,C_LINE_COMMENT_MODE:x,C_BLOCK_COMMENT_MODE:w,HASH_COMMENT_MODE:E,NUMBER_MODE:_,C_NUMBER_MODE:j,BINARY_NUMBER_MODE:S,CSS_NUMBER_MODE:D,REGEXP_MODE:A,TITLE_MODE:k,UNDERSCORE_TITLE_MODE:C,METHOD_GUARD:P,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function $(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function O(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=$,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function F(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>f(e)).join("|")+")"}(...e.illegal))}function I(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function N(e,t){void 0===e.relevance&&(e.relevance=1)}const R=["of","and","for","in","not","or","if","then","parent","list","value"];function B(e,t){return t?Number(t):function(e){return R.includes(e.toLowerCase())}(e)?0:1}function M(e,{plugins:t}){function n(t,n){return new RegExp(f(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,t="|"){let n=0;return e.map(e=>{n+=1;const t=n;let r=f(e),i="";for(;r.length>0;){const e=h.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new r;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=s(e.classNameAliases||{}),function t(r,o){const a=r;if(r.isCompiled)return a;[I].forEach(e=>e(r,o)),e.compilerExtensions.forEach(e=>e(r,o)),r.__beforeBegin=null,[O,F,N].forEach(e=>e(r,o)),r.isCompiled=!0;let c=null;if("object"==typeof r.keywords&&(c=r.keywords.$pattern,delete r.keywords.$pattern),r.keywords&&(r.keywords=function e(t,n,r="keyword"){const i={};return"string"==typeof t?o(r,t.split(" ")):Array.isArray(t)?o(r,t):Object.keys(t).forEach((function(r){Object.assign(i,e(t[r],n,r))})),i;function o(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach((function(t){const n=t.split("|");i[n[0]]=[e,B(n[0],n[1])]}))}}(r.keywords,e.case_insensitive)),r.lexemes&&c)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return c=c||r.lexemes||/\w+/,a.keywordPatternRe=n(c,!0),o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=n(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(a.endRe=n(r.end)),a.terminatorEnd=f(r.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),r.illegal&&(a.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return s(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e))return s(e,{starts:e.starts?s(e.starts):null});if(Object.isFrozen(e))return s(e);return e}("self"===e?r:e)}))),r.contains.forEach((function(e){t(e,a)})),r.starts&&t(r.starts,o),a.matcher=function(e){const t=new i;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function L(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,a(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||(e=this.autodetect,Boolean(e||""===e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const z={"after:highlightElement":({el:e,result:t,text:n})=>{const r=q(e);if(!r.length)return;const i=document.createElement("div");i.innerHTML=t.value,t.value=function(e,t,n){let r=0,i="";const o=[];function s(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function u(e){i+=""}function l(e){("start"===e.event?c:u)(e.node)}for(;e.length||t.length;){let t=s();if(i+=a(n.substring(r,t[0].offset)),r=t[0].offset,t===e){o.reverse().forEach(u);do{l(t.splice(0,1)[0]),t=s()}while(t===e&&t.length&&t[0].offset===r);o.reverse().forEach(c)}else"start"===t[0].event?o.push(t[0].node):o.pop(),l(t.splice(0,1)[0])}return i+a(n.substr(r))}(r,q(i),n)}};function U(e){return e.nodeName.toLowerCase()}function q(e){const t=[];return function e(n,r){for(let i=n.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:r,node:i}),r=e(i,r),U(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:i}));return r}(e,0),t}const H={},V=e=>{console.error(e)},J=(e,...t)=>{console.log("WARN: "+e,...t)},K=(e,t)=>{H[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),H[`${e}/${t}`]=!0)},X=a,W=s,G=Symbol("nomatch");var Y=function(e){const t=Object.create(null),n=Object.create(null),i=[];let a=!0;const s=/(^(<[^>]+>|\t|)+|\n)/gm,c="Could not find the language '{}', did you forget to load/include a language module?",u={disableAutodetect:!0,name:"Plain text",contains:[]};let l={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:p};function f(e){return l.noHighlightRe.test(e)}function h(e,t,n,r){let i="",o="";"object"==typeof t?(i=e,n=t.ignoreIllegals,o=t.language,r=void 0):(K("10.7.0","highlight(lang, code, ...args) has been deprecated."),K("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,i=t);const a={code:i,language:o};D("before:highlight",a);const s=a.result?a.result:d(a.language,a.code,n,r);return s.code=a.code,D("after:highlight",s),s}function d(e,n,r,s){function u(e,t){const n=x.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function p(){null!=j.subLanguage?function(){if(""===A)return;let e=null;if("string"==typeof j.subLanguage){if(!t[j.subLanguage])return void D.addText(A);e=d(j.subLanguage,A,!0,S[j.subLanguage]),S[j.subLanguage]=e.top}else e=m(A,j.subLanguage.length?j.subLanguage:null);j.relevance>0&&(k+=e.relevance),D.addSublanguage(e.emitter,e.language)}():function(){if(!j.keywords)return void D.addText(A);let e=0;j.keywordPatternRe.lastIndex=0;let t=j.keywordPatternRe.exec(A),n="";for(;t;){n+=A.substring(e,t.index);const r=u(j,t);if(r){const[e,i]=r;if(D.addText(n),n="",k+=i,e.startsWith("_"))n+=t[0];else{const n=x.classNameAliases[e]||e;D.addKeyword(t[0],n)}}else n+=t[0];e=j.keywordPatternRe.lastIndex,t=j.keywordPatternRe.exec(A)}n+=A.substr(e),D.addText(n)}(),A=""}function f(e){return e.className&&D.openNode(x.classNameAliases[e.className]||e.className),j=Object.create(e,{parent:{value:j}}),j}function h(e){return 0===j.matcher.regexIndex?(A+=e[0],1):(T=!0,0)}function y(e){const t=e[0],n=e.rule,r=new o(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(e,r),r.isMatchIgnored))return h(t);return n&&n.endSameAsBegin&&(n.endRe=new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),n.skip?A+=t:(n.excludeBegin&&(A+=t),p(),n.returnBegin||n.excludeBegin||(A=t)),f(n),n.returnBegin?0:t.length}function g(e){const t=e[0],r=n.substr(e.index),i=function e(t,n,r){let i=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(t.endRe,r);if(i){if(t["on:end"]){const e=new o(t);t["on:end"](n,e),e.isMatchIgnored&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,r)}(j,e,r);if(!i)return G;const a=j;a.skip?A+=t:(a.returnEnd||a.excludeEnd||(A+=t),p(),a.excludeEnd&&(A=t));do{j.className&&D.closeNode(),j.skip||j.subLanguage||(k+=j.relevance),j=j.parent}while(j!==i.parent);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),f(i.starts)),a.returnEnd?0:t.length}let v={};function b(t,i){const o=i&&i[0];if(A+=t,null==o)return p(),0;if("begin"===v.type&&"end"===i.type&&v.index===i.index&&""===o){if(A+=n.slice(i.index,i.index+1),!a){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=i,"begin"===i.type)return y(i);if("illegal"===i.type&&!r){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(j.className||"")+'"');throw e.mode=j,e}if("end"===i.type){const e=g(i);if(e!==G)return e}if("illegal"===i.type&&""===o)return 1;if(P>1e5&&P>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return A+=o,o.length}const x=_(e);if(!x)throw V(c.replace("{}",e)),new Error('Unknown language: "'+e+'"');const w=M(x,{plugins:i});let E="",j=s||w;const S={},D=new l.__emitter(l);!function(){const e=[];for(let t=j;t!==x;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>D.openNode(e))}();let A="",k=0,C=0,P=0,T=!1;try{for(j.matcher.considerAll();;){P++,T?T=!1:j.matcher.considerAll(),j.matcher.lastIndex=C;const e=j.matcher.exec(n);if(!e)break;const t=b(n.substring(C,e.index),e);C=e.index+t}return b(n.substr(C)),D.closeAllNodes(),D.finalize(),E=D.toHTML(),{relevance:Math.floor(k),value:E,language:e,illegal:!1,emitter:D,top:j}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(C-100,C+100),mode:t.mode},sofar:E,relevance:0,value:X(n),emitter:D};if(a)return{illegal:!1,relevance:0,value:X(n),emitter:D,language:e,top:j,errorRaised:t};throw t}}function m(e,n){n=n||l.languages||Object.keys(t);const r=function(e){const t={relevance:0,emitter:new l.__emitter(l),value:X(e),illegal:!1,top:u};return t.emitter.addText(e),t}(e),i=n.filter(_).filter(S).map(t=>d(t,e,!1));i.unshift(r);const o=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(_(e.language).supersetOf===t.language)return 1;if(_(t.language).supersetOf===e.language)return-1}return 0}),[a,s]=o,c=a;return c.second_best=s,c}const y={"before:highlightElement":({el:e})=>{l.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"))},"after:highlightElement":({result:e})=>{l.useBR&&(e.value=e.value.replace(/\n/g,"
"))}},g=/^(<[^>]+>|\t)+/gm,v={"after:highlightElement":({result:e})=>{l.tabReplace&&(e.value=e.value.replace(g,e=>e.replace(/\t/g,l.tabReplace)))}};function b(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=l.languageDetectRe.exec(t);if(n){const t=_(n[1]);return t||(J(c.replace("{}",n[1])),J("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>f(e)||_(e))}(e);if(f(r))return;D("before:highlightElement",{el:e,language:r}),t=e;const i=t.textContent,o=r?h(i,{language:r,ignoreIllegals:!0}):m(i);D("after:highlightElement",{el:e,result:o,text:i}),e.innerHTML=o.value,function(e,t,r){const i=t?n[t]:r;e.classList.add("hljs"),i&&e.classList.add(i)}(e,r,o.language),e.result={language:o.language,re:o.relevance,relavance:o.relevance},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.relevance,relavance:o.second_best.relevance})}const x=()=>{if(x.called)return;x.called=!0,K("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(b)};let w=!1;function E(){if("loading"===document.readyState)return void(w=!0);document.querySelectorAll("pre code").forEach(b)}function _(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function j(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function S(e){const t=_(e);return t&&!t.disableAutodetect}function D(e,t){const n=e;i.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){w&&E()}),!1),Object.assign(e,{highlight:h,highlightAuto:m,highlightAll:E,fixMarkup:function(e){return K("10.2.0","fixMarkup will be removed entirely in v11.0"),K("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),t=e,l.tabReplace||l.useBR?t.replace(s,e=>"\n"===e?l.useBR?"
":e:l.tabReplace?e.replace(/\t/g,l.tabReplace):e):t;var t},highlightElement:b,highlightBlock:function(e){return K("10.7.0","highlightBlock will be removed entirely in v12.0"),K("10.7.0","Please use highlightElement now."),b(e)},configure:function(e){e.useBR&&(K("10.3.0","'useBR' will be removed entirely in v11.0"),K("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),l=W(l,e)},initHighlighting:x,initHighlightingOnLoad:function(){K("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),w=!0},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if(V("Language definition for '{}' could not be registered.".replace("{}",n)),!a)throw e;V(e),i=u}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&j(i.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:_,registerAliases:j,requireLanguage:function(e){K("10.4.0","requireLanguage will be removed entirely in v11."),K("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=_(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:S,inherit:W,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),i.push(e)},vuePlugin:L(e).VuePlugin}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="10.7.3";for(const e in T)"object"==typeof T[e]&&r(T[e]);return Object.assign(e,T),e.addPlugin(y),e.addPlugin(z),e.addPlugin(v),e}({});e.exports=Y},function(e,t,n){const{getMapValueOfType:r}=n(2),i=n(85),o={hasExternalDocs(){return!(!this._json.externalDocs||!Object.keys(this._json.externalDocs).length)},externalDocs(){return r(this._json,"externalDocs",i)}};e.exports=o},function(e,t,n){"use strict";(function(r){let i=/^win/.test(r.platform),o=/\//g,a=/^(\w{2,}):\/\//i,s=e.exports,c=/~1/g,u=/~0/g,l=[/\?/g,"%3F",/\#/g,"%23"],p=[/\%23/g,"#",/\%24/g,"$",/\%26/g,"&",/\%2C/g,",",/\%40/g,"@"];t.parse=n(69).parse,t.resolve=n(69).resolve,t.cwd=function(){if(r.browser)return location.href;let e=r.cwd(),t=e.slice(-1);return"/"===t||"\\"===t?e:e+"/"},t.getProtocol=function(e){let t=a.exec(e);if(t)return t[1].toLowerCase()},t.getExtension=function(e){let t=e.lastIndexOf(".");return t>=0?s.stripQuery(e.substr(t).toLowerCase()):""},t.stripQuery=function(e){let t=e.indexOf("?");return t>=0&&(e=e.substr(0,t)),e},t.getHash=function(e){let t=e.indexOf("#");return t>=0?e.substr(t):"#"},t.stripHash=function(e){let t=e.indexOf("#");return t>=0&&(e=e.substr(0,t)),e},t.isHttp=function(e){let t=s.getProtocol(e);return"http"===t||"https"===t||void 0===t&&r.browser},t.isFileSystemPath=function(e){if(r.browser)return!1;let t=s.getProtocol(e);return void 0===t||"file"===t},t.fromFileSystemPath=function(e){i&&(e=e.replace(/\\/g,"/")),e=encodeURI(e);for(let t=0;tdecodeURIComponent(e).replace(c,"/").replace(u,"~"))}}).call(this,n(14))},function(e,t,n){"use strict";const{Ono:r}=n(28),{stripHash:i,toFileSystemPath:o}=n(18),a=t.JSONParserError=class extends Error{constructor(e,t){super(),this.code="EUNKNOWN",this.message=e,this.source=t,this.path=null,r.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};c(a);const s=t.JSONParserErrorGroup=class e extends Error{constructor(e){super(),this.files=e,this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${o(e.$refs._root$Ref.path)}'`,r.extend(this)}static getParserErrors(e){const t=[];for(const n of Object.values(e.$refs._$refs))n.errors&&t.push(...n.errors);return t}get errors(){return e.getParserErrors(this.files)}};c(s);c(t.ParserError=class extends a{constructor(e,t){super(`Error parsing ${t}: ${e}`,t),this.code="EPARSER"}});c(t.UnmatchedParserError=class extends a{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER"}});c(t.ResolverError=class extends a{constructor(e,t){super(e.message||`Error reading file "${t}"`,t),this.code="ERESOLVER","code"in e&&(this.ioErrorCode=String(e.code))}});c(t.UnmatchedResolverError=class extends a{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER"}});c(t.MissingPointerError=class extends a{constructor(e,t){super(`Token "${e}" does not exist.`,i(t)),this.code="EMISSINGPOINTER"}});function c(e){Object.defineProperty(e.prototype,"name",{value:e.name,enumerable:!0})}c(t.InvalidPointerError=class extends a{constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,i(t)),this.code="EINVALIDPOINTER"}}),t.isHandledError=function(e){return e instanceof a||e instanceof s},t.normalizeError=function(e){return null===e.path&&(e.path=[]),e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));const r=/\r?\n/,i=/\bono[ @]/;function o(e,t){let n=s(e.stack),r=t?t.stack:void 0;return n&&r?n+"\n\n"+r:n||r}function a(e,t,n){n?Object.defineProperty(t,"stack",{get:()=>o({stack:e.get.apply(t)},n),enumerable:!1,configurable:!0}):function(e,t){Object.defineProperty(e,"stack",{get:()=>s(t.get.apply(e)),enumerable:!1,configurable:!0})}(t,e)}function s(e){if(e){let t,n=e.split(r);for(let e=0;e0)return n.join("\n")}return e}const c=["function","symbol","undefined"],u=["constructor","prototype","__proto__"],l=Object.getPrototypeOf({});function p(){let e={},t=this;for(let n of f(t))if("string"==typeof n){let r=t[n],i=typeof r;c.includes(i)||(e[n]=r)}return e}function f(e,t=[]){let n=[];for(;e&&e!==l;)n=n.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let r=new Set(n);for(let e of t.concat(u))r.delete(e);return r}const h=["name","message","stack"];function d(e,t,n){let r=e;return function(e,t){let n=Object.getOwnPropertyDescriptor(e,"stack");!function(e){return Boolean(e&&e.configurable&&"function"==typeof e.get)}(n)?function(e){return Boolean(!e||e.writable||"function"==typeof e.set)}(n)&&(e.stack=o(e,t)):a(n,e,t)}(r,t),t&&"object"==typeof t&&function(e,t){let n=f(t,h),r=e,i=t;for(let e of n)if(void 0===r[e])try{r[e]=i[e]}catch(e){}}(r,t),r.toJSON=p,n&&"object"==typeof n&&Object.assign(r,n),r}const m=y;function y(e,t){function n(...n){let{originalError:r,props:i,message:o}=function(e,t){let n,r,i,o="";return"string"==typeof e[0]?i=e:"string"==typeof e[1]?(e[0]instanceof Error?n=e[0]:r=e[0],i=e.slice(1)):(n=e[0],r=e[1],i=e.slice(2)),i.length>0&&(o=t.format?t.format.apply(void 0,i):i.join(" ")),t.concatMessages&&n&&n.message&&(o+=(o?" \n":"")+n.message),{originalError:n,props:r,message:o}}(n,t);return d(new e(o),r,i)}return t=function(e){return{concatMessages:void 0===(e=e||{}).concatMessages||Boolean(e.concatMessages),format:void 0!==e.format&&("function"==typeof e.format&&e.format)}}(t),n[Symbol.species]=e,n}y.toJSON=function(e){return p.call(e)},y.extend=function(e,t,n){return n||t instanceof Error?d(e,t,n):t?d(e,void 0,t):d(e)}},function(e,t,n){const{getMapValueByKey:r}=n(2),i={hasBindings(){return!(!this._json.bindings||!Object.keys(this._json.bindings).length)},bindings(){return this.hasBindings()?this._json.bindings:{}},bindingProtocols(){return Object.keys(this.bindings())},hasBinding(e){return this.hasBindings()&&!!this._json.bindings[String(e)]},binding(e){return r(this._json.bindings,e)}};e.exports=i},function(e,t,n){const r=n(84),i={hasTags(){return!(!Array.isArray(this._json.tags)||!this._json.tags.length)},tags(){return this.hasTags()?this._json.tags.map(e=>new r(e)):[]},tagNames(){return this.hasTags()?this._json.tags.map(e=>e.name):[]},hasTag(e){return this.hasTags()&&this._json.tags.some(t=>t.name===e)},tag(e){const t=this.hasTags()&&this._json.tags.find(t=>t.name===e);return t?new r(t):null}};e.exports=i},function(e,t,n){(function(e){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),c=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&t._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),l(r,e,r.depth)}function c(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function u(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&_(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return g(i)||(i=l(e,i,r)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(g(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(y(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),E(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(n);if(0===a.length){if(_(n)){var c=n.name?": "+n.name:"";return e.stylize("[Function"+c+"]","special")}if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(w(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return p(n)}var u,x="",j=!1,S=["{","}"];(h(n)&&(j=!0,S=["[","]"]),_(n))&&(x=" [Function"+(n.name?": "+n.name:"")+"]");return b(n)&&(x=" "+RegExp.prototype.toString.call(n)),w(n)&&(x=" "+Date.prototype.toUTCString.call(n)),E(n)&&(x=" "+p(n)),0!==a.length||j&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=j?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,x,S)):S[0]+x+S[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),k(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=m(n)?l(e,c.value,null):l(e,c.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function m(e){return null===e}function y(e){return"number"==typeof e}function g(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return x(e)&&"[object RegExp]"===j(e)}function x(e){return"object"==typeof e&&null!==e}function w(e){return x(e)&&"[object Date]"===j(e)}function E(e){return x(e)&&("[object Error]"===j(e)||e instanceof Error)}function _(e){return"function"==typeof e}function j(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(v(o)&&(o=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=e.pid;a[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else a[n]=function(){};return a[n]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=d,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=x,t.isDate=w,t.isError=E,t.isFunction=_,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(185);var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),D[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",A(),t.format.apply(t,arguments))},t.inherits=n(186),t._extend=function(e,t){if(!t||!x(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(C&&e[C]){var t;if("function"!=typeof(t=e[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),i=[],o=0;o{const n=this.channel(t);n.hasPublish()&&n.publish().messages().forEach(t=>{e.set(t.uid(),t)}),n.hasSubscribe()&&n.subscribe().messages().forEach(t=>{e.set(t.uid(),t)})}),this.hasComponents()&&Object.values(this.components().messages()).forEach(t=>{e.set(t.uid(),t)}),e}allSchemas(){const e=new Map;return _(this,t=>{t.uid()&&e.set(t.uid(),t)}),e}hasCircular(){return!!this._json[String(y)]}traverseSchemas(e,t){_(this,e,t)}static stringify(e,t){const n={...e.json()};return n[String(m)]=!0,JSON.stringify(n,function(){const e=new Map,t=new Map;let n=null;return function(r,i){const o=e.get(this)+(Array.isArray(this)?`[${r}]`:"."+r),a=i===Object(i);a&&e.set(i,o);const s=t.get(i)||"";if(!s&&a){const e=o.replace(/undefined\.\.?/,"");t.set(i,e)}const c="["===s[0]?"$":"$.";let u=s?`$ref:${c}${s}`:i;return null===n?n=i:u===n&&(u="$ref:$"),u}}(),t)}static parse(e){let t=e;if("string"==typeof e?t=JSON.parse(e):"object"==typeof e&&(t={...t}),"object"!=typeof t||!t[String(d)])throw new Error("Cannot parse invalid AsyncAPI document");if(!t[String(m)])return new j(t);delete t[String(m)];return function e(t,n,r,i,o){let a=t,s="$ref:$";if(void 0!==n){a=t[String(n)];const e=n?"."+n:"";s=i.get(t)+(Array.isArray(t)?`[${n}]`:e)}i.set(a,s),o.set(s,a);const c=o.get(a);c&&(t[String(n)]=c);"$ref:$"!==a&&"$ref:$"!==c||(t[String(n)]=r);if(a===Object(a))for(const t in a)e(a,t,r,i,o)}(t,void 0,t,new Map,new Map),new j(t)}}e.exports=o(j,f,p,h)},function(e,t){const n=(e,t)=>(t.type=e.type.startsWith("https://github.com/asyncapi/parser-js/")?e.type:"https://github.com/asyncapi/parser-js/"+e.type,t.title=e.title,e.detail&&(t.detail=e.detail),e.validationErrors&&(t.validationErrors=e.validationErrors),e.parsedJSON&&(t.parsedJSON=e.parsedJSON),e.location&&(t.location=e.location),e.refs&&(t.refs=e.refs),t);class r extends Error{constructor(e){super(),n(e,this),this.message=e.title}toJS(){return n(this,{})}}e.exports=r},function(e,t){e.exports={xParserSpecParsed:"x-parser-spec-parsed",xParserSpecStringified:"x-parser-spec-stringified",xParserMessageName:"x-parser-message-name",xParserSchemaId:"x-parser-schema-id",xParserCircle:"x-parser-circular",xParserCircleProps:"x-parser-circular-props"}},function(e,t,n){"use strict";n.r(t),function(e){var r=n(104);n.d(t,"ono",(function(){return r.a}));var i=n(20);n.d(t,"Ono",(function(){return i.a}));n(116);t.default=r.a,"object"==typeof e.exports&&(e.exports=Object.assign(e.exports.default,e.exports))}.call(this,n(184)(e))},function(e,t,n){"use strict";var r=n(70),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=p;var o=Object.create(n(55));o.inherits=n(24);var a=n(122),s=n(99);o.inherits(p,a);for(var c=i(s.prototype),u=0;u1)||(this._json.message,!1)}traits(){const e=this._json["x-parser-original-traits"]||this._json.traits;return e?e.map(e=>new o(e)):[]}hasTraits(){return!!this._json["x-parser-original-traits"]||!!this._json.traits}messages(){return this._json.message?this._json.message.oneOf?this._json.message.oneOf.map(e=>new i(e)):[new i(this._json.message)]:[]}message(e){return this._json.message?this._json.message.oneOf&&1===this._json.message.oneOf.length?new i(this._json.message.oneOf[0]):this._json.message.oneOf?"number"!=typeof e||e>this._json.message.oneOf.length-1?null:new i(this._json.message.oneOf[+e]):new i(this._json.message):null}security(){return this._json.security?this._json.security.map(e=>new a(e)):null}}},function(e,t,n){"use strict";function r(e,t,n,r){var i=r?" !== ":" === ",o=r?" || ":" && ",a=r?"!":"",s=r?"":"!";switch(e){case"null":return t+i+"null";case"array":return a+"Array.isArray("+t+")";case"object":return"("+a+t+o+"typeof "+t+i+'"object"'+o+s+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+i+'"number"'+o+s+"("+t+" % 1)"+o+t+i+t+(n?o+a+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+i+'"'+e+'"'+(n?o+a+"isFinite("+t+")":"")+")";default:return"typeof "+t+i+'"'+e+'"'}}e.exports={copy:function(e,t){for(var n in t=t||{},e)t[n]=e[n];return t},checkDataType:r,checkDataTypes:function(e,t,n){switch(e.length){case 1:return r(e[0],t,n,!0);default:var i="",a=o(e);for(var s in a.array&&a.object&&(i=a.null?"(":"(!"+t+" || ",i+="typeof "+t+' !== "object")',delete a.null,delete a.array,delete a.object),a.number&&delete a.integer,a)i+=(i?" && ":"")+r(s,t,n,!0);return i}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var n=[],r=0;r=t)throw new Error("Cannot access property/index "+r+" levels up, current level is "+t);return n[t-r]}if(r>t)throw new Error("Cannot access data "+r+" levels up, current level is "+t);if(o="data"+(t-r||""),!i)return o}for(var s=o,u=i.split("/"),l=0;lt?l(e):(this._pos+e>t&&(this._slab=l(t),this._pos=0),this._slab.slice(this._pos,this._pos+=e))},m.prototype.nextBoolean=function(){return!!(this._nextInt()%2)},m.prototype.nextInt=function(e,t){return void 0===t&&(t=e,e=0),t=void 0===t?this._max:t,e+Math.floor(this.nextFloat()*(t-e))},m.prototype.nextFloat=function(e,t){return void 0===t&&(t=e,e=0),e+((t=void 0===t?1:t)-e)*this._nextInt()/this._max},m.prototype.nextString=function(e,t){e|=0;var n="";(t=t||"aA").indexOf("a")>-1&&(n+="abcdefghijklmnopqrstuvwxyz"),t.indexOf("A")>-1&&(n+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.indexOf("#")>-1&&(n+="0123456789"),t.indexOf("!")>-1&&(n+="~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\");for(var r=[],i=0;i0&&n[r].index>1].index;)e=n[r],n[r]=n[t],n[t]=e,r=t},y.prototype.pop=function(){var e=this._items,t=e.length-1|0,n=e[0];if(!n||n.index>this._index)return null;if(this._index++,!t)return e.pop(),n;e[0]=e.pop();for(var r,i,o,a,s,c,u,l=t>>1,p=0;p=a.index));)e[o]=a,e[p]=s,p=o;return n},g.prototype.isValid=function(){return this.pos<=this.buf.length},g.prototype._invalidate=function(){this.pos=this.buf.length+1},g.prototype.readBoolean=function(){return!!this.buf[this.pos++]},g.prototype.skipBoolean=function(){this.pos++},g.prototype.writeBoolean=function(e){this.buf[this.pos++]=!!e},g.prototype.readInt=g.prototype.readLong=function(){var e,t,n,r,i=0,o=0,a=this.buf;do{t=128&(e=a[this.pos++]),i|=(127&e)<>1^-(1&i)},g.prototype.skipInt=g.prototype.skipLong=function(){for(var e=this.buf;128&e[this.pos++];);},g.prototype.writeInt=g.prototype.writeLong=function(e){var t,n,r=this.buf;if(e>=-1073741824&&e<1073741824){n=e>=0?e<<1:~e<<1|1;do{r[this.pos]=127&n,n>>=7}while(n&&(r[this.pos++]|=128))}else{t=e>=0?2*e:2*-e-1;do{r[this.pos]=127&t,t/=128}while(t>=1&&(r[this.pos++]|=128))}this.pos++},g.prototype.readFloat=function(){var e=this.buf,t=this.pos;return this.pos+=4,this.pos>e.length?0:this.buf.readFloatLE(t)},g.prototype.skipFloat=function(){this.pos+=4},g.prototype.writeFloat=function(e){var t=this.buf,n=this.pos;if(this.pos+=4,!(this.pos>t.length))return this.buf.writeFloatLE(e,n)},g.prototype.readDouble=function(){var e=this.buf,t=this.pos;return this.pos+=8,this.pos>e.length?0:this.buf.readDoubleLE(t)},g.prototype.skipDouble=function(){this.pos+=8},g.prototype.writeDouble=function(e){var t=this.buf,n=this.pos;if(this.pos+=8,!(this.pos>t.length))return this.buf.writeDoubleLE(e,n)},g.prototype.readFixed=function(e){var t=this.pos;if(this.pos+=e,!(this.pos>this.buf.length)){var n=s.alloc(e);return this.buf.copy(n,0,t,t+e),n}},g.prototype.skipFixed=function(e){this.pos+=e},g.prototype.writeFixed=function(e,t){t=t||e.length;var n=this.pos;this.pos+=t,this.pos>this.buf.length||e.copy(this.buf,n,0,t)},g.prototype.readBytes=function(){var e=this.readLong();if(!(e<0))return this.readFixed(e);this._invalidate()},g.prototype.skipBytes=function(){var e=this.readLong();e<0?this._invalidate():this.pos+=e},g.prototype.writeBytes=function(e){var t=e.length;this.writeLong(t),this.writeFixed(e,t)},"function"==typeof a.prototype.utf8Slice?g.prototype.readString=function(){var e=this.readLong();if(e<0)return this._invalidate(),"";var t=this.pos,n=this.buf;return this.pos+=e,this.pos>n.length?void 0:this.buf.utf8Slice(t,t+e)}:g.prototype.readString=function(){var e=this.readLong();if(e<0)return this._invalidate(),"";var t=this.pos,n=this.buf;return this.pos+=e,this.pos>n.length?void 0:this.buf.slice(t,t+e).toString()},g.prototype.skipString=function(){var e=this.readLong();e<0?this._invalidate():this.pos+=e},g.prototype.writeString=function(e){var t=a.byteLength(e),n=this.buf;this.writeLong(t);var r,i,o,s,c=this.pos;if(this.pos+=t,!(this.pos>n.length))if(t>64&&"function"==typeof a.prototype.utf8Write)n.utf8Write(e,c,t);else for(r=0,i=t;r>6|192,n[c++]=63&o|128):55296==(64512&o)&&56320==(64512&(s=e.charCodeAt(r+1)))?(o=65536+((1023&o)<<10)+(1023&s),r++,n[c++]=o>>18|240,n[c++]=o>>12&63|128,n[c++]=o>>6&63|128,n[c++]=63&o|128):(n[c++]=o>>12|224,n[c++]=o>>6&63|128,n[c++]=63&o|128)},"function"==typeof a.prototype.latin1Write?g.prototype.writeBinary=function(e,t){var n=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.latin1Write(e,n,t)}:"function"==typeof a.prototype.binaryWrite?g.prototype.writeBinary=function(e,t){var n=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.binaryWrite(e,n,t)}:g.prototype.writeBinary=function(e,t){var n=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.write(e,n,t,"binary")},g.prototype.matchBoolean=function(e){return this.buf[this.pos++]-e.buf[e.pos++]},g.prototype.matchInt=g.prototype.matchLong=function(e){var t=this.readLong(),n=e.readLong();return t===n?0:t>1;128&e;)r|=(127&(e=a[this.pos++]))<=8&&(o-=8,n[i++]=r,r>>=8);return n[i]=r,t&&v(n,8),n},g.prototype.packLongBytes=function(e){var t,n=(128&e[7])>>7,r=this.buf,i=1,o=0,a=3;n?(v(e,8),t=1):t=0;for(var s=[e.readUIntLE(0,3),e.readUIntLE(3,3),e.readUIntLE(6,2)];a&&!s[--a];);for(;o7;)r[this.pos++]=127&t|128,t>>=7,i-=7;t|=s[a]<>=7}while(t&&(r[this.pos++]|=128));this.pos++,n&&v(e,8)},e.exports={abstractFunction:function(){throw new Error("abstract")},addDeprecatedGetters:function(e,t){var n,r,i,a,s=e.prototype;for(n=0,r=t.length;n=0)return-2;i=n}return i},hasDuplicates:function(e,t){var n,r,i,o=Object.create(null);for(n=0,r=e.length;n0&&i.a.createElement("li",{className:"mb-3 mt-9"},i.a.createElement("a",{className:"text-xs uppercase text-gray-700 mt-10 mb-4 font-thin hover:text-gray-900",href:"#messages",onClick:function(){return n(!1)}},"Messages"),i.a.createElement("ul",{className:"text-sm mt-2"},Object.entries(u).map((function(e){var t=e[0],r=e[1];return i.a.createElement("li",{key:t},i.a.createElement("a",{className:"flex break-words no-underline text-gray-700 mt-2 hover:text-gray-900",href:"#message-".concat(t),onClick:function(){return n(!1)}},i.a.createElement("div",{className:"break-all inline-block"},r.uid())))})))),h=l&&Object.keys(l).length>0&&i.a.createElement("li",{className:"mb-3 mt-9"},i.a.createElement("a",{className:"text-xs uppercase text-gray-700 mt-10 mb-4 font-thin hover:text-gray-900",href:"#schemas",onClick:function(){return n(!1)}},"Schemas"),i.a.createElement("ul",{className:"text-sm mt-2"},Object.keys(l).map((function(e){return i.a.createElement("li",{key:e},i.a.createElement("a",{className:"flex break-words no-underline text-gray-700 mt-2 hover:text-gray-900",href:"#schema-".concat(e),onClick:function(){return n(!1)}},i.a.createElement("div",{className:"break-all inline-block"},e)))}))));return i.a.createElement(b.Provider,{value:{setShowSidebar:n}},i.a.createElement("div",{className:"burger-menu rounded-full h-16 w-16 bg-white fixed bottom-16 right-8 flex items-center justify-center z-30 cursor-pointer shadow-md bg-teal-500",onClick:function(){return n((function(e){return!e}))},"data-lol":t},i.a.createElement("svg",{viewBox:"0 0 100 70",width:"40",height:"30",className:"fill-current text-gray-200"},i.a.createElement("rect",{width:"100",height:"10"}),i.a.createElement("rect",{y:"30",width:"100",height:"10"}),i.a.createElement("rect",{y:"60",width:"100",height:"10"}))),i.a.createElement("div",{className:"".concat(t?"block fixed w-full":"hidden"," sidebar relative w-64 max-h-screen h-full bg-gray-200 shadow z-20")},i.a.createElement("div",{className:"".concat(t?"w-full":""," block fixed max-h-screen h-full font-sans px-4 pt-8 pb-16 overflow-y-auto bg-gray-200")},i.a.createElement("div",{className:"sidebar--content"},i.a.createElement("div",null,s?i.a.createElement("img",{src:s,alt:"".concat(a.title()," logo, ").concat(a.version()," version")}):i.a.createElement("h1",{className:"text-2xl font-light"},a.title()," ",a.version())),i.a.createElement("ul",{className:"text-sm mt-10 relative"},i.a.createElement("li",{className:"mb-3"},i.a.createElement("a",{className:"text-gray-700 no-underline hover:text-gray-900",href:"#introduction",onClick:function(){return n(!1)}},"Introduction")),o.hasServers()&&i.a.createElement("li",{className:"mb-3 mt-9"},i.a.createElement("a",{className:"text-xs uppercase text-gray-700 mt-10 mb-4 font-thin hover:text-gray-900",href:"#servers",onClick:function(){return n(!1)}},"Servers"),i.a.createElement(E,null)),p&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",{className:"mb-3 mt-9"},i.a.createElement("a",{className:"text-xs uppercase text-gray-700 mt-10 mb-4 font-thin hover:text-gray-900",href:"#operations",onClick:function(){return n(!1)}},"Operations"),i.a.createElement(_,null)),f,h))))))};function w(e,t){var n=new Set,r=new Map;e.forEach((function(e){var i=[];t.forEach((function(t){var r=t.object;"function"==typeof r.tags&&((r.tags()||[]).map((function(e){return e.name()})).includes(e)&&(i.push(t),n.add(t)))})),r.set(e,i)}));var i=[];return t.forEach((function(e){n.has(e)||i.push(e)})),{tagged:r,untagged:i}}var E=function(){var e,t=g().sidebar,n=m(),r=n.servers(),o=(null==t?void 0:t.showServers)||"byDefault";if("byDefault"===o)return i.a.createElement("ul",{className:"text-sm mt-2"},Object.keys(r).map((function(e){return i.a.createElement(S,{serverName:e,key:e})})));if("bySpecTags"===o)e=(n.tags()||[]).map((function(e){return e.name()}));else{var a=new Set;Object.values(r).forEach((function(e){"function"==typeof e.tags&&e.tags().forEach((function(e){return a.add(e.name())}))})),e=Array.from(a)}var s=w(e,Object.entries(r).map((function(e){return{name:e[0],object:e[1],data:{}}}))),c=s.tagged,u=s.untagged;return i.a.createElement("ul",{className:"text-sm mt-2"},Array.from(c.entries()).map((function(e){var t=e[0],n=e[1];return i.a.createElement("li",{key:t},i.a.createElement(D,{tagName:t},n.map((function(e){var t=e.name;return i.a.createElement(S,{serverName:t,key:t})}))))})),u.length>0?i.a.createElement("li",null,i.a.createElement(D,{tagName:"Untagged"},u.map((function(e){var t=e.name;return i.a.createElement(S,{serverName:t,key:t})})))):null)},_=function(){var e,t=g().sidebar,n=m(),r=n.channels(),o=(null==t?void 0:t.showOperations)||"byDefault",a=[];if(Object.entries(r).forEach((function(e){var t=e[0],n=e[1];if(n.hasPublish()){var r=n.publish();a.push({name:"publish-".concat(t),object:r,data:{channelName:t,kind:"publish",summary:r.summary()}})}if(n.hasSubscribe()){r=n.subscribe();a.push({name:"subscribe-".concat(t),object:r,data:{channelName:t,kind:"subscribe",summary:r.summary()}})}})),"byDefault"===o)return i.a.createElement("ul",{className:"text-sm mt-2"},a.map((function(e){var t=e.name,n=e.data;return i.a.createElement(j,v({key:t},n))})));if("bySpecTags"===o)e=(n.tags()||[]).map((function(e){return e.name()}));else{var s=new Set;Object.values(a).forEach((function(e){var t=e.object;"function"==typeof t.tags&&t.tags().forEach((function(e){return s.add(e.name())}))})),e=Array.from(s)}var c=w(e,a),u=c.tagged,l=c.untagged;return i.a.createElement("ul",{className:"text-sm mt-2"},Array.from(u.entries()).map((function(e){var t=e[0],n=e[1];return i.a.createElement("li",{key:t},i.a.createElement(D,{tagName:t},n.map((function(e){var t=e.name,n=e.data;return i.a.createElement(j,v({key:t},n))}))))})),l.length>0?i.a.createElement("li",null,i.a.createElement(D,{tagName:"Untagged"},l.map((function(e){var t=e.name,n=e.data;return i.a.createElement(j,v({key:t},n))})))):null)},j=function(e){var t=e.channelName,n=e.summary,o=e.kind,s=g(),c=Object(r.useContext)(b).setShowSidebar,u="publish"===o,l="";return l=u?s.publishLabel||a.f:s.subscribeLabel||a.i,i.a.createElement("li",null,i.a.createElement("a",{className:"flex no-underline text-gray-700 mb-2 hover:text-gray-900",href:"#operation-".concat(o,"-").concat(t),onClick:function(){return c(!1)}},i.a.createElement("span",{className:"".concat(u?"bg-blue-600":"bg-green-600"," font-bold h-6 no-underline text-white uppercase p-1 mr-2 rounded text-xs"),title:u?"Publish":"Subscribe"},l),i.a.createElement("span",{className:"break-all inline-block"},n||t)))},S=function(e){var t=e.serverName,n=Object(r.useContext)(b).setShowSidebar;return i.a.createElement("li",null,i.a.createElement("a",{className:"flex no-underline text-gray-700 mb-2 hover:text-gray-900",href:"#server-".concat(t),onClick:function(){return n(!1)}},i.a.createElement("span",{className:"break-all inline-block"},t)))},D=function(e){var t=e.tagName,n=e.children,o=Object(r.useState)(!1),a=o[0],s=o[1];return i.a.createElement("div",null,i.a.createElement(h,{onClick:function(){return s((function(e){return!e}))},chevronProps:{className:a?"-rotate-180":"-rotate-90"}},i.a.createElement("span",{className:"text-sm inline-block mt-1 font-extralight"},t)),i.a.createElement("ul",{className:"".concat(a?"block":"hidden"," text-sm mt-2 font-light")},n))},A=function(e){var t=e.href,n=e.title,r=e.className,o=e.children;return i.a.createElement("a",{href:t,title:n,className:r,target:"_blank",rel:"nofollow noopener noreferrer"},o)},k=n(60),C=n(61),P=n(16),T=n.n(P),$=n(62),O=n.n($),F=n(63),I=n.n(F),N=n(64),R=n.n(N);T.a.registerLanguage("json",O.a),T.a.registerLanguage("yaml",I.a),T.a.registerLanguage("bash",R.a);var B={langPrefix:"hljs language-",highlight:function(e,t){if(!T.a.getLanguage(t))return e;try{return T.a.highlight(e,{language:t}).value}catch(t){return e}}};var M=function(e){var t,n=e.children;return n?"string"!=typeof n?i.a.createElement(i.a.Fragment,null,n):i.a.createElement("div",{className:"prose max-w-none text-sm",dangerouslySetInnerHTML:{__html:Object(k.sanitize)((t=n,Object(C.marked)(t,B)))}}):null},L=function(e){var t=e.tag,n="#".concat(t.name()),r=t.description()||"",o=t.externalDocs(),a=i.a.createElement("div",{title:r,className:"border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 font-bold no-underline text-xs rounded px-3 py-1"},i.a.createElement("span",{className:o?"underline":""},n));return o?i.a.createElement(A,{href:o.url(),title:r},a):a},z=function(e){var t=e.tags;return t&&t.length?i.a.createElement("ul",{className:"flex flex-wrap leading-normal"},t.map((function(e){return i.a.createElement("li",{className:"inline-block mt-2 mr-2",key:e.name()},i.a.createElement(L,{tag:e}))}))):null},U=function(){var e=m(),t=e.info();if(!t)return null;var n=e.id(),r=e.externalDocs(),o=t.license(),s=t.termsOfService(),c=e.defaultContentType(),u=t.contact(),l=o||s||c||u||r;return i.a.createElement("div",{className:"panel-item"},i.a.createElement("div",{className:"panel-item--center px-8 text-left",id:"introduction"},i.a.createElement("div",{className:"text-4xl"},t.title()," ",t.version()),l&&i.a.createElement("ul",{className:"flex flex-wrap mt-2 leading-normal"},o&&i.a.createElement("li",{className:"inline-block mt-2 mr-2"},o.url()?i.a.createElement(A,{className:"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-3 py-1",href:o.url()},i.a.createElement("span",null,o.name())):i.a.createElement("span",{className:"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-3 py-1"},o.name())),s&&i.a.createElement("li",{className:"inline-block mt-2 mr-2"},i.a.createElement(A,{className:"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-3 py-1",href:s},i.a.createElement("span",null,a.j))),c&&i.a.createElement("li",{className:"inline-block mt-2 mr-2"},i.a.createElement(A,{className:"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-3 py-1",href:"".concat(a.a,"/").concat(c)},i.a.createElement("span",null,c))),r&&i.a.createElement("li",{className:"inline-block mt-2 mr-2"},i.a.createElement(A,{className:"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-3 py-1",href:r.url()},i.a.createElement("span",null,a.c))),u&&i.a.createElement(i.a.Fragment,null,u.url()&&i.a.createElement("li",{className:"inline-block mt-2 mr-2"},i.a.createElement(A,{className:"border border-solid border-purple-300 hover:bg-purple-300 hover:text-purple-600 text-purple-500 font-bold no-underline text-xs uppercase rounded px-3 py-1",href:u.url()},i.a.createElement("span",null,u.name()||a.k))),u.email()&&i.a.createElement("li",{className:"inline-block mt-2 mr-2"},i.a.createElement(A,{className:"border border-solid border-purple-300 hover:bg-purple-300 hover:text-purple-600 text-purple-500 font-bold no-underline text-xs uppercase rounded px-3 py-1",href:"mailto:".concat(u.email())},i.a.createElement("span",null,u.email())))),n&&i.a.createElement("li",{className:"inline-block mt-2 mr-2"},i.a.createElement("span",{className:"border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 font-bold no-underline text-xs uppercase rounded px-3 py-1"},"ID: ",n))),t.hasDescription()&&i.a.createElement("div",{className:"mt-4"},i.a.createElement(M,null,t.description())),e.hasTags()&&i.a.createElement("div",{className:"mt-4"},i.a.createElement(z,{tags:e.tags()}))),i.a.createElement("div",{className:"panel-item--right"}))},q=function(){function e(){}return e.securityType=function(e){switch(e){case"apiKey":return"API key";case"oauth2":return"OAuth2";case"openIdConnect":return"Open ID";case"http":return"HTTP";case"userPassword":return"User/Password";case"X509":return"X509:";case"symmetricEncryption":return"Symmetric Encription";case"asymmetricEncryption":return"Asymmetric Encription";case"httpApiKey":return"HTTP API key";case"scramSha256":return"ScramSha256";case"scramSha512":return"ScramSha512";case"gssapi":return"GSSAPI";default:return"API key"}},e.flowName=function(e){switch(e){case"implicit":return"Implicit";case"password":return"Password";case"clientCredentials":return"Client credentials";case"authorizationCode":return"Authorization Code";default:return"Implicit"}},e.getKafkaSecurity=function(e,t){var n,r;if(n="kafka"===e?t?"SASL_PLAINTEXT":"PLAINTEXT":t?"SASL_SSL":"SSL",t)switch(t.type()){case"plain":r="PLAIN";break;case"scramSha256":r="SCRAM-SHA-256";break;case"scramSha512":r="SCRAM-SHA-512";break;case"oauth2":r="OAUTHBEARER";break;case"gssapi":r="GSSAPI";break;case"X509":n="SSL"}return{securityProtocol:n,saslMechanism:r}},e}(),H=function(e){var t,n=e.security,r=void 0===n?[]:n,o=e.protocol,a=void 0===o?"":o,s=e.header,c=void 0===s?"Security":s,u=m(),l=u.hasComponents()&&u.components().securitySchemes();if(r&&r.length&&l&&Object.keys(l).length){var p=r.map((function(e){var t=e.json(),n=Object.keys(t)[0],r=l[String(n)],o=t[String(n)];return r?i.a.createElement(J,{protocol:a,securitySchema:r,requiredScopes:o,key:r.type()}):null})).filter(Boolean);t=i.a.createElement("ul",null,p.map((function(e,t){return i.a.createElement("li",{className:"mt-2",key:t},e)})))}else"kafka"!==a&&"kafka-secure"!==a||(t=i.a.createElement(J,{protocol:a,securitySchema:null}));return t?i.a.createElement("div",{className:"text-sm mt-4"},i.a.createElement("h5",{className:"text-gray-800"},c,":"),t):null};var V,J=function(e){var t,n=e.securitySchema,r=e.protocol,o=function(e,t){void 0===t&&(t=[]);var n=[];return e&&(e.name()&&n.push(i.a.createElement("span",null,"Name: ",e.name())),e.in()&&n.push(i.a.createElement("span",null,"In: ",e.in())),e.scheme()&&n.push(i.a.createElement("span",null,"Scheme: ",e.scheme())),e.bearerFormat()&&n.push(i.a.createElement("span",null,"Bearer format: ",e.bearerFormat())),e.openIdConnectUrl()&&n.push(i.a.createElement(A,{href:e.openIdConnectUrl(),className:"underline"},"Connect URL")),t.length&&n.push(i.a.createElement("span",null,"Required scopes: ",t.join(", ")))),n}(n,e.requiredScopes);if(["kafka","kafka-secure"].includes(r)){var a=q.getKafkaSecurity(r,n),s=a.securityProtocol,c=a.saslMechanism;t=i.a.createElement("div",{className:"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded"},s&&i.a.createElement("div",{className:"mt-1"},i.a.createElement("span",{className:"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase"},"security.protocol:"),i.a.createElement("span",{className:"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1"},s)),c&&i.a.createElement("div",{className:"mt-1"},i.a.createElement("span",{className:"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase"},"sasl.mechanism:"),i.a.createElement("span",{className:"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1"},c)))}var u=n&&n.flows(),l=u&&Object.entries(u).map((function(e){var t=e[0],n=e[1],r=n.authorizationUrl(),o=n.tokenUrl(),a=n.refreshUrl(),s=n.scopes();return i.a.createElement("div",{className:"px-4 py-2 ml-2 mb-2 border border-gray-400 bg-gray-100 rounded",key:t},i.a.createElement("div",null,i.a.createElement("span",{className:"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase"},"Flow:"),i.a.createElement("span",{className:"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase"},q.flowName(t))),r&&i.a.createElement("div",{className:"mt-1"},i.a.createElement("span",{className:"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase"},"Auth URL:"),i.a.createElement(A,{href:r,className:"underline"},r)),o&&i.a.createElement("div",{className:"mt-1"},i.a.createElement("span",{className:"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase"},"Token URL:"),i.a.createElement(A,{href:o,className:"underline"},o)),a&&i.a.createElement("div",{className:"mt-1"},i.a.createElement("span",{className:"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase"},"Refresh URL:"),i.a.createElement(A,{href:a,className:"underline"},a)),s&&i.a.createElement("div",{className:"mt-1"},i.a.createElement("span",{className:"text-xs font-bold text-gray-600 mt-1 mr-1 uppercase"},"Scopes:"),i.a.createElement("ul",{className:"inline-block"},s&&Object.entries(s).map((function(e){var t=e[0],n=e[1];return i.a.createElement("li",{className:"inline-block font-bold no-underline bg-indigo-400 text-white text-xs rounded py-0 px-1 ml-1",title:n,key:t},t)})))))}));return i.a.createElement("div",null,n&&o&&i.a.createElement("div",null,i.a.createElement("span",null,q.securityType(n.type()),o.length>0&&i.a.createElement("ul",{className:"inline-block ml-2"},o.map((function(e,t){return i.a.createElement("li",{className:"inline-block font-bold no-underline bg-blue-400 text-white text-xs uppercase rounded px-2 py-0 ml-1",key:t},e)}))))),n&&n.hasDescription()&&i.a.createElement("div",null,i.a.createElement(M,null,n.description())),l&&l.length>0&&i.a.createElement("ul",{className:"my-2"},i.a.createElement("li",null,l)),t&&i.a.createElement("div",null,t))},K=n(11),X=n.n(K);!function(e){e.ANY="any",e.RESTRICTED_ANY="restricted any",e.NEVER="never",e.UNKNOWN="unknown"}(V||(V={}));var W=["string","number","integer","boolean","array","object","null"],G=Object.keys({maxLength:"string",minLength:"string",pattern:"string",contentMediaType:"string",contentEncoding:"string",multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",contains:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",properties:"object",patternProperties:"object",propertyNames:"object",dependencies:"object",additionalProperties:"object"}),Y=function(){function e(){}return e.toSchemaType=function(e){var t=this;if(!e||"function"!=typeof e.json)return V.UNKNOWN;if(e.isBooleanSchema())return!0===e.json()?V.ANY:V.NEVER;if(0===Object.keys(e.json()).length)return V.ANY;var n=e.not();if(n&&this.inferType(n)===V.ANY)return V.NEVER;var r=this.inferType(e);if(Array.isArray(r))return r.map((function(n){return t.toType(n,e)})).join(" | ");r=this.toType(r,e);var i=this.toCombinedType(e);return r&&i?"".concat(r," ").concat(i):i||r},e.prettifyValue=function(e,t){void 0===t&&(t=!0);var n=typeof e;return"string"===n?t?'"'.concat(e,'"'):e:"number"===n||"bigint"===n||"boolean"===n?"".concat(e):Array.isArray(e)?"[".concat(e.toString(),"]"):JSON.stringify(e)},e.humanizeConstraints=function(e){var t=[],n=this.humanizeNumberRangeConstraint(e.minimum(),e.exclusiveMinimum(),e.maximum(),e.exclusiveMaximum());void 0!==n&&t.push(n);var r=this.humanizeMultipleOfConstraint(e.multipleOf());void 0!==r&&t.push(r);var i=this.humanizeRangeConstraint("characters",e.minLength(),e.maxLength());void 0!==i&&t.push(i);var o=e.uniqueItems(),a=this.humanizeRangeConstraint(o?"unique items":"items",e.minItems(),e.maxItems());void 0!==a&&t.push(a);var s=this.humanizeRangeConstraint("properties",e.minProperties(),e.maxProperties());return void 0!==s&&t.push(s),t},e.isExpandable=function(e){var t=this.inferType(e);if((t=Array.isArray(t)?t:[t]).includes("object")||t.includes("array"))return!0;if(e.oneOf()||e.anyOf()||e.allOf()||Object.keys(e.properties()).length||e.items()||e.not()||e.if()||e.then()||e.else())return!0;var n=this.getCustomExtensions(e);return!(!n||!Object.keys(n).length)},e.serverVariablesToSchema=function(e){var t;if(e&&Object.keys(e).length){var n=((t={type:"object",properties:Object.entries(e).reduce((function(e,t){var n=t[0],r=t[1];return e[n]=Object.assign({},r.json()||{}),e[n].type="string",e}),{}),required:Object.keys(e)})[this.extRenderType]=!1,t[this.extRenderAdditionalInfo]=!1,t);return new X.a(n)}},e.parametersToSchema=function(e){var t,n=this;if(e&&Object.keys(e).length){var r=((t={type:"object",properties:Object.entries(e).reduce((function(e,t){var r=t[0],i=t[1],o=i.schema();return e[r]=Object.assign({},o?o.json():{}),e[r].description=i.description()||e[r].description,e[r][n.extParameterLocation]=i.location(),e}),{}),required:Object.keys(e)})[this.extRenderType]=!1,t[this.extRenderAdditionalInfo]=!1,t);return new X.a(r)}},e.jsonToSchema=function(e){var t=this.jsonFieldToSchema(e);return new X.a(t)},e.getCustomExtensions=function(e){if(e&&"function"==typeof e.extensions)return Object.entries(e.extensions()||{}).reduce((function(e,t){var n=t[0],r=t[1];return n.startsWith("x-parser-")||n.startsWith("x-schema-private-")||(e[n]=r),e}),{})},e.getDependentRequired=function(e,t){var n=[],r=t.dependencies();if(r){for(var i=0,o=Object.entries(r);i")}return e},e.toItemsType=function(e,t){var n=this,r=e.map((function(e){return n.toSchemaType(e)})).join(", "),i=t.additionalItems();if(void 0===i||i.json()){var o=void 0===i||!0===i.json()?V.ANY:this.toSchemaType(i);return"tuple<".concat(r||V.UNKNOWN,", ...optional<").concat(o,">>")}return"tuple<".concat(r||V.UNKNOWN,">")},e.toCombinedType=function(e){return e.oneOf()?"oneOf":e.anyOf()?"anyOf":e.allOf()?"allOf":void 0},e.inferType=function(e){var t=e.type();if(void 0!==t)return Array.isArray(t)?(t.includes("integer")&&t.includes("number")&&(t=t.filter((function(e){return"integer"!==e}))),1===t.length?t[0]:t):t;var n=e.const();if(void 0!==n)return typeof n;var r=e.enum();if(Array.isArray(r)&&r.length){var i=Array.from(new Set(r.map((function(e){return typeof e}))));return 1===i.length?i[0]:i}var o=Object.keys(e.json()||{})||[];return!0===G.some((function(e){return o.includes(e)}))?V.RESTRICTED_ANY:this.toCombinedType(e)?"":V.ANY},e.humanizeNumberRangeConstraint=function(e,t,n,r){var i,o=void 0!==t,a=void 0!==e||o,s=void 0!==r,c=void 0!==n||s;return a&&c?(i=o?"( ":"[ ",i+=o?t:e,i+=" .. ",i+=s?r:n,i+=s?" )":" ]"):a?(i=o?"> ":">= ",i+=o?t:e):c&&(i=s?"< ":"<= ",i+=s?r:n),i},e.humanizeMultipleOfConstraint=function(e){if(void 0!==e){var t=e.toString(10);return/^0\.0*1$/.test(t)?"decimal places <= ".concat(t.split(".")[1].length):"multiple of ".concat(t)}},e.humanizeRangeConstraint=function(e,t,n){var r;return void 0!==t&&void 0!==n?r=t===n?"".concat(t," ").concat(e):"[ ".concat(t," .. ").concat(n," ] ").concat(e):void 0!==n?r="<= ".concat(n," ").concat(e):void 0!==t&&(r=1===t?"non-empty":">= ".concat(t," ").concat(e)),r},e.jsonFieldToSchema=function(e){var t,n,r,i,o=this;return null==e?((t={type:"string",const:""})[this.extRawValue]=!0,t):"object"!=typeof e?((n={type:"string",const:"function"==typeof e.toString?e.toString():e})[this.extRawValue]=!0,n):this.isJSONSchema(e)?e:Array.isArray(e)?((r={type:"array",items:e.map((function(e){return o.jsonFieldToSchema(e)}))})[this.extRenderType]=!1,r[this.extRenderAdditionalInfo]=!1,r):((i={type:"object",properties:Object.entries(e).reduce((function(e,t){var n=t[0],r=t[1];return e[n]=o.jsonFieldToSchema(r),e}),{})})[this.extRenderType]=!1,i[this.extRenderAdditionalInfo]=!1,i)},e.isJSONSchema=function(e){return!(!e||"object"!=typeof e||!(W.includes(e.type)||Array.isArray(e.type)&&e.type.some((function(e){return!W.includes(e)}))))},e.extRenderType="x-schema-private-render-type",e.extRenderAdditionalInfo="x-schema-private-render-additional-info",e.extRawValue="x-schema-private-raw-value",e.extParameterLocation="x-schema-private-parameter-location",e}(),Z=function(e){var t=e.name,n=void 0===t?"Extensions":t,r=e.item,o=Y.getCustomExtensions(r);if(!o||!Object.keys(o).length)return null;var a=Y.jsonToSchema(o);return a&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(ee,{schemaName:n,schema:a,onlyTitle:!0}))},Q=i.a.createContext({reverse:!1,deepExpanded:!1}),ee=function(e){var t=e.schemaName,n=e.schema,o=e.required,a=void 0!==o&&o,s=e.isPatternProperty,c=void 0!==s&&s,u=e.isProperty,l=void 0!==u&&u,p=e.isCircular,f=void 0!==p&&p,d=e.dependentRequired,m=e.expanded,y=void 0!==m&&m,g=e.onlyTitle,v=void 0!==g&&g,b=Object(r.useContext)(Q),x=b.reverse,w=b.deepExpanded,E=Object(r.useState)(y),_=E[0],j=E[1],S=Object(r.useState)(!1),D=S[0],k=S[1];if(Object(r.useEffect)((function(){k(w)}),[w,k]),Object(r.useEffect)((function(){j(D)}),[D,j]),!n||"string"==typeof t&&((null==t?void 0:t.startsWith("x-parser-"))||(null==t?void 0:t.startsWith("x-schema-private-"))))return null;var C=Y.getDependentSchemas(n),P=Y.humanizeConstraints(n),T=n.externalDocs(),$=!1!==n.ext(Y.extRenderType),O=!0===n.ext(Y.extRawValue),F=n.ext(Y.extParameterLocation),I=Y.isExpandable(n)||C,N=Y.toSchemaType(n);f=f||n.isCircular()||n.ext("x-parser-circular")||!1;var R=n.uid(),B=n.items();B&&!Array.isArray(B)?(f=f||B.isCircular()||B.ext("x-parser-circular")||!1)&&"function"==typeof B.circularSchema&&(N=Y.toSchemaType(B.circularSchema())):f&&"function"==typeof n.circularSchema&&(N=Y.toSchemaType(n.circularSchema()));var L=l?"italic":"",z="string"==typeof t?i.a.createElement("span",{className:"break-words text-sm ".concat(L)},t):t;return i.a.createElement(Q.Provider,{value:{reverse:!x,deepExpanded:D}},i.a.createElement("div",null,i.a.createElement("div",{className:"flex py-2"},i.a.createElement("div",{className:"".concat(v?"":"min-w-1/4"," mr-2")},I&&!f?i.a.createElement(i.a.Fragment,null,i.a.createElement(h,{onClick:function(){return j((function(e){return!e}))},expanded:_},z),i.a.createElement("button",{type:"button",onClick:function(){return k((function(e){return!e}))},className:"ml-1 text-sm text-gray-500"},D?"Collapse all":"Expand all")):i.a.createElement("span",{className:"break-words text-sm ".concat(l?"italic":"")},t),c&&i.a.createElement("div",{className:"text-gray-500 text-xs italic"},"(pattern property)"),a&&i.a.createElement("div",{className:"text-red-600 text-xs"},"required"),d&&i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"text-gray-500 text-xs"},"required when defined:"),i.a.createElement("div",{className:"text-red-600 text-xs"},d.join(", "))),n.deprecated()&&i.a.createElement("div",{className:"text-red-600 text-xs"},"deprecated"),n.writeOnly()&&i.a.createElement("div",{className:"text-gray-500 text-xs"},"write-only"),n.readOnly()&&i.a.createElement("div",{className:"text-gray-500 text-xs"},"read-only")),O?i.a.createElement("div",null,i.a.createElement("div",{className:"text-sm"},Y.prettifyValue(n.const(),!1))):i.a.createElement("div",null,i.a.createElement("div",null,$&&i.a.createElement("div",{className:"capitalize text-sm text-teal-500 font-bold inline-block mr-2"},f?"".concat(N," [CIRCULAR]"):N),i.a.createElement("div",{className:"inline-block"},n.format()&&i.a.createElement("span",{className:"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs"},"format: ",n.format()),void 0!==n.pattern()&&i.a.createElement("span",{className:"bg-yellow-600 font-bold no-underline text-white rounded mr-2 p-1 text-xs"},"must match: ",n.pattern()),void 0!==n.contentMediaType()&&i.a.createElement("span",{className:"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs"},"media type: ",n.contentMediaType()),void 0!==n.contentEncoding()&&i.a.createElement("span",{className:"bg-yellow-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs"},"encoding: ",n.contentEncoding()),!!P.length&&P.map((function(e){return i.a.createElement("span",{className:"bg-purple-600 font-bold no-underline text-white rounded lowercase mr-2 p-1 text-xs",key:e},e)})),R&&!R.startsWith("e.length?e.repeat(Math.trunc(t/e.length)+1).substring(0,t):e}function fe(...e){const t=e=>e&&"object"==typeof e;return e.reduce((e,n)=>(Object.keys(n).forEach(r=>{const i=e[r],o=n[r];t(i)&&t(o)?e[r]=fe(i,o):e[r]=o}),e),Array.isArray(e[e.length-1])?[]:{})}function he(e){return{value:"object"===e?{}:"array"===e?[]:void 0}}function de(e,t){t&&e.pop()}const me={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"};function ye(e){if(void 0!==e.type)return Array.isArray(e.type)?0===e.type.length?null:e.type[0]:e.type;const t=Object.keys(me);for(var n=0;nt.maxSampleDepth)return de(xe,r),he(ye(e));if(e.$ref){if(!n)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let i=decodeURIComponent(e.$ref);i.startsWith("#")&&(i=i.substring(1));const o=ve.a.get(n,i);let a;if(!0!==be[i])be[i]=!0,a=_e(o,t,n,r),be[i]=!1;else{a=he(ye(o))}return de(xe,r),a}if(void 0!==e.example)return de(xe,r),{value:e.example,readOnly:e.readOnly,writeOnly:e.writeOnly,type:e.type};if(void 0!==e.allOf)return de(xe,r),Ee(e)||function(e,t,n,r,i){let o=_e(e,n,r);const a=[];for(let e of t){const{type:t,readOnly:s,writeOnly:c,value:u}=_e({type:o.type,...e},n,r,i);o.type&&t&&t!==o.type&&(console.warn("allOf: schemas with different types can't be merged"),o.type=t),o.type=o.type||t,o.readOnly=o.readOnly||s,o.writeOnly=o.writeOnly||c,null!=u&&a.push(u)}if("object"===o.type)return o.value=fe(o.value||{},...a.filter(e=>"object"==typeof e)),o;{"array"===o.type&&(n.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));const e=a[a.length-1];return o.value=null!=e?e:o.value,o}}({...e,allOf:void 0},e.allOf,t,n,r);if(e.oneOf&&e.oneOf.length){e.anyOf&&(t.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),de(xe,r);const i=Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.oneOf[0]);return Ee(e)||_e(i,t,n,r)}if(e.anyOf&&e.anyOf.length)return de(xe,r),Ee(e)||_e(e.anyOf[0],t,n,r);if(e.if&&e.then)return de(xe,r),Ee(e)||_e(fe(e.if,e.then),t,n,r);let i=we(e),o=null;if(void 0===i){i=null,o=e.type,Array.isArray(o)&&e.type.length>0&&(o=e.type[0]),o||(o=ye(e));let a=ke[o];a&&(i=a(e,t,n,r))}return de(xe,r),{value:i,readOnly:e.readOnly,writeOnly:e.writeOnly,type:o}}function je(e){let t=0;if("boolean"==typeof e.exclusiveMinimum||"boolean"==typeof e.exclusiveMaximum){if(e.maximum&&e.minimum)return t=e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum,(e.exclusiveMaximum&&t>=e.maximum||!e.exclusiveMaximum&&t>e.maximum)&&(t=(e.maximum+e.minimum)/2),t;if(e.minimum)return e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum;if(e.maximum)return e.exclusiveMaximum?e.maximum>0?0:Math.floor(e.maximum)-1:e.maximum>0?0:e.maximum}else{if(e.minimum)return e.minimum;e.exclusiveMinimum?(t=Math.floor(e.exclusiveMinimum)+1,t===e.exclusiveMaximum&&(t=(t+Math.floor(e.exclusiveMaximum)-1)/2)):e.exclusiveMaximum?t=Math.floor(e.exclusiveMaximum)-1:e.maximum&&(t=e.maximum)}return t}function Se({min:e,max:t,omitTime:n,omitDate:r}){let i=function(e,t,n,r){var i=n?"":e.getUTCFullYear()+"-"+le(e.getUTCMonth()+1)+"-"+le(e.getUTCDate());return t||(i+="T"+le(e.getUTCHours())+":"+le(e.getUTCMinutes())+":"+le(e.getUTCSeconds())+(r?"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5):"")+"Z"),i}(new Date("2019-08-24T14:15:22.123Z"),n,r,!1);return i.lengtht&&console.warn(`Using maxLength = ${t} is incorrect with format "date-time"`),i}function De(e,t){let n=pe("string",e);return t&&n.length>t&&(n=n.substring(0,t)),n}const Ae={email:function(){return"user@example.com"},"idn-email":function(){return"пошта@укр.нет"},password:function(e,t){let n="pa$$word";return e>n.length&&(n+="_",n+=pe("qwerty!@#$%^123456",e-n.length).substring(0,e-n.length)),n},"date-time":function(e,t){return Se({min:e,max:t,omitTime:!1,omitDate:!1})},date:function(e,t){return Se({min:e,max:t,omitTime:!0,omitDate:!1})},time:function(e,t){return Se({min:e,max:t,omitTime:!1,omitDate:!0}).slice(1)},ipv4:function(){return"192.168.0.1"},ipv6:function(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"},hostname:function(){return"example.com"},"idn-hostname":function(){return"приклад.укр"},iri:function(){return"http://example.com"},"iri-reference":function(){return"../словник"},uri:function(){return"http://example.com"},"uri-reference":function(){return"../dictionary"},"uri-template":function(){return"http://example.com/{endpoint}"},uuid:function(e,t,n){return s=function(e){var t=0;if(0==e.length)return t;for(var n=0;n>>5)|0;return r=i^((o|=0)<<17|o>>>15),i=o+(a|=0)|0,o=a+e|0,((a=r+e|0)>>>0)/4294967296},"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{var t=16*c()%16|0;return("x"==e?t:3&t|8).toString(16)});var r,i,o,a,s,c},default:De,"json-pointer":function(){return"/json/pointer"},"relative-json-pointer":function(){return"1/relative/json/pointer"},regex:function(){return"/regex/"}};var ke={};const Ce={skipReadOnly:!1,maxSampleDepth:15};function Pe(e,t,n){let r=Object.assign({},Ce,t);return be={},xe=[],_e(e,r,n).value}function Te(e,t){ke[e]=t}Te("array",(function(e,t={},n,r){const i=r&&r.depth||1;let o=Math.min(null!=e.maxItems?e.maxItems:1/0,e.minItems||1);const a=e.items||e.contains;Array.isArray(a)&&(o=Math.max(o,a.length));let s=[];if(!a)return s;for(let r=0;r(e[t]=!0,e),{});Object.keys(e.properties).forEach(a=>{if(t.skipNonRequired&&!r.hasOwnProperty(a))return;const s=_e(e.properties[a],t,n,{propertyName:a,depth:o+1});t.skipReadOnly&&s.readOnly||t.skipWriteOnly&&s.writeOnly||(i[a]=s.value)})}if(e&&"object"==typeof e.additionalProperties){const r=e.additionalProperties["x-additionalPropertiesName"]||"property";i[String(r)+"1"]=_e(e.additionalProperties,t,n,{depth:o+1}).value,i[String(r)+"2"]=_e(e.additionalProperties,t,n,{depth:o+1}).value}return i})),Te("string",(function(e,t,n,r){let i=e.format||"default",o=Ae[i]||De,a=r&&r.propertyName;return o(0|e.minLength,e.maxLength,a)}));var $e,Oe=function(){function e(){}return e.generateExample=function(e,t){void 0===t&&(t={});try{return this.sanitizeExample(Pe(e,t))||""}catch(e){return""}},e.sanitizeExample=function(e){var t=this;return"object"==typeof e&&e&&!Array.isArray(e)?Object.entries(e).reduce((function(e,n){var r=n[0],i=n[1];return r.startsWith("x-parser-")||r.startsWith("x-schema-private-")||(e[r]=t.sanitizeExample(i)),e}),{}):e},e.getPayloadExamples=function(e){var t=e.examples();if(Array.isArray(t)&&t.some((function(e){return e.payload}))){var n=t.flatMap((function(e){if(e.payload)return{name:e.name,summary:e.summary,example:e.payload}})).filter(Boolean);if(n.length>0)return n}var r=e.payload();if(r&&r.examples())return r.examples().map((function(e){return{example:e}}))},e.getHeadersExamples=function(e){var t=e.examples();if(Array.isArray(t)&&t.some((function(e){return e.headers}))){var n=t.flatMap((function(e){if(e.headers)return{name:e.name,summary:e.summary,example:e.headers}})).filter(Boolean);if(n.length>0)return n}var r=e.headers();if(r&&r.examples())return r.examples().map((function(e){return{example:e}}))},e}(),Fe=function(e){var t=e.message;if(!t)return null;var n=t.payload(),r=t.headers();return i.a.createElement("div",{className:"bg-gray-800 px-8 py-4 mt-4 -mx-8 2xl:mx-0 2xl:px-4 2xl:rounded examples"},i.a.createElement("h4",{className:"text-white text-lg"},"Examples"),n&&i.a.createElement(Ie,{type:"Payload",schema:n,examples:Oe.getPayloadExamples(t)}),r&&i.a.createElement(Ie,{type:"Headers",schema:r,examples:Oe.getHeadersExamples(t)}))},Ie=function(e){var t=e.type,n=void 0===t?"Payload":t,o=e.schema,a=e.examples,s=void 0===a?[]:a,c=g(),u=Object(r.useState)(c&&c.expand&&c.expand.messageExamples||!1),l=u[0],p=u[1];return Object(r.useEffect)((function(){p(c&&c.expand&&c.expand.messageExamples||!1)}),[c.expand]),i.a.createElement("div",{className:"mt-4"},i.a.createElement("div",null,i.a.createElement(h,{onClick:function(){return p((function(e){return!e}))},expanded:l,chevronProps:{className:"fill-current text-gray-200"}},i.a.createElement("span",{className:"inline-block w-20 py-0.5 mr-1 text-gray-200 text-sm border text-center rounded focus:outline-none"},n))),i.a.createElement("div",{className:l?"block":"hidden"},s&&s.length>0?i.a.createElement("ul",null,s.map((function(e,t){return i.a.createElement("li",{className:"mt-4",key:t},i.a.createElement("h5",{className:"text-xs font-bold text-gray-500"},e.name?"#".concat(t+1," Example - ").concat(e.name):"#".concat(t+1," Example")),e.summary&&i.a.createElement("p",{className:"text-xs font-bold text-gray-500"},e.summary),i.a.createElement("div",{className:"mt-1"},i.a.createElement(ue,{snippet:Oe.sanitizeExample(e.example)})))}))):i.a.createElement("div",{className:"mt-4"},i.a.createElement(ue,{snippet:Oe.generateExample(o.json())}),i.a.createElement("h6",{className:"text-xs font-bold text-gray-600 italic mt-2"},"This example has been generated automatically."))))},Ne=function(e){var t=e.message,n=e.messageName,r=e.index,o=e.showExamples,s=void 0!==o&&o,c=g();if(!t)return null;var u="function"==typeof t.id&&t.id(),l=t.title(),p=t.summary(),f=t.payload(),h=t.headers(),d=t.correlationId(),m=t.contentType(),y=t.externalDocs(),v=m||y;return i.a.createElement("div",{className:"panel-item"},i.a.createElement("div",{className:"panel-item--center px-8"},i.a.createElement("div",{className:"shadow rounded bg-gray-200 p-4 border"},i.a.createElement("div",null,void 0!==r&&i.a.createElement("span",{className:"text-gray-700 font-bold mr-2"},"#",r),l&&i.a.createElement("span",{className:"text-gray-700 mr-2"},l),i.a.createElement("span",{className:"border text-orange-600 rounded text-xs py-0 px-2"},t.uid())),p&&i.a.createElement("p",{className:"text-gray-600 text-sm"},p),v&&i.a.createElement("ul",{className:"leading-normal mt-2 mb-4 space-x-2 space-y-2"},m&&i.a.createElement("li",{className:"inline-block"},i.a.createElement(A,{className:"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-3 py-1",href:"".concat(a.a,"/").concat(m)},i.a.createElement("span",null,m))),y&&i.a.createElement("li",{className:"inline-block"},i.a.createElement(A,{className:"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-3 py-1",href:y.url()},i.a.createElement("span",null,a.c)))),u&&i.a.createElement("div",{className:"border bg-gray-100 rounded px-4 py-2 mt-2"},i.a.createElement("div",{className:"text-sm text-gray-700"},"Message ID",i.a.createElement("span",{className:"border text-orange-600 rounded text-xs ml-2 py-0 px-2"},u))),d&&i.a.createElement("div",{className:"border bg-gray-100 rounded px-4 py-2 mt-2"},i.a.createElement("div",{className:"text-sm text-gray-700"},"Correlation ID",i.a.createElement("span",{className:"border text-orange-600 rounded text-xs ml-2 py-0 px-2"},d.location())),d.hasDescription()&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(M,null,d.description()))),t.hasDescription()&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(M,null,t.description())),f&&i.a.createElement("div",{className:"mt-2",id:n?ae.getIdentifier("message-".concat(n,"-payload"),c):void 0},i.a.createElement(ee,{schemaName:"Payload",schema:f})),h&&i.a.createElement("div",{className:"mt-2",id:n?ae.getIdentifier("message-".concat(n,"-headers"),c):void 0},i.a.createElement(ee,{schemaName:"Headers",schema:h})),t.hasBindings()&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(oe,{name:"Message specific information",bindings:t.bindings()})),i.a.createElement(Z,{item:t}),t.hasTags()&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(z,{tags:t.tags()})))),s&&i.a.createElement("div",{className:"panel-item--right px-8"},i.a.createElement(Fe,{message:t})))},Re=n(9),Be=function(){return(Be=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?i.a.createElement("div",{className:"mt-2 text-sm"},i.a.createElement("p",null,"Available only on servers:"),i.a.createElement("ul",{className:"flex flex-wrap leading-normal"},c.map((function(e){return i.a.createElement("li",{className:"inline-block mt-2 mr-2",key:e},i.a.createElement("a",{href:"#".concat(ae.getIdentifier("server-"+e,t)),className:"border border-solid border-blue-300 hover:bg-blue-300 hover:text-blue-600 text-blue-500 font-bold no-underline text-xs rounded px-3 py-1 cursor-pointer"},i.a.createElement("span",{className:"underline"},e)))})))):null,l&&i.a.createElement("div",{className:"mt-2",id:ae.getIdentifier("operation-".concat(r,"-").concat(a,"-parameters"),t)},i.a.createElement(ee,{schemaName:"Parameters",schema:l,expanded:!0})),u&&i.a.createElement("div",{className:"mt-2",id:ae.getIdentifier("operation-".concat(r,"-").concat(a,"-security"),t)},i.a.createElement(H,{security:u,header:"Additional security requirements"})),s.hasBindings()&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(oe,{name:"Channel specific information",bindings:s.bindings()})),i.a.createElement(Z,{name:"Channel Extensions",item:s}),o.hasBindings()&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(oe,{name:"Operation specific information",bindings:o.bindings()})),i.a.createElement(Z,{name:"Operation Extensions",item:o}),o.hasTags()&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(z,{tags:o.tags()}))),i.a.createElement("div",{className:"w-full mt-4",id:ae.getIdentifier("operation-".concat(r,"-").concat(a,"-message"),t)},o.hasMultipleMessages()?i.a.createElement("div",{className:"mt-2"},i.a.createElement("p",{className:"px-8"},"Accepts ",i.a.createElement("strong",null,"one of")," the following messages:"),i.a.createElement("ul",null,o.messages().map((function(e,t){return i.a.createElement("li",{className:"mt-4",key:t},i.a.createElement(Ne,{message:e,index:t,showExamples:!0}))})))):i.a.createElement("div",{className:"mt-2"},i.a.createElement("p",{className:"px-8"},"Accepts the following message:"),i.a.createElement("div",{className:"mt-2"},i.a.createElement(Ne,{message:o.message(0),showExamples:!0})))))},Le=function(e){var t=e.type,n=void 0===t?Re.a.PUBLISH:t,r=e.operation,o=e.channelName,s=e.channel,c=g(),u=r.summary(),l=r.externalDocs(),p=r.id();return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"mb-4"},i.a.createElement("h3",null,i.a.createElement("span",{className:"font-mono border uppercase p-1 rounded mr-2 ".concat(n===Re.a.PUBLISH?"border-blue-600 text-blue-500":"border-green-600 text-green-600"),title:n},n===Re.a.PUBLISH?c.publishLabel||a.f:c.subscribeLabel||a.i)," ",i.a.createElement("span",{className:"font-mono text-base"},o))),s.hasDescription()&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(M,null,s.description())),u&&i.a.createElement("p",{className:"text-gray-600 text-sm mt-2"},u),r.hasDescription()&&i.a.createElement("div",{className:"mt-2"},i.a.createElement(M,null,r.description())),l&&i.a.createElement("ul",{className:"leading-normal mt-2 mb-4 space-x-2 space-y-2"},l&&i.a.createElement("li",{className:"inline-block"},i.a.createElement(A,{className:"border border-solid border-orange-300 hover:bg-orange-300 hover:text-orange-600 text-orange-500 font-bold no-underline text-xs uppercase rounded px-3 py-1",href:l.url()},i.a.createElement("span",null,a.c)))),p&&i.a.createElement("div",{className:"border bg-gray-100 rounded px-4 py-2 mt-2"},i.a.createElement("div",{className:"text-sm text-gray-700"},"Operation ID",i.a.createElement("span",{className:"border text-orange-600 rounded text-xs ml-2 py-0 px-2"},p))))},ze=function(){var e=m().channels(),t=g();if(!Object.keys(e).length)return null;var n=[];return Object.entries(e).forEach((function(e){var r=e[0],o=e[1];o.hasPublish()&&n.push(i.a.createElement("li",{className:"mb-12",key:"pub-".concat(r),id:ae.getIdentifier("operation-".concat(Re.a.PUBLISH,"-").concat(r),t)},i.a.createElement(Me,{type:Re.a.PUBLISH,operation:o.publish(),channelName:r,channel:o}))),o.hasSubscribe()&&n.push(i.a.createElement("li",{className:"mb-12",key:"sub-".concat(r),id:ae.getIdentifier("operation-".concat(Re.a.SUBSCRIBE,"-").concat(r),t)},i.a.createElement(Me,{type:Re.a.SUBSCRIBE,operation:o.subscribe(),channelName:r,channel:o})))})),i.a.createElement("section",{id:"".concat(ae.getIdentifier("operations",t)),className:"mt-16"},i.a.createElement("h2",{className:"2xl:w-7/12 text-3xl font-light mb-4 px-8"},a.e),i.a.createElement("ul",null,n))},Ue=function(){var e=m(),t=g(),n=e.hasComponents()&&e.components().messages();return n&&0!==Object.keys(n).length?i.a.createElement("section",{id:"".concat(ae.getIdentifier("messages",t)),className:"mt-16"},i.a.createElement("h2",{className:"2xl:w-7/12 text-3xl font-light mb-4 px-8"},a.d),i.a.createElement("ul",null,Object.entries(n).map((function(e,n){var r=e[0],o=e[1];return i.a.createElement("li",{className:"mb-4",key:r,id:ae.getIdentifier("message-".concat(r),t)},i.a.createElement(Ne,{messageName:r,message:o,index:n+1,key:r}))})))):null},qe=function(e){var t=e.schemaName,n=e.schema;return n?i.a.createElement("div",null,i.a.createElement("div",{className:"panel-item--center px-8"},i.a.createElement("div",{className:"shadow rounded px-4 py-2 border bg-gray-200"},i.a.createElement(ee,{schemaName:t,schema:n}))),i.a.createElement("div",{className:"w-full mt-4"})):null},He=function(){var e=m(),t=g(),n=e.hasComponents()&&e.components().schemas();return n&&0!==Object.keys(n).length?i.a.createElement("section",{id:"".concat(ae.getIdentifier("schemas",t)),className:"mt-16"},i.a.createElement("h2",{className:"2xl:w-7/12 text-3xl font-light mb-4 px-8"},a.g),i.a.createElement("ul",null,Object.entries(n).map((function(e){var n=e[0],r=e[1];return i.a.createElement("li",{className:"mb-4",key:n,id:ae.getIdentifier("schema-".concat(n),t)},i.a.createElement(qe,{schemaName:n,schema:r}))})))):null},Ve=function(e){var t=e.error;if(!t)return null;var n,r=t.title,o=t.validationErrors;return i.a.createElement("div",{className:"panel-item"},i.a.createElement("div",{className:"panel-item--center p-8"},i.a.createElement("section",{className:"shadow rounded bg-gray-200 border-red-500 border-l-8"},i.a.createElement("h2",{className:"p-2"},r?"".concat(a.b,": ").concat(r):a.b),o&&o.length?i.a.createElement("div",{className:"bg-gray-800 text-white text-xs p-2"},i.a.createElement("pre",null,(n=o)?n.map((function(e,t){return e&&e.title&&e.location?i.a.createElement("div",{key:t,className:"flex"},i.a.createElement("span",null,"".concat(e.location.startLine,".")),i.a.createElement("code",{className:"whitespace-pre-wrap break-all ml-2"},e.title)):null})).filter(Boolean):null)):null)),i.a.createElement("div",{className:"panel-item--right"}))},Je=function(e){var t=e.asyncapi,n=e.config,o=e.error,a=void 0===o?null:o,s=Object(r.useState)("container:xl"),c=s[0],l=s[1],p=u({onResize:function(e){var t=e.width;requestAnimationFrame((function(){if(void 0!==t){var e=t<=1280?"container:xl":"container:base";e!==c&&l(e)}}))}}).ref,f=n.show||{};return i.a.createElement(y.Provider,{value:n},i.a.createElement(d.Provider,{value:t},i.a.createElement("section",{className:"aui-root"},i.a.createElement("div",{className:"".concat(c," relative md:flex bg-white leading-normal"),id:n.schemaID||void 0,ref:p},f.sidebar&&i.a.createElement(x,null),i.a.createElement("div",{className:"panel--center relative py-8 flex-1"},i.a.createElement("div",{className:"relative z-10"},f.errors&&a&&i.a.createElement(Ve,{error:a}),f.info&&i.a.createElement(U,null),f.servers&&i.a.createElement(ce,null),f.operations&&i.a.createElement(ze,null),f.messages&&i.a.createElement(Ue,null),f.schemas&&i.a.createElement(He,null)),i.a.createElement("div",{className:"panel--right absolute top-0 right-0 h-full bg-gray-800"}))))))},Ke=($e=function(e,t){return($e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}$e(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Xe=function(){return(Xe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]new c(e)):null}},u,l,p,f)},function(e,t,n){const{mix:r}=n(2),i=n(3),o=n(7),a=n(4);e.exports=r(class extends i{allowedValues(){return this._json.enum}allows(e){return void 0===this._json.enum||this._json.enum.includes(e)}hasAllowedValues(){return void 0!==this._json.enum}defaultValue(){return this._json.default}hasDefaultValue(){return void 0!==this._json.default}examples(){return this._json.examples}},o,a)},function(e,t,n){const{createMapOfType:r,getMapValueOfType:i,mix:o}=n(2),a=n(3),s=n(44),c=n(86),u=n(90),l=n(7),p=n(21),f=n(4);e.exports=o(class extends a{parameters(){return r(this._json.parameters,s)}parameter(e){return i(this._json.parameters,e,s)}hasParameters(){return!!this._json.parameters}hasServers(){return!!this._json.servers}servers(){return this._json.servers?this._json.servers:[]}server(e){return this._json.servers?"number"!=typeof e||e>this._json.servers.length-1?null:this._json.servers[+e]:null}publish(){return this._json.publish?new c(this._json.publish):null}subscribe(){return this._json.subscribe?new u(this._json.subscribe):null}hasPublish(){return!!this._json.publish}hasSubscribe(){return!!this._json.subscribe}},l,p,f)},function(e,t,n){const{mix:r}=n(2),i=n(3),o=n(11),a=n(7),s=n(4);e.exports=r(class extends i{location(){return this._json.location}schema(){return this._json.schema?new o(this._json.schema):null}},a,s)},function(e,t,n){const{mix:r}=n(2),i=n(3),o=n(7),a=n(22),s=n(17),c=n(21),u=n(4);e.exports=r(class extends i{id(){return this._json.operationId}summary(){return this._json.summary}},o,a,s,c,u)},function(e,t,n){(function(t){const r=n(47),i=n(48),o=n(11);e.exports=class extends i{uid(){return this.id()||this.name()||this.ext("x-parser-message-name")||t.from(JSON.stringify(this._json)).toString("base64")}payload(){return this._json.payload?new o(this._json.payload):null}traits(){const e=this._json["x-parser-original-traits"]||this._json.traits;return e?e.map(e=>new r(e)):[]}hasTraits(){return!!this._json["x-parser-original-traits"]||!!this._json.traits}originalPayload(){return this._json["x-parser-original-payload"]||this.payload()}originalSchemaFormat(){return this._json["x-parser-original-schema-format"]||this.schemaFormat()}}}).call(this,n(6).Buffer)},function(e,t,n){const r=n(48);e.exports=class extends r{}},function(e,t,n){const{getMapValueOfType:r,mix:i}=n(2),o=n(3),a=n(11),s=n(49),c=n(7),u=n(17),l=n(22),p=n(21),f=n(4);e.exports=i(class extends o{headers(){return this._json.headers?new a(this._json.headers):null}header(e){return this._json.headers?r(this._json.headers.properties,e,a):null}id(){return this._json.messageId}correlationId(){return this._json.correlationId?new s(this._json.correlationId):null}schemaFormat(){return this._json.schemaFormat}contentType(){return this._json.contentType}name(){return this._json.name}title(){return this._json.title}summary(){return this._json.summary}examples(){return this._json.examples}},c,l,u,p,f)},function(e,t,n){const{mix:r}=n(2),i=n(3),o=n(7),a=n(4);e.exports=r(class extends i{location(){return this._json.location}},a,o)},function(e,t,n){const r=n(45);e.exports=class extends r{}},function(e,t){const n=Object.freeze({NEW_SCHEMA:"NEW_SCHEMA",END_SCHEMA:"END_SCHEMA"}),r=Object.freeze({parameters:"parameters",payloads:"payloads",headers:"headers",components:"components",objects:"objects",arrays:"arrays",oneOfs:"oneOfs",allOfs:"allOfs",anyOfs:"anyOfs",nots:"nots",propertyNames:"propertyNames",patternProperties:"patternProperties",contains:"contains",ifs:"ifs",thenes:"thenes",elses:"elses",dependencies:"dependencies",definitions:"definitions"});function i(e,t,o){if(!e)return;const{callback:a,schemaTypesToIterate:s,seenSchemas:c}=o,u=e.json();if(c.has(u))return;c.add(u);let l=e.type()||[];Array.isArray(l)||(l=[l]),!s.includes(r.objects)&&l.includes("object")||!s.includes(r.arrays)&&l.includes("array")||!1!==a(e,t,n.NEW_SCHEMA)&&(s.includes(r.objects)&&l.includes("object")&&function(e,t){Object.entries(e.properties()||{}).forEach(([e,n])=>{i(n,e,t)});const n=e.additionalProperties();"object"==typeof n&&i(n,null,t);const o=t.schemaTypesToIterate;o.includes(r.propertyNames)&&e.propertyNames()&&i(e.propertyNames(),null,t);o.includes(r.patternProperties)&&Object.entries(e.patternProperties()||{}).forEach(([e,n])=>{i(n,e,t)})}(e,o),s.includes(r.arrays)&&l.includes("array")&&function(e,t){const n=e.items();n&&(Array.isArray(n)?n.forEach((e,n)=>{i(e,n,t)}):i(n,null,t));const o=e.additionalItems();"object"==typeof o&&i(o,null,t);t.schemaTypesToIterate.includes(r.contains)&&e.contains()&&i(e.contains(),null,t)}(e,o),s.includes(r.oneOfs)&&(e.oneOf()||[]).forEach((e,t)=>{i(e,t,o)}),s.includes(r.anyOfs)&&(e.anyOf()||[]).forEach((e,t)=>{i(e,t,o)}),s.includes(r.allOfs)&&(e.allOf()||[]).forEach((e,t)=>{i(e,t,o)}),s.includes(r.nots)&&e.not()&&i(e.not(),null,o),s.includes(r.ifs)&&e.if()&&i(e.if(),null,o),s.includes(r.thenes)&&e.then()&&i(e.then(),null,o),s.includes(r.elses)&&e.else()&&i(e.else(),null,o),s.includes(r.dependencies)&&Object.entries(e.dependencies()||{}).forEach(([e,t])=>{t&&!Array.isArray(t)&&i(t,e,o)}),s.includes(r.definitions)&&Object.entries(e.definitions()||{}).forEach(([e,t])=>{i(t,e,o)}),a(e,t,n.END_SCHEMA),c.delete(u))}function o(e,t){if(!e)return;const{schemaTypesToIterate:n}=t;n.includes(r.headers)&&i(e.headers(),null,t),n.includes(r.payloads)&&i(e.payload(),null,t)}e.exports={SchemaIteratorCallbackType:n,SchemaTypesToIterate:r,traverseAsyncApiDocument:function(e,t,n){n||(n=Object.values(r));const a={callback:t,schemaTypesToIterate:n,seenSchemas:new Set};if(e.hasChannels()&&Object.values(e.channels()).forEach(e=>{!function(e,t){if(!e)return;const{schemaTypesToIterate:n}=t;n.includes(r.parameters)&&Object.values(e.parameters()||{}).forEach(e=>{i(e.schema(),null,t)});e.hasPublish()&&e.publish().messages().forEach(e=>{o(e,t)});e.hasSubscribe()&&e.subscribe().messages().forEach(e=>{o(e,t)})}(e,a)}),n.includes(r.components)&&e.hasComponents()){const t=e.components();Object.values(t.messages()||{}).forEach(e=>{o(e,a)}),Object.values(t.schemas()||{}).forEach(e=>{i(e,null,a)}),n.includes(r.parameters)&&Object.values(t.parameters()||{}).forEach(e=>{i(e.schema(),null,a)}),Object.values(t.messageTraits()||{}).forEach(e=>{!function(e,t){if(!e)return;const{schemaTypesToIterate:n}=t;n.includes(r.headers)&&i(e.headers(),null,t)}(e,a)})}}}},function(e,t,n){ - /*! @license DOMPurify 2.3.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.6/LICENSE */ - e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,i=Object.getOwnPropertyDescriptor,o=Object.freeze,a=Object.seal,s=Object.create,c="undefined"!=typeof Reflect&&Reflect,u=c.apply,l=c.construct;u||(u=function(e,t,n){return e.apply(t,n)}),o||(o=function(e){return e}),a||(a=function(e){return e}),l||(l=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?n-1:0),i=1;i/gm),M=a(/^data-[\-\w.\u00B7-\uFFFF]/),L=a(/^aria-[\-\w]+$/),z=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U=a(/^(?:\w+script|data):/i),q=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),H=a(/^html$/i),V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function J(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:K(),n=function(t){return e(t)};if(n.version="2.3.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,i=t.document,a=t.DocumentFragment,s=t.HTMLTemplateElement,c=t.Node,u=t.Element,l=t.NodeFilter,p=t.NamedNodeMap,E=void 0===p?t.NamedNodeMap||t.MozNamedAttrMap:p,W=t.HTMLFormElement,G=t.DOMParser,Y=t.trustedTypes,Z=u.prototype,Q=S(Z,"cloneNode"),ee=S(Z,"nextSibling"),te=S(Z,"childNodes"),ne=S(Z,"parentNode");if("function"==typeof s){var re=i.createElement("template");re.content&&re.content.ownerDocument&&(i=re.content.ownerDocument)}var ie=X(Y,r),oe=ie?ie.createHTML(""):"",ae=i,se=ae.implementation,ce=ae.createNodeIterator,ue=ae.createDocumentFragment,le=ae.getElementsByTagName,pe=r.importNode,fe={};try{fe=j(i).documentMode?i.documentMode:{}}catch(e){}var he={};n.isSupported="function"==typeof ne&&se&&void 0!==se.createHTMLDocument&&9!==fe;var de=R,me=B,ye=M,ge=L,ve=U,be=q,xe=z,we=null,Ee=_({},[].concat(J(D),J(A),J(k),J(P),J($))),_e=null,je=_({},[].concat(J(O),J(F),J(I),J(N))),Se=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),De=null,Ae=null,ke=!0,Ce=!0,Pe=!1,Te=!1,$e=!1,Oe=!1,Fe=!1,Ie=!1,Ne=!1,Re=!1,Be=!0,Me=!0,Le=!1,ze={},Ue=null,qe=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),He=null,Ve=_({},["audio","video","img","source","image","track"]),Je=null,Ke=_({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml",Ye=Ge,Ze=!1,Qe=void 0,et=["application/xhtml+xml","text/html"],tt="text/html",nt=void 0,rt=null,it=i.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},at=function(e){rt&&rt===e||(e&&"object"===(void 0===e?"undefined":V(e))||(e={}),e=j(e),we="ALLOWED_TAGS"in e?_({},e.ALLOWED_TAGS):Ee,_e="ALLOWED_ATTR"in e?_({},e.ALLOWED_ATTR):je,Je="ADD_URI_SAFE_ATTR"in e?_(j(Ke),e.ADD_URI_SAFE_ATTR):Ke,He="ADD_DATA_URI_TAGS"in e?_(j(Ve),e.ADD_DATA_URI_TAGS):Ve,Ue="FORBID_CONTENTS"in e?_({},e.FORBID_CONTENTS):qe,De="FORBID_TAGS"in e?_({},e.FORBID_TAGS):{},Ae="FORBID_ATTR"in e?_({},e.FORBID_ATTR):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,ke=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Pe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=e.SAFE_FOR_TEMPLATES||!1,$e=e.WHOLE_DOCUMENT||!1,Ie=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Re=e.RETURN_TRUSTED_TYPE||!1,Fe=e.FORCE_BODY||!1,Be=!1!==e.SANITIZE_DOM,Me=!1!==e.KEEP_CONTENT,Le=e.IN_PLACE||!1,xe=e.ALLOWED_URI_REGEXP||xe,Ye=e.NAMESPACE||Ge,e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Se.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Se.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Qe=Qe=-1===et.indexOf(e.PARSER_MEDIA_TYPE)?tt:e.PARSER_MEDIA_TYPE,nt="application/xhtml+xml"===Qe?function(e){return e}:m,Te&&(Ce=!1),Ne&&(Ie=!0),ze&&(we=_({},[].concat(J($))),_e=[],!0===ze.html&&(_(we,D),_(_e,O)),!0===ze.svg&&(_(we,A),_(_e,F),_(_e,N)),!0===ze.svgFilters&&(_(we,k),_(_e,F),_(_e,N)),!0===ze.mathMl&&(_(we,P),_(_e,I),_(_e,N))),e.ADD_TAGS&&(we===Ee&&(we=j(we)),_(we,e.ADD_TAGS)),e.ADD_ATTR&&(_e===je&&(_e=j(_e)),_(_e,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&_(Je,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(Ue===qe&&(Ue=j(Ue)),_(Ue,e.FORBID_CONTENTS)),Me&&(we["#text"]=!0),$e&&_(we,["html","head","body"]),we.table&&(_(we,["tbody"]),delete De.tbody),o&&o(e),rt=e)},st=_({},["mi","mo","mn","ms","mtext"]),ct=_({},["foreignobject","desc","title","annotation-xml"]),ut=_({},A);_(ut,k),_(ut,C);var lt=_({},P);_(lt,T);var pt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ge,tagName:"template"});var n=m(e.tagName),r=m(t.tagName);if(e.namespaceURI===We)return t.namespaceURI===Ge?"svg"===n:t.namespaceURI===Xe?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(ut[n]);if(e.namespaceURI===Xe)return t.namespaceURI===Ge?"math"===n:t.namespaceURI===We?"math"===n&&ct[r]:Boolean(lt[n]);if(e.namespaceURI===Ge){if(t.namespaceURI===We&&!ct[r])return!1;if(t.namespaceURI===Xe&&!st[r])return!1;var i=_({},["title","style","font","a","script"]);return!lt[n]&&(i[n]||!ut[n])}return!1},ft=function(e){d(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=oe}catch(t){e.remove()}}},ht=function(e,t){try{d(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){d(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!_e[e])if(Ie||Ne)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},dt=function(e){var t=void 0,n=void 0;if(Fe)e=""+e;else{var r=y(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===Qe&&(e=''+e+"");var o=ie?ie.createHTML(e):e;if(Ye===Ge)try{t=(new G).parseFromString(o,Qe)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(Ye,"template",null);try{t.documentElement.innerHTML=Ze?"":o}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Ye===Ge?le.call(t,$e?"html":"body")[0]:$e?t.documentElement:a},mt=function(e){return ce.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},yt=function(e){return e instanceof W&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof E)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},gt=function(e){return"object"===(void 0===c?"undefined":V(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":V(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},vt=function(e,t,r){he[e]&&f(he[e],(function(e){e.call(n,t,r,rt)}))},bt=function(e){var t=void 0;if(vt("beforeSanitizeElements",e,null),yt(e))return ft(e),!0;if(y(e.nodeName,/[\u0080-\uFFFF]/))return ft(e),!0;var r=nt(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!gt(e.firstElementChild)&&(!gt(e.content)||!gt(e.content.firstElementChild))&&x(/<[/\w]/g,e.innerHTML)&&x(/<[/\w]/g,e.textContent))return ft(e),!0;if("select"===r&&x(/