From 0cb40eb64533f0f1625a8c98ba9160a19563e8fb Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 12 Jun 2024 11:23:22 -0400 Subject: [PATCH 1/2] style: perform schema formatting with the new JSON Schema CLI Hey there from a JSON Schema TSC and ex-Postman! We are developing an open-source CLI (https://github.com/intelligence-ai/jsonschema) specifically targeted at helping maintain repositories of schemas, just like this one. The idea is to make it super smooth to work with schemas. The tool is already capable of doing formatting, linting (which revals a couple of issues already in this repo), testing, bundling, and more, which can replace a few of the tools and scripts you already have here. Instead of sending a big PR, here is a small one just making use of formatting. The formatting implementation will re-organize keywords in a schema to make them easier to read. For example, bumping `$schema` to the top, ensuring consistent, indentation, etc. If you like it, I'd love to continue working together to integrate more things, like the linter, the schema test framework, etc. Let me know what you think and if you have any requirement or idea, please let me know and we'll happily implement it for you! We want to make it super smooth to maintain repos like this one, so any feedback is very welcomed! Signed-off-by: Juan Cruz Viotti --- .../3.0.0/APIKeyHTTPSecurityScheme.json | 28 +- .../3.0.0/BearerHTTPSecurityScheme.json | 32 +- definitions/3.0.0/HTTPSecurityScheme.json | 8 +- .../3.0.0/NonBearerHTTPSecurityScheme.json | 26 +- definitions/3.0.0/Reference.json | 10 +- definitions/3.0.0/ReferenceObject.json | 8 +- .../3.0.0/SaslGssapiSecurityScheme.json | 22 +- .../3.0.0/SaslPlainSecurityScheme.json | 18 +- .../3.0.0/SaslScramSecurityScheme.json | 18 +- definitions/3.0.0/SaslSecurityScheme.json | 8 +- definitions/3.0.0/SecurityScheme.json | 8 +- definitions/3.0.0/X509.json | 14 +- definitions/3.0.0/anySchema.json | 8 +- definitions/3.0.0/apiKey.json | 20 +- definitions/3.0.0/asymmetricEncryption.json | 18 +- definitions/3.0.0/asyncapi.json | 50 +-- definitions/3.0.0/channel.json | 117 +++---- definitions/3.0.0/channelBindingsObject.json | 318 ++++++++++-------- definitions/3.0.0/channelMessages.json | 10 +- definitions/3.0.0/channels.json | 10 +- definitions/3.0.0/components.json | 144 ++++---- definitions/3.0.0/contact.json | 26 +- definitions/3.0.0/correlationId.json | 26 +- definitions/3.0.0/externalDocs.json | 16 +- definitions/3.0.0/info.json | 79 ++--- definitions/3.0.0/infoExtensions.json | 22 +- definitions/3.0.0/license.json | 20 +- definitions/3.0.0/messageBindingsObject.json | 283 +++++++++------- definitions/3.0.0/messageExampleObject.json | 26 +- definitions/3.0.0/messageObject.json | 128 +++---- definitions/3.0.0/messageTrait.json | 122 +++---- definitions/3.0.0/messages.json | 10 +- definitions/3.0.0/multiFormatSchema.json | 85 +++-- definitions/3.0.0/oauth2Flow.json | 32 +- definitions/3.0.0/oauth2Flows.json | 56 +-- definitions/3.0.0/oauth2Scopes.json | 8 +- definitions/3.0.0/openIdConnect.json | 24 +- definitions/3.0.0/operation.json | 115 ++++--- .../3.0.0/operationBindingsObject.json | 299 +++++++++------- definitions/3.0.0/operationReply.json | 22 +- definitions/3.0.0/operationReplyAddress.json | 30 +- definitions/3.0.0/operationTrait.json | 54 +-- definitions/3.0.0/operations.json | 16 +- definitions/3.0.0/parameter.json | 32 +- definitions/3.0.0/parameters.json | 8 +- definitions/3.0.0/schema.json | 104 +++--- definitions/3.0.0/securityRequirements.json | 6 +- definitions/3.0.0/server.json | 127 +++---- definitions/3.0.0/serverBindingsObject.json | 236 +++++++------ definitions/3.0.0/serverVariable.json | 58 ++-- definitions/3.0.0/serverVariables.json | 8 +- definitions/3.0.0/servers.json | 8 +- definitions/3.0.0/specificationExtension.json | 8 +- definitions/3.0.0/symmetricEncryption.json | 14 +- definitions/3.0.0/tag.json | 22 +- definitions/3.0.0/userPassword.json | 14 +- package-lock.json | 10 + package.json | 3 +- 58 files changed, 1622 insertions(+), 1430 deletions(-) diff --git a/definitions/3.0.0/APIKeyHTTPSecurityScheme.json b/definitions/3.0.0/APIKeyHTTPSecurityScheme.json index 33dee593..4c90c5d2 100644 --- a/definitions/3.0.0/APIKeyHTTPSecurityScheme.json +++ b/definitions/3.0.0/APIKeyHTTPSecurityScheme.json @@ -1,4 +1,6 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json", "type": "object", "required": [ "type", @@ -6,29 +8,29 @@ "in" ], "properties": { + "description": { + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, "type": { - "type": "string", "description": "The type of the security scheme.", + "type": "string", "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", + "type": "string", "enum": [ "header", "query", "cookie" ] }, - "description": { - "type": "string", - "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + "name": { + "description": "The name of the header, query or cookie parameter to be used.", + "type": "string" } }, "patternProperties": { @@ -36,10 +38,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/APIKeyHTTPSecurityScheme.json" - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json" -} \ No newline at end of file + } +} diff --git a/definitions/3.0.0/BearerHTTPSecurityScheme.json b/definitions/3.0.0/BearerHTTPSecurityScheme.json index 3f71902b..631eef28 100644 --- a/definitions/3.0.0/BearerHTTPSecurityScheme.json +++ b/definitions/3.0.0/BearerHTTPSecurityScheme.json @@ -1,31 +1,33 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json", "type": "object", "required": [ "type", "scheme" ], "properties": { - "scheme": { + "description": { + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme.", "type": "string", - "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", "enum": [ - "bearer" + "http" ] }, "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." + "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": "string" }, - "type": { + "scheme": { + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", "type": "string", - "description": "The type of the security scheme.", "enum": [ - "http" + "bearer" ] - }, - "description": { - "type": "string", - "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -33,7 +35,5 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json" -} \ No newline at end of file + "additionalProperties": false +} diff --git a/definitions/3.0.0/HTTPSecurityScheme.json b/definitions/3.0.0/HTTPSecurityScheme.json index c75d7b50..37e1e6e1 100644 --- a/definitions/3.0.0/HTTPSecurityScheme.json +++ b/definitions/3.0.0/HTTPSecurityScheme.json @@ -1,4 +1,6 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json", "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json" @@ -9,7 +11,5 @@ { "$ref": "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json" } - ], - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json" -} \ No newline at end of file + ] +} diff --git a/definitions/3.0.0/NonBearerHTTPSecurityScheme.json b/definitions/3.0.0/NonBearerHTTPSecurityScheme.json index 3f1a8d76..c9049329 100644 --- a/definitions/3.0.0/NonBearerHTTPSecurityScheme.json +++ b/definitions/3.0.0/NonBearerHTTPSecurityScheme.json @@ -1,36 +1,38 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json", + "type": "object", "not": { "type": "object", "properties": { "scheme": { - "type": "string", "description": "A short description for security scheme.", + "type": "string", "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." + "description": "A short description for security scheme.", + "type": "string" }, "type": { - "type": "string", "description": "The type of the security scheme.", + "type": "string", "enum": [ "http" ] + }, + "scheme": { + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + "type": "string" } }, "patternProperties": { @@ -38,7 +40,5 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json" -} \ No newline at end of file + "additionalProperties": false +} diff --git a/definitions/3.0.0/Reference.json b/definitions/3.0.0/Reference.json index 78f41b69..99de7ffb 100644 --- a/definitions/3.0.0/Reference.json +++ b/definitions/3.0.0/Reference.json @@ -1,6 +1,8 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/Reference.json", "description": "A simple object to allow referencing other components in the specification, internally and externally.", + "type": "object", "required": [ "$ref" ], @@ -12,7 +14,5 @@ }, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/ReferenceObject.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/Reference.json" -} \ No newline at end of file + } +} diff --git a/definitions/3.0.0/ReferenceObject.json b/definitions/3.0.0/ReferenceObject.json index c58008a4..6dab2af1 100644 --- a/definitions/3.0.0/ReferenceObject.json +++ b/definitions/3.0.0/ReferenceObject.json @@ -1,6 +1,6 @@ { - "type": "string", - "format": "uri-reference", "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" -} \ No newline at end of file + "$id": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json", + "type": "string", + "format": "uri-reference" +} diff --git a/definitions/3.0.0/SaslGssapiSecurityScheme.json b/definitions/3.0.0/SaslGssapiSecurityScheme.json index eb65dcc8..e17231b6 100644 --- a/definitions/3.0.0/SaslGssapiSecurityScheme.json +++ b/definitions/3.0.0/SaslGssapiSecurityScheme.json @@ -1,19 +1,21 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json", "type": "object", "required": [ "type" ], "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, "type": { - "type": "string", "description": "The type of the security scheme.", + "type": "string", "enum": [ "gssapi" ] - }, - "description": { - "type": "string", - "description": "A short description for security scheme." } }, "patternProperties": { @@ -21,10 +23,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "example": { - "$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" - }, "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json" -} \ No newline at end of file + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" + } +} diff --git a/definitions/3.0.0/SaslPlainSecurityScheme.json b/definitions/3.0.0/SaslPlainSecurityScheme.json index e461874f..fd24e27a 100644 --- a/definitions/3.0.0/SaslPlainSecurityScheme.json +++ b/definitions/3.0.0/SaslPlainSecurityScheme.json @@ -1,19 +1,21 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json", "type": "object", "required": [ "type" ], "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, "type": { - "type": "string", "description": "The type of the security scheme. Valid values", + "type": "string", "enum": [ "plain" ] - }, - "description": { - "type": "string", - "description": "A short description for security scheme." } }, "patternProperties": { @@ -21,10 +23,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json" + } } diff --git a/definitions/3.0.0/SaslScramSecurityScheme.json b/definitions/3.0.0/SaslScramSecurityScheme.json index 6d1f850b..0935be84 100644 --- a/definitions/3.0.0/SaslScramSecurityScheme.json +++ b/definitions/3.0.0/SaslScramSecurityScheme.json @@ -1,20 +1,22 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json", "type": "object", "required": [ "type" ], "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, "type": { - "type": "string", "description": "The type of the security scheme.", + "type": "string", "enum": [ "scramSha256", "scramSha512" ] - }, - "description": { - "type": "string", - "description": "A short description for security scheme." } }, "patternProperties": { @@ -22,10 +24,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json" + } } diff --git a/definitions/3.0.0/SaslSecurityScheme.json b/definitions/3.0.0/SaslSecurityScheme.json index 4688e223..daba1b7b 100644 --- a/definitions/3.0.0/SaslSecurityScheme.json +++ b/definitions/3.0.0/SaslSecurityScheme.json @@ -1,4 +1,6 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json", "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json" @@ -9,7 +11,5 @@ { "$ref": "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json" } - ], - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json" -} \ No newline at end of file + ] +} diff --git a/definitions/3.0.0/SecurityScheme.json b/definitions/3.0.0/SecurityScheme.json index 83573217..dbb58aa9 100644 --- a/definitions/3.0.0/SecurityScheme.json +++ b/definitions/3.0.0/SecurityScheme.json @@ -1,4 +1,6 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json", "description": "Defines a security scheme that can be used by the operations.", "oneOf": [ { @@ -31,7 +33,5 @@ ], "example": { "$ref": "http://asyncapi.com/examples/3.0.0/SecurityScheme.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" -} \ No newline at end of file + } +} diff --git a/definitions/3.0.0/X509.json b/definitions/3.0.0/X509.json index 004db984..b67806b8 100644 --- a/definitions/3.0.0/X509.json +++ b/definitions/3.0.0/X509.json @@ -1,17 +1,19 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/X509.json", "type": "object", "required": [ "type" ], "properties": { + "description": { + "type": "string" + }, "type": { "type": "string", "enum": [ "X509" ] - }, - "description": { - "type": "string" } }, "patternProperties": { @@ -19,10 +21,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/X509.json" - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/X509.json" + } } diff --git a/definitions/3.0.0/anySchema.json b/definitions/3.0.0/anySchema.json index 4a0bf239..a3964b6b 100644 --- a/definitions/3.0.0/anySchema.json +++ b/definitions/3.0.0/anySchema.json @@ -1,4 +1,7 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json", + "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.", "if": { "required": [ "schema" @@ -9,8 +12,5 @@ }, "else": { "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - }, - "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.", - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + } } diff --git a/definitions/3.0.0/apiKey.json b/definitions/3.0.0/apiKey.json index daec7eaf..7e7ca2f2 100644 --- a/definitions/3.0.0/apiKey.json +++ b/definitions/3.0.0/apiKey.json @@ -1,28 +1,30 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/apiKey.json", "type": "object", "required": [ "type", "in" ], "properties": { + "description": { + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, "type": { - "type": "string", "description": "The type of the security scheme", + "type": "string", "enum": [ "apiKey" ] }, "in": { - "type": "string", "description": " The location of the API key.", + "type": "string", "enum": [ "user", "password" ] - }, - "description": { - "type": "string", - "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -30,10 +32,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/apiKey.json" - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/apiKey.json" + } } diff --git a/definitions/3.0.0/asymmetricEncryption.json b/definitions/3.0.0/asymmetricEncryption.json index b52c5dff..5dace2fc 100644 --- a/definitions/3.0.0/asymmetricEncryption.json +++ b/definitions/3.0.0/asymmetricEncryption.json @@ -1,19 +1,21 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json", "type": "object", "required": [ "type" ], "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, "type": { - "type": "string", "description": "The type of the security scheme.", + "type": "string", "enum": [ "asymmetricEncryption" ] - }, - "description": { - "type": "string", - "description": "A short description for security scheme." } }, "patternProperties": { @@ -21,7 +23,5 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json" -} \ No newline at end of file + "additionalProperties": false +} diff --git a/definitions/3.0.0/asyncapi.json b/definitions/3.0.0/asyncapi.json index 0af21643..53824f37 100644 --- a/definitions/3.0.0/asyncapi.json +++ b/definitions/3.0.0/asyncapi.json @@ -1,47 +1,47 @@ { - "title": "AsyncAPI 3.0.0 schema.", "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/asyncapi.json", + "title": "AsyncAPI 3.0.0 schema.", "type": "object", "required": [ "asyncapi", "info" ], - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, "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.", + "type": "string", "format": "uri" }, - "info": { - "$ref": "http://asyncapi.com/definitions/3.0.0/info.json" - }, - "servers": { - "$ref": "http://asyncapi.com/definitions/3.0.0/servers.json" - }, - "defaultContentType": { + "asyncapi": { + "description": "The AsyncAPI specification version of this document.", "type": "string", - "description": "Default content type to use when encoding/decoding a message's payload." + "const": "3.0.0" }, "channels": { "$ref": "http://asyncapi.com/definitions/3.0.0/channels.json" }, + "components": { + "$ref": "http://asyncapi.com/definitions/3.0.0/components.json" + }, + "defaultContentType": { + "description": "Default content type to use when encoding/decoding a message's payload.", + "type": "string" + }, + "info": { + "$ref": "http://asyncapi.com/definitions/3.0.0/info.json" + }, "operations": { "$ref": "http://asyncapi.com/definitions/3.0.0/operations.json" }, - "components": { - "$ref": "http://asyncapi.com/definitions/3.0.0/components.json" + "servers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/servers.json" } - } -} \ No newline at end of file + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false +} diff --git a/definitions/3.0.0/channel.json b/definitions/3.0.0/channel.json index 35567b6d..9f9b206d 100644 --- a/definitions/3.0.0/channel.json +++ b/definitions/3.0.0/channel.json @@ -1,16 +1,43 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/channel.json", "description": "Describes a shared communication channel.", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "properties": { + "title": { + "description": "A human-friendly title for the channel.", + "type": "string" + }, + "description": { + "description": "A longer description of the channel. CommonMark is allowed.", + "type": "string" + }, "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." + "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.", + "type": [ + "string", + "null" + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" + } + ] + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] }, "messages": { "$ref": "http://asyncapi.com/definitions/3.0.0/channelMessages.json" @@ -18,65 +45,41 @@ "parameters": { "$ref": "http://asyncapi.com/definitions/3.0.0/parameters.json" }, - "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.", + "type": "array", + "uniqueItems": true, "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - "uniqueItems": true + } + }, + "summary": { + "description": "A brief summary of the channel.", + "type": "string" }, "tags": { - "type": "array", "description": "A list of tags for logical grouping of channels.", + "type": "array", + "uniqueItems": true, "items": { "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" - } - ] - }, - "uniqueItems": true - }, - "externalDocs": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" - } - ] - }, - "bindings": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" - } - ] + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + } } }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/channel.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/channel.json" + } } diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index 54466b49..14f5c90a 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -1,20 +1,10 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json", "description": "Map describing protocol-specific definitions for a channel.", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "properties": { - "http": {}, - "ws": { - "properties": { - "bindingVersion": { - "enum": ["0.1.0"] - } - }, + "amqp": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -26,30 +16,35 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.3.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" } } - ] - }, - "amqp": { + ], "properties": { "bindingVersion": { - "enum": ["0.3.0"] + "enum": [ + "0.3.0" + ] } - }, + } + }, + "amqp1": {}, + "anypointmq": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -61,32 +56,34 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.3.0" + "const": "0.0.1" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" } } - ] - }, - "amqp1": {}, - "mqtt": {}, - "kafka": { + ], "properties": { "bindingVersion": { - "enum": ["0.5.0", "0.4.0", "0.3.0"] + "enum": [ + "0.0.1" + ] } - }, + } + }, + "googlepubsub": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -98,56 +95,74 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.5.0" + "const": "0.2.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" } - }, + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "http": {}, + "ibmmq": { + "allOf": [ { + "description": "If no bindingVersion specified, use the latest binding", "if": { - "required": [ "bindingVersion" ], - "properties": { - "bindingVersion": { - "const": "0.4.0" - } + "not": { + "required": [ + "bindingVersion" + ] } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/channel.json" + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.3.0" + "const": "0.1.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/channel.json" + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" } } - ] - }, - "anypointmq": { + ], "properties": { "bindingVersion": { - "enum": ["0.0.1"] + "enum": [ + "0.1.0" + ] } - }, + } + }, + "jms": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -159,31 +174,34 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.0.1" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/channel.json" } } - ] - }, - "nats": {}, - "jms": { + ], "properties": { "bindingVersion": { - "enum": ["0.0.1"] + "enum": [ + "0.0.1" + ] } - }, + } + }, + "kafka": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -195,65 +213,68 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/jms/0.0.1/channel.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.0.1" + "const": "0.5.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/jms/0.0.1/channel.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" } - } - ] - }, - "sns": { - "properties": { - "bindingVersion": { - "enum": ["0.1.0"] - } - }, - "allOf": [ + }, { - "description": "If no bindingVersion specified, use the latest binding", "if": { - "not": { - "required": [ - "bindingVersion" - ] + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } } }, "then": { - "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.3.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/channel.json" } } - ] - }, - "sqs": { + ], "properties": { "bindingVersion": { - "enum": ["0.2.0"] + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] } - }, + } + }, + "mqtt": {}, + "nats": {}, + "pulsar": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -265,32 +286,35 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.2.0" + "const": "0.1.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" } } - ] - }, - "stomp": {}, - "redis": {}, - "ibmmq": { + ], "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": [ + "0.1.0" + ] } - }, + } + }, + "redis": {}, + "sns": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -302,31 +326,35 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.1.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json" } } - ] - }, - "solace": {}, - "googlepubsub": { + ], "properties": { "bindingVersion": { - "enum": ["0.2.0"] + "enum": [ + "0.1.0" + ] } - }, + } + }, + "solace": {}, + "sqs": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -338,30 +366,35 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.2.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" } } - ] - }, - "pulsar": { + ], "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": [ + "0.2.0" + ] } - }, + } + }, + "stomp": {}, + "ws": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -373,25 +406,38 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.1.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" } } - ] + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } } }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" -} \ No newline at end of file + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false +} diff --git a/definitions/3.0.0/channelMessages.json b/definitions/3.0.0/channelMessages.json index 212ab610..c8f891b4 100644 --- a/definitions/3.0.0/channelMessages.json +++ b/definitions/3.0.0/channelMessages.json @@ -1,4 +1,7 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/channelMessages.json", + "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.**", "type": "object", "additionalProperties": { "oneOf": [ @@ -9,8 +12,5 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" } ] - }, - "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.**", - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/channelMessages.json" -} \ No newline at end of file + } +} diff --git a/definitions/3.0.0/channels.json b/definitions/3.0.0/channels.json index 4169cfc3..e6e4968a 100644 --- a/definitions/3.0.0/channels.json +++ b/definitions/3.0.0/channels.json @@ -1,19 +1,19 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/channels.json", "description": "An object containing all the Channel Object definitions the Application MUST use during runtime.", + "type": "object", "additionalProperties": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" } ] }, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/channels.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/channels.json" + } } diff --git a/definitions/3.0.0/components.json b/definitions/3.0.0/components.json index 2243d978..244985f2 100644 --- a/definitions/3.0.0/components.json +++ b/definitions/3.0.0/components.json @@ -1,25 +1,12 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/components.json", "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": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "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\\.\\-_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" - } - } - }, - "servers": { + "channelBindings": { + "description": "An object to hold reusable Channel Bindings Objects.", "type": "object", - "description": "An object to hold reusable Server Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -27,31 +14,31 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/server.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" } ] } } }, "channels": { - "type": "object", "description": "An object to hold reusable Channel Objects.", + "type": "object", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" } ] } } }, - "serverVariables": { + "correlationIds": { + "description": "An object to hold reusable Correlation ID Objects.", "type": "object", - "description": "An object to hold reusable Server Variable Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -59,13 +46,14 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariable.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" } ] } } }, - "operations": { + "externalDocs": { + "description": "An object to hold reusable External Documentation Objects.", "type": "object", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { @@ -74,15 +62,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" } ] } } }, - "messages": { + "messageBindings": { + "description": "An object to hold reusable Message Bindings Objects.", "type": "object", - "description": "An object to hold reusable Message Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -90,15 +78,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" } ] } } }, - "securitySchemes": { + "messageTraits": { + "description": "An object to hold reusable Message Trait Objects.", "type": "object", - "description": "An object to hold reusable Security Scheme Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -106,15 +94,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" } ] } } }, - "parameters": { + "messages": { + "description": "An object to hold reusable Message Objects.", "type": "object", - "description": "An object to hold reusable Parameter Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -122,15 +110,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/parameter.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" } ] } } }, - "correlationIds": { + "operationBindings": { + "description": "An object to hold reusable Operation Bindings Objects.", "type": "object", - "description": "An object to hold reusable Correlation ID Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -138,15 +126,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" } ] } } }, "operationTraits": { - "type": "object", "description": "An object to hold reusable Operation Trait Objects.", + "type": "object", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -160,9 +148,8 @@ } } }, - "messageTraits": { + "operations": { "type": "object", - "description": "An object to hold reusable Message Trait Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -170,15 +157,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" } ] } } }, - "replies": { + "parameters": { + "description": "An object to hold reusable Parameter Objects.", "type": "object", - "description": "An object to hold reusable Operation Reply Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -186,15 +173,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationReply.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/parameter.json" } ] } } }, - "replyAddresses": { + "replies": { + "description": "An object to hold reusable Operation Reply Objects.", "type": "object", - "description": "An object to hold reusable Operation Reply Address Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -202,15 +189,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReply.json" } ] } } }, - "serverBindings": { + "replyAddresses": { + "description": "An object to hold reusable Operation Reply Address Objects.", "type": "object", - "description": "An object to hold reusable Server Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -218,15 +205,24 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" } ] } } }, - "channelBindings": { + "schemas": { + "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.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + } + } + }, + "securitySchemes": { + "description": "An object to hold reusable Security Scheme Objects.", "type": "object", - "description": "An object to hold reusable Channel Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -234,15 +230,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" } ] } } }, - "operationBindings": { + "serverBindings": { + "description": "An object to hold reusable Server Bindings Objects.", "type": "object", - "description": "An object to hold reusable Operation Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -250,15 +246,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" } ] } } }, - "messageBindings": { + "serverVariables": { + "description": "An object to hold reusable Server Variable Objects.", "type": "object", - "description": "An object to hold reusable Message Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -266,15 +262,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariable.json" } ] } } }, - "tags": { + "servers": { + "description": "An object to hold reusable Server Objects.", "type": "object", - "description": "An object to hold reusable Tag Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -282,15 +278,15 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/server.json" } ] } } }, - "externalDocs": { + "tags": { + "description": "An object to hold reusable Tag Objects.", "type": "object", - "description": "An object to hold reusable External Documentation Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -298,16 +294,20 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" } ] } } } }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/components.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/components.json" + } } diff --git a/definitions/3.0.0/contact.json b/definitions/3.0.0/contact.json index 5356d4e2..c8bb89f1 100644 --- a/definitions/3.0.0/contact.json +++ b/definitions/3.0.0/contact.json @@ -1,21 +1,22 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/contact.json", "description": "Contact information for the exposed API.", - "additionalProperties": false, + "type": "object", "properties": { - "name": { + "email": { + "description": "The email address of the contact person/organization.", "type": "string", - "description": "The identifying name of the contact person/organization." + "format": "email" + }, + "name": { + "description": "The identifying name of the contact person/organization.", + "type": "string" }, "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" + "format": "uri" } }, "patternProperties": { @@ -23,9 +24,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/contact.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/contact.json" + } } diff --git a/definitions/3.0.0/correlationId.json b/definitions/3.0.0/correlationId.json index 18aa99a2..e22c604c 100644 --- a/definitions/3.0.0/correlationId.json +++ b/definitions/3.0.0/correlationId.json @@ -1,29 +1,29 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/correlationId.json", "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.", + "type": "object", "required": [ "location" ], - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, "properties": { "description": { - "type": "string", - "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed.", + "type": "string" }, "location": { - "type": "string", "description": "A runtime expression that specifies the location of the correlation ID", + "type": "string", "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" } }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/correlationId.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/correlationId.json" + } } diff --git a/definitions/3.0.0/externalDocs.json b/definitions/3.0.0/externalDocs.json index 3ab83718..9b91161e 100644 --- a/definitions/3.0.0/externalDocs.json +++ b/definitions/3.0.0/externalDocs.json @@ -1,18 +1,19 @@ { - "type": "object", - "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/externalDocs.json", "description": "Allows referencing an external resource for extended documentation.", + "type": "object", "required": [ "url" ], "properties": { "description": { - "type": "string", - "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation." + "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation.", + "type": "string" }, "url": { - "type": "string", "description": "The URL for the target documentation. This MUST be in the form of an absolute URL.", + "type": "string", "format": "uri" } }, @@ -21,9 +22,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/externalDocs.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } } diff --git a/definitions/3.0.0/info.json b/definitions/3.0.0/info.json index 034eb5ab..3c86280f 100644 --- a/definitions/3.0.0/info.json +++ b/definitions/3.0.0/info.json @@ -1,42 +1,43 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/info.json", "description": "The object provides metadata about the API. The metadata can be used by the clients if needed.", "allOf": [ - { + { "type": "object", - "required": ["version", "title"], - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "required": [ + "version", + "title" + ], "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": "A unique and precise title of the API.", + "type": "string" }, "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" + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed.", + "type": "string" }, "contact": { "$ref": "http://asyncapi.com/definitions/3.0.0/contact.json" }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, "license": { "$ref": "http://asyncapi.com/definitions/3.0.0/license.json" }, "tags": { - "type": "array", "description": "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", + "type": "array", + "uniqueItems": true, "items": { "oneOf": [ { @@ -46,20 +47,24 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" } ] - }, - "uniqueItems": true + } }, - "externalDocs": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" - } - ] + "termsOfService": { + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "type": "string", + "format": "uri" + }, + "version": { + "description": "A semantic version number of the API.", + "type": "string" } - } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false }, { "$ref": "http://asyncapi.com/definitions/3.0.0/infoExtensions.json" @@ -67,7 +72,5 @@ ], "example": { "$ref": "http://asyncapi.com/examples/3.0.0/info.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/info.json" -} \ No newline at end of file + } +} diff --git a/definitions/3.0.0/infoExtensions.json b/definitions/3.0.0/infoExtensions.json index 0c7f505f..20aecb35 100644 --- a/definitions/3.0.0/infoExtensions.json +++ b/definitions/3.0.0/infoExtensions.json @@ -1,14 +1,14 @@ { - "type": "object", - "description": "The object that lists all the extensions of Info", - "properties": { - "x-x":{ - "$ref": "http://asyncapi.com/extensions/x/0.1.0/schema.json" - }, - "x-linkedin":{ - "$ref": "http://asyncapi.com/extensions/linkedin/0.1.0/schema.json" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/infoExtensions.json", + "description": "The object that lists all the extensions of Info", + "type": "object", + "properties": { + "x-linkedin": { + "$ref": "http://asyncapi.com/extensions/linkedin/0.1.0/schema.json" }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/infoExtensions.json" + "x-x": { + "$ref": "http://asyncapi.com/extensions/x/0.1.0/schema.json" + } + } } diff --git a/definitions/3.0.0/license.json b/definitions/3.0.0/license.json index 06a5518e..23325532 100644 --- a/definitions/3.0.0/license.json +++ b/definitions/3.0.0/license.json @@ -1,26 +1,28 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/license.json", "type": "object", - "required": ["name"], - "additionalProperties": false, + "required": [ + "name" + ], "properties": { "name": { - "type": "string", - "description": "The name of the license type. It's encouraged to use an OSI compatible license." + "description": "The name of the license type. It's encouraged to use an OSI compatible license.", + "type": "string" }, "url": { - "type": "string", "description": "The URL pointing to the license.", + "type": "string", "format": "uri" } }, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/license.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/license.json" + } } diff --git a/definitions/3.0.0/messageBindingsObject.json b/definitions/3.0.0/messageBindingsObject.json index 1ba3c582..c3dc6d8e 100644 --- a/definitions/3.0.0/messageBindingsObject.json +++ b/definitions/3.0.0/messageBindingsObject.json @@ -1,19 +1,10 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json", "description": "Map describing protocol-specific definitions for a message.", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "properties": { - "http": { - "properties": { - "bindingVersion": { - "enum": ["0.2.0", "0.3.0"] - } - }, + "amqp": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -25,44 +16,35 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/http/0.3.0/message.json" - } - }, - { - "if": { - "required": [ "bindingVersion" ], - "properties": { - "bindingVersion": { - "const": "0.2.0" - } - } - }, - "then": { - "$ref": "http://asyncapi.com/bindings/http/0.2.0/message.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/message.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.3.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/http/0.3.0/message.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/message.json" } } - ] - }, - "ws": {}, - "amqp": { + ], "properties": { "bindingVersion": { - "enum": ["0.3.0"] + "enum": [ + "0.3.0" + ] } - }, + } + }, + "amqp1": {}, + "anypointmq": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -74,31 +56,34 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/message.json" + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.3.0" + "const": "0.0.1" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/message.json" + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" } } - ] - }, - "amqp1": {}, - "mqtt": { + ], "properties": { "bindingVersion": { - "enum": ["0.2.0"] + "enum": [ + "0.0.1" + ] } - }, + } + }, + "googlepubsub": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -110,30 +95,34 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.2.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" } } - ] - }, - "kafka": { + ], "properties": { "bindingVersion": { - "enum": ["0.5.0", "0.4.0", "0.3.0"] + "enum": [ + "0.2.0" + ] } - }, + } + }, + "http": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -145,56 +134,50 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/message.json" + "$ref": "http://asyncapi.com/bindings/http/0.3.0/message.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.5.0" + "const": "0.2.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/message.json" - } - }, - { - "if": { - "required": [ "bindingVersion" ], - "properties": { - "bindingVersion": { - "const": "0.4.0" - } - } - }, - "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/message.json" + "$ref": "http://asyncapi.com/bindings/http/0.2.0/message.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.3.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/message.json" + "$ref": "http://asyncapi.com/bindings/http/0.3.0/message.json" } } - ] - }, - "anypointmq": { + ], "properties": { "bindingVersion": { - "enum": ["0.0.1"] + "enum": [ + "0.2.0", + "0.3.0" + ] } - }, + } + }, + "ibmmq": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -206,31 +189,34 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.0.1" + "const": "0.1.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" } } - ] - }, - "nats": {}, - "jms": { + ], "properties": { "bindingVersion": { - "enum": ["0.0.1"] + "enum": [ + "0.1.0" + ] } - }, + } + }, + "jms": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -247,29 +233,29 @@ }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.0.1" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/jms/0.0.1/message.json" } } - ] - }, - "sns": {}, - "sqs": {}, - "stomp": {}, - "redis": {}, - "ibmmq": { + ], "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": [ + "0.0.1" + ] } - }, + } + }, + "kafka": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -281,31 +267,66 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/message.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.5.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/message.json" } } - ] - }, - "solace": {}, - "googlepubsub": { + ], "properties": { "bindingVersion": { - "enum": ["0.2.0"] + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] } - }, + } + }, + "mqtt": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -317,25 +338,45 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.2.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" } } - ] + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "nats": {}, + "redis": {}, + "sns": {}, + "solace": {}, + "sqs": {}, + "stomp": {}, + "ws": {} + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + "additionalProperties": false } diff --git a/definitions/3.0.0/messageExampleObject.json b/definitions/3.0.0/messageExampleObject.json index 3a59ffcf..7c6cc676 100644 --- a/definitions/3.0.0/messageExampleObject.json +++ b/definitions/3.0.0/messageExampleObject.json @@ -1,6 +1,7 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json", "type": "object", - "additionalProperties": false, "anyOf": [ { "required": [ @@ -14,22 +15,21 @@ } ], "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." + "description": "Example of the application headers. It can be of any type.", + "type": "object" + }, + "name": { + "description": "Machine readable name of the message example.", + "type": "string" }, "payload": { "description": "Example of the message payload. It can be of any type." + }, + "summary": { + "description": "A brief summary of the message example.", + "type": "string" } }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" + "additionalProperties": false } diff --git a/definitions/3.0.0/messageObject.json b/definitions/3.0.0/messageObject.json index f8cd37bb..afa722dc 100644 --- a/definitions/3.0.0/messageObject.json +++ b/definitions/3.0.0/messageObject.json @@ -1,97 +1,93 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/messageObject.json", "description": "Describes a message received on a given channel and operation.", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "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." + "title": { + "description": "A human-friendly title for the message.", + "type": "string" }, - "headers": { - "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + "description": { + "description": "A longer description of the message. CommonMark is allowed.", + "type": "string" }, - "payload": { - "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + "examples": { + "description": "List of examples.", + "type": "array", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" + } }, - "correlationId": { + "deprecated": { + "default": false, + "type": "boolean" + }, + "bindings": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" } ] }, - "tags": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" - } - ] - }, - "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." + "contentType": { + "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.", + "type": "string" }, - "externalDocs": { + "correlationId": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" } ] }, - "deprecated": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "description": "List of examples.", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" - } - }, - "bindings": { + "externalDocs": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" } ] }, - "traits": { + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + }, + "name": { + "description": "Name of the message.", + "type": "string" + }, + "payload": { + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + }, + "summary": { + "description": "A brief summary of the message.", + "type": "string" + }, + "tags": { "type": "array", + "uniqueItems": true, + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + } + }, + "traits": { "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.", + "type": "array", "items": { "oneOf": [ { @@ -123,9 +119,13 @@ } } }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/messageObject.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/messageObject.json" + } } diff --git a/definitions/3.0.0/messageTrait.json b/definitions/3.0.0/messageTrait.json index 3e5d4829..8f917ea0 100644 --- a/definitions/3.0.0/messageTrait.json +++ b/definitions/3.0.0/messageTrait.json @@ -1,95 +1,95 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/messageTrait.json", "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": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "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." + "title": { + "description": "A human-friendly title for the message.", + "type": "string" }, - "headers": { - "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + "description": { + "description": "A longer description of the message. CommonMark is allowed.", + "type": "string" }, - "correlationId": { + "examples": { + "description": "List of examples.", + "type": "array", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" + } + }, + "deprecated": { + "default": false, + "type": "boolean" + }, + "bindings": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" } ] }, - "tags": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" - } - ] - }, - "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." + "contentType": { + "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.", + "type": "string" }, - "externalDocs": { + "correlationId": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" } ] }, - "deprecated": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "description": "List of examples.", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" - } - }, - "bindings": { + "externalDocs": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" } ] + }, + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" + }, + "name": { + "description": "Name of the message.", + "type": "string" + }, + "summary": { + "description": "A brief summary of the message.", + "type": "string" + }, + "tags": { + "type": "array", + "uniqueItems": true, + "items": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + } } }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/messageTrait.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" + } } diff --git a/definitions/3.0.0/messages.json b/definitions/3.0.0/messages.json index f244339e..b0618ff7 100644 --- a/definitions/3.0.0/messages.json +++ b/definitions/3.0.0/messages.json @@ -1,4 +1,7 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/messages.json", + "description": "JSON objects describing the messages being consumed and produced by the API.", "type": "object", "additionalProperties": { "oneOf": [ @@ -9,8 +12,5 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" } ] - }, - "description": "JSON objects describing the messages being consumed and produced by the API.", - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/messages.json" -} \ No newline at end of file + } +} diff --git a/definitions/3.0.0/multiFormatSchema.json b/definitions/3.0.0/multiFormatSchema.json index 077cdcf6..d9334d5c 100644 --- a/definitions/3.0.0/multiFormatSchema.json +++ b/definitions/3.0.0/multiFormatSchema.json @@ -1,11 +1,8 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json", "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.).", "type": "object", - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, "if": { "not": { "type": "object" @@ -15,41 +12,6 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" }, "else": { - "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" - ] - } - ] - } - }, "allOf": [ { "if": { @@ -195,8 +157,43 @@ } } } - ] + ], + "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": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json" -} \ No newline at end of file + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + } +} diff --git a/definitions/3.0.0/oauth2Flow.json b/definitions/3.0.0/oauth2Flow.json index ef1e7c95..694a4e26 100644 --- a/definitions/3.0.0/oauth2Flow.json +++ b/definitions/3.0.0/oauth2Flow.json @@ -1,25 +1,27 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json", "description": "Configuration details for a supported OAuth Flow", + "type": "object", "properties": { "authorizationUrl": { + "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL.", "type": "string", - "format": "uri", - "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + "format": "uri" }, - "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." + "availableScopes": { + "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.", + "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json" }, "refreshUrl": { + "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL.", "type": "string", - "format": "uri", - "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + "format": "uri" }, - "availableScopes": { - "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json", - "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it." + "tokenUrl": { + "description": "The token URL to be used for this flow. This MUST be in the form of an absolute URL.", + "type": "string", + "format": "uri" } }, "patternProperties": { @@ -27,10 +29,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/oauth2Flow.json" - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" + } } diff --git a/definitions/3.0.0/oauth2Flows.json b/definitions/3.0.0/oauth2Flows.json index 3cb9cecf..99e1d2fe 100644 --- a/definitions/3.0.0/oauth2Flows.json +++ b/definitions/3.0.0/oauth2Flows.json @@ -1,27 +1,29 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json", "description": "Allows configuration of the supported OAuth Flows.", + "type": "object", "required": [ "type", "flows" ], "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, "type": { - "type": "string", "description": "The type of the security scheme.", + "type": "string", "enum": [ "oauth2" ] }, - "description": { - "type": "string", - "description": "A short description for security scheme." - }, "flows": { "type": "object", "properties": { - "implicit": { - "description": "Configuration for the OAuth Implicit flow.", + "authorizationCode": { + "description": "Configuration for the OAuth Authorization Code flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -29,20 +31,14 @@ { "required": [ "authorizationUrl", + "tokenUrl", "availableScopes" ] - }, - { - "not": { - "required": [ - "tokenUrl" - ] - } } ] }, - "password": { - "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", + "clientCredentials": { + "description": "Configuration for the OAuth Client Credentials flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -62,39 +58,45 @@ } ] }, - "clientCredentials": { - "description": "Configuration for the OAuth Client Credentials flow.", + "implicit": { + "description": "Configuration for the OAuth Implicit flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" }, { "required": [ - "tokenUrl", + "authorizationUrl", "availableScopes" ] }, { "not": { "required": [ - "authorizationUrl" + "tokenUrl" ] } } ] }, - "authorizationCode": { - "description": "Configuration for the OAuth Authorization Code flow.", + "password": { + "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" }, { "required": [ - "authorizationUrl", "tokenUrl", "availableScopes" ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } } ] } @@ -102,8 +104,8 @@ "additionalProperties": false }, "scopes": { - "type": "array", "description": "List of the needed scope names.", + "type": "array", "items": { "type": "string" } @@ -113,7 +115,5 @@ "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json" + } } diff --git a/definitions/3.0.0/oauth2Scopes.json b/definitions/3.0.0/oauth2Scopes.json index 4e26a71e..f412c97b 100644 --- a/definitions/3.0.0/oauth2Scopes.json +++ b/definitions/3.0.0/oauth2Scopes.json @@ -1,8 +1,8 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json", "type": "object", "additionalProperties": { "type": "string" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json" -} \ No newline at end of file + } +} diff --git a/definitions/3.0.0/openIdConnect.json b/definitions/3.0.0/openIdConnect.json index 41b65f5d..dbc090ab 100644 --- a/definitions/3.0.0/openIdConnect.json +++ b/definitions/3.0.0/openIdConnect.json @@ -1,29 +1,31 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/openIdConnect.json", "type": "object", "required": [ "type", "openIdConnectUrl" ], "properties": { + "description": { + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, "type": { - "type": "string", "description": "The type of the security scheme.", + "type": "string", "enum": [ "openIdConnect" ] }, - "description": { - "type": "string", - "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." - }, "openIdConnectUrl": { + "description": "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL.", "type": "string", - "format": "uri", - "description": "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL." + "format": "uri" }, "scopes": { - "type": "array", "description": "List of the needed scope names. An empty array means no scopes are needed.", + "type": "array", "items": { "type": "string" } @@ -34,7 +36,5 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/openIdConnect.json" -} \ No newline at end of file + "additionalProperties": false +} diff --git a/definitions/3.0.0/operation.json b/definitions/3.0.0/operation.json index 529cfbc5..8c51d8a0 100644 --- a/definitions/3.0.0/operation.json +++ b/definitions/3.0.0/operation.json @@ -1,28 +1,55 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/operation.json", "description": "Describes a specific operation.", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "required": [ "action", "channel" ], "properties": { + "title": { + "description": "A human-friendly title for the operation.", + "type": "string" + }, + "description": { + "description": "A longer description of the operation. CommonMark is allowed.", + "type": "string" + }, "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"] + "type": "string", + "enum": [ + "send", + "receive" + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] }, "channel": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, "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.", + "type": "array", "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" } @@ -37,74 +64,50 @@ } ] }, - "traits": { + "security": { + "$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" + }, + "summary": { + "description": "A brief summary of the operation.", + "type": "string" + }, + "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", "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.", + "uniqueItems": true, "items": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" } ] } }, - "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": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" - }, - "tags": { + "traits": { + "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.", "type": "array", - "description": "A list of tags for logical grouping and categorization of operations.", "items": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" } ] - }, - "uniqueItems": true - }, - "externalDocs": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" - } - ] - }, - "bindings": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" - } - ] + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/operation.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/operation.json" + } } diff --git a/definitions/3.0.0/operationBindingsObject.json b/definitions/3.0.0/operationBindingsObject.json index dd1744d6..6be3ebf2 100644 --- a/definitions/3.0.0/operationBindingsObject.json +++ b/definitions/3.0.0/operationBindingsObject.json @@ -1,19 +1,10 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json", "description": "Map describing protocol-specific definitions for an operation.", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "properties": { - "http": { - "properties": { - "bindingVersion": { - "enum": ["0.2.0", "0.3.0"] - } - }, + "amqp": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -25,44 +16,37 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/http/0.3.0/operation.json" - } - }, - { - "if": { - "required": [ "bindingVersion" ], - "properties": { - "bindingVersion": { - "const": "0.2.0" - } - } - }, - "then": { - "$ref": "http://asyncapi.com/bindings/http/0.2.0/operation.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.3.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/http/0.3.0/operation.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" } } - ] - }, - "ws": {}, - "amqp": { + ], "properties": { "bindingVersion": { - "enum": ["0.3.0"] + "enum": [ + "0.3.0" + ] } - }, + } + }, + "amqp1": {}, + "anypointmq": {}, + "googlepubsub": {}, + "http": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -74,66 +58,52 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" + "$ref": "http://asyncapi.com/bindings/http/0.3.0/operation.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.3.0" + "const": "0.2.0" } } - }, - "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" - } - } - ] - }, - "amqp1": {}, - "mqtt": { - "properties": { - "bindingVersion": { - "enum": ["0.2.0"] - } - }, - "allOf": [ - { - "description": "If no bindingVersion specified, use the latest binding", - "if": { - "not": { - "required": [ - "bindingVersion" - ] - } }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" + "$ref": "http://asyncapi.com/bindings/http/0.2.0/operation.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.2.0" + "const": "0.3.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" + "$ref": "http://asyncapi.com/bindings/http/0.3.0/operation.json" } } - ] - }, - "kafka": { + ], "properties": { "bindingVersion": { - "enum": ["0.5.0", "0.4.0", "0.3.0"] + "enum": [ + "0.2.0", + "0.3.0" + ] } - }, + } + }, + "ibmmq": {}, + "jms": {}, + "kafka": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -150,7 +120,9 @@ }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.5.0" @@ -163,39 +135,46 @@ }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.4.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/operation.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.3.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/operation.json" } } - ] - }, - "anypointmq": {}, - "nats": { + ], "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] } - }, + } + }, + "mqtt": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -207,31 +186,34 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.2.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" } } - ] - }, - "jms": {}, - "sns": { + ], "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": [ + "0.2.0" + ] } - }, + } + }, + "nats": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -243,30 +225,35 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + "$ref": "http://asyncapi.com/bindings/nats/0.1.0/operation.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.1.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + "$ref": "http://asyncapi.com/bindings/nats/0.1.0/operation.json" } } - ] - }, - "sqs": { + ], "properties": { "bindingVersion": { - "enum": ["0.2.0"] + "enum": [ + "0.1.0" + ] } - }, + } + }, + "redis": {}, + "sns": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -278,33 +265,34 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.2.0" + "const": "0.1.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" } } - ] - }, - "stomp": {}, - "redis": {}, - "ibmmq": {}, - "solace": { + ], "properties": { "bindingVersion": { - "enum": ["0.4.0", "0.3.0", "0.2.0"] + "enum": [ + "0.1.0" + ] } - }, + } + }, + "solace": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -321,47 +309,106 @@ }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.4.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/solace/0.4.0/operation.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.3.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/solace/0.3.0/operation.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.2.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/solace/0.2.0/operation.json" } } - ] + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + } }, - "googlepubsub": {} + "sqs": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "stomp": {}, + "ws": {} }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false } diff --git a/definitions/3.0.0/operationReply.json b/definitions/3.0.0/operationReply.json index fe1491d9..2148be04 100644 --- a/definitions/3.0.0/operationReply.json +++ b/definitions/3.0.0/operationReply.json @@ -1,12 +1,8 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/operationReply.json", "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": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "properties": { "address": { "oneOf": [ @@ -22,13 +18,17 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, "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.", + "type": "array", "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" } } }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/operationReply.json" -} \ No newline at end of file + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false +} diff --git a/definitions/3.0.0/operationReplyAddress.json b/definitions/3.0.0/operationReplyAddress.json index ba29ea12..745fb981 100644 --- a/definitions/3.0.0/operationReplyAddress.json +++ b/definitions/3.0.0/operationReplyAddress.json @@ -1,29 +1,29 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json", "description": "An object that specifies where an operation has to send the reply", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "required": [ "location" ], "properties": { + "description": { + "description": "An optional description of the address. CommonMark is allowed.", + "type": "string" + }, "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." + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/operationReplyAddress.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" + } } diff --git a/definitions/3.0.0/operationTrait.json b/definitions/3.0.0/operationTrait.json index b646001f..e980366e 100644 --- a/definitions/3.0.0/operationTrait.json +++ b/definitions/3.0.0/operationTrait.json @@ -1,37 +1,17 @@ -{ - "type": "object", +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json", "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": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "properties": { "title": { "description": "A human-friendly title for the operation.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/title" }, - "summary": { - "description": "A short summary of what the operation is about.", - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary" - }, "description": { "description": "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/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": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security" - }, - "tags": { - "description": "A list of tags for logical grouping and categorization of operations.", - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags" - }, - "externalDocs": { - "description": "Additional external documentation for this operation.", - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/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": [ @@ -42,11 +22,31 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" } ] + }, + "externalDocs": { + "description": "Additional external documentation for this operation.", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs" + }, + "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": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security" + }, + "summary": { + "description": "A short summary of what the operation is about.", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary" + }, + "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/operationTrait.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" + } } diff --git a/definitions/3.0.0/operations.json b/definitions/3.0.0/operations.json index 7ca51c39..95f8e4e9 100644 --- a/definitions/3.0.0/operations.json +++ b/definitions/3.0.0/operations.json @@ -1,19 +1,19 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/operations.json", "description": "Holds a dictionary with all the operations this application MUST implement.", + "type": "object", "additionalProperties": { "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" } ] }, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/operations.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/operations.json" + } } diff --git a/definitions/3.0.0/parameter.json b/definitions/3.0.0/parameter.json index 996b6817..e42fad12 100644 --- a/definitions/3.0.0/parameter.json +++ b/definitions/3.0.0/parameter.json @@ -1,18 +1,14 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/parameter.json", "description": "Describes a parameter included in a channel address.", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, "properties": { "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.", + "type": "string" }, - "enum": { - "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "examples": { + "description": "An array of examples of the parameter value.", "type": "array", "items": { "type": "string" @@ -22,22 +18,26 @@ "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.", + "enum": { + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", "type": "array", "items": { "type": "string" } }, "location": { - "type": "string", "description": "A runtime expression that specifies the location of the parameter value", + "type": "string", "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" } }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/parameter.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/parameter.json" + } } diff --git a/definitions/3.0.0/parameters.json b/definitions/3.0.0/parameters.json index 406e7a53..60ba1f6b 100644 --- a/definitions/3.0.0/parameters.json +++ b/definitions/3.0.0/parameters.json @@ -1,4 +1,7 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/parameters.json", + "description": "JSON objects describing re-usable channel parameters.", "type": "object", "additionalProperties": { "oneOf": [ @@ -10,10 +13,7 @@ } ] }, - "description": "JSON objects describing re-usable channel parameters.", "example": { "$ref": "http://asyncapi.com/examples/3.0.0/parameters.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/parameters.json" + } } diff --git a/definitions/3.0.0/schema.json b/definitions/3.0.0/schema.json index 054bbc9b..7e185b07 100644 --- a/definitions/3.0.0/schema.json +++ b/definitions/3.0.0/schema.json @@ -1,41 +1,17 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/schema.json", "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": "http://json-schema.org/draft-07/schema#" }, { - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, "properties": { - "additionalProperties": { - "anyOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - }, - { - "type": "boolean" - } - ], - "default": {} - }, - "items": { - "anyOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - }, - { - "type": "array", - "minItems": 1, - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - } - } - ], - "default": {} + "deprecated": { + "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + "default": false, + "type": "boolean" }, "allOf": { "type": "array", @@ -44,14 +20,14 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" } }, - "oneOf": { + "anyOf": { "type": "array", "minItems": 1, "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" } }, - "anyOf": { + "oneOf": { "type": "array", "minItems": 1, "items": { @@ -61,29 +37,55 @@ "not": { "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" }, + "contains": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "items": { + "default": {}, + "anyOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + } + ] + }, + "propertyNames": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, "properties": { + "default": {}, "type": "object", "additionalProperties": { "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - }, - "default": {} + } }, "patternProperties": { + "default": {}, "type": "object", "additionalProperties": { "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - }, - "default": {} - }, - "propertyNames": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } }, - "contains": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + "additionalProperties": { + "default": {}, + "anyOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "type": "boolean" + } + ] }, "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." + "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.", + "type": "string" }, "externalDocs": { "oneOf": [ @@ -94,15 +96,13 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" } ] - }, - "deprecated": { - "type": "boolean", - "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", - "default": false + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } } } - ], - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/schema.json" -} \ No newline at end of file + ] +} diff --git a/definitions/3.0.0/securityRequirements.json b/definitions/3.0.0/securityRequirements.json index b8da3dcb..01d2f12c 100644 --- a/definitions/3.0.0/securityRequirements.json +++ b/definitions/3.0.0/securityRequirements.json @@ -1,4 +1,6 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json", "description": "An array representing security requirements.", "type": "array", "items": { @@ -10,7 +12,5 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" } ] - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" + } } diff --git a/definitions/3.0.0/server.json b/definitions/3.0.0/server.json index f51dc063..054f0fcd 100644 --- a/definitions/3.0.0/server.json +++ b/definitions/3.0.0/server.json @@ -1,86 +1,89 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/server.json", "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": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, - "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}." + "type": "object", + "required": [ + "host", + "protocol" + ], + "properties": { + "title": { + "description": "A human-friendly title for the server.", + "type": "string" }, - "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}." + "description": { + "description": "A longer description of the server. CommonMark is allowed.", + "type": "string" }, - "title": { - "type": "string", - "description": "A human-friendly title for the server." + "bindings": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + } + ] }, - "summary": { - "type": "string", - "description": "A brief summary of the server." + "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] }, - "description": { - "type": "string", - "description": "A longer description of the server. CommonMark is allowed." + "host": { + "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}.", + "type": "string" + }, + "pathname": { + "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}.", + "type": "string" }, "protocol": { - "type": "string", - "description": "The protocol this server supports for connection." + "description": "The protocol this server supports for connection.", + "type": "string" }, "protocolVersion": { - "type": "string", - "description": "An optional string describing the server. CommonMark syntax MAY be used for rich text representation." - }, - "variables": { - "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariables.json" + "description": "An optional string describing the server. CommonMark syntax MAY be used for rich text representation.", + "type": "string" }, "security": { "$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" }, + "summary": { + "description": "A brief summary of the server.", + "type": "string" + }, "tags": { "type": "array", + "uniqueItems": true, "items": { "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" - } - ] - }, - "uniqueItems": true + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + } }, - "externalDocs": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" - } - ] - }, - "bindings": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" - } - ] + "variables": { + "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariables.json" } }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/server.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/server.json" + } } diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index 91f8b90a..c83a670f 100644 --- a/definitions/3.0.0/serverBindingsObject.json +++ b/definitions/3.0.0/serverBindingsObject.json @@ -1,23 +1,54 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json", "description": "Map describing protocol-specific definitions for a server.", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "properties": { - "http": {}, - "ws": {}, "amqp": {}, "amqp1": {}, - "mqtt": { + "anypointmq": {}, + "googlepubsub": {}, + "http": {}, + "ibmmq": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + } + ], "properties": { "bindingVersion": { - "enum": ["0.2.0"] + "enum": [ + "0.1.0" + ] } - }, + } + }, + "jms": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -29,30 +60,34 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.2.0" + "const": "0.0.1" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" } } - ] - }, - "kafka": { + ], "properties": { "bindingVersion": { - "enum": ["0.5.0", "0.4.0", "0.3.0"] + "enum": [ + "0.0.1" + ] } - }, + } + }, + "kafka": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -69,7 +104,9 @@ }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.5.0" @@ -82,40 +119,46 @@ }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.4.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/server.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.3.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/server.json" } } - ] - }, - "anypointmq": {}, - "nats": {}, - "jms": { + ], "properties": { "bindingVersion": { - "enum": ["0.0.1"] + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] } - }, + } + }, + "mqtt": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -127,34 +170,35 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { - "const": "0.0.1" + "const": "0.2.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" } } - ] - }, - "sns": {}, - "sqs": {}, - "stomp": {}, - "redis": {}, - "ibmmq": { + ], "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": [ + "0.2.0" + ] } - }, + } + }, + "nats": {}, + "pulsar": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -166,30 +210,36 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.1.0" } } - }, + }, "then": { - "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" } } - ] - }, - "solace": { + ], "properties": { "bindingVersion": { - "enum": ["0.4.0", "0.3.0", "0.2.0"] + "enum": [ + "0.1.0" + ] } - }, + } + }, + "redis": {}, + "sns": {}, + "solace": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", @@ -206,82 +256,68 @@ }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.4.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/solace/0.4.0/server.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.3.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/solace/0.3.0/server.json" } }, { "if": { - "required": [ "bindingVersion" ], + "required": [ + "bindingVersion" + ], "properties": { "bindingVersion": { "const": "0.2.0" } } - }, + }, "then": { "$ref": "http://asyncapi.com/bindings/solace/0.2.0/server.json" } } - ] - }, - "googlepubsub": {}, - "pulsar": { + ], "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": [ + "0.4.0", + "0.3.0", + "0.2.0" + ] } - }, - "allOf": [ - { - "description": "If no bindingVersion specified, use the latest binding", - "if": { - "not": { - "required": [ - "bindingVersion" - ] - } - }, - "then": { - "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" - } - }, - { - "if": { - "required": [ "bindingVersion" ], - "properties": { - "bindingVersion": { - "const": "0.1.0" - } - } - }, - "then": { - "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" - } - } - ] + } + }, + "sqs": {}, + "stomp": {}, + "ws": {} + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" -} \ No newline at end of file + "additionalProperties": false +} diff --git a/definitions/3.0.0/serverVariable.json b/definitions/3.0.0/serverVariable.json index 1bcc5090..b59a8e0d 100644 --- a/definitions/3.0.0/serverVariable.json +++ b/definitions/3.0.0/serverVariable.json @@ -1,40 +1,40 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/serverVariable.json", "description": "An object representing a Server Variable for server URL template substitution.", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, + "type": "object", "properties": { - "enum": { + "description": { + "description": "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, + "examples": { + "description": "An array of examples of the server variable.", "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": { + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied.", + "type": "string" }, - "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" - } - } + "enum": { + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + } }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/serverVariable.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/serverVariable.json" + } } diff --git a/definitions/3.0.0/serverVariables.json b/definitions/3.0.0/serverVariables.json index 69015771..d4b0db62 100644 --- a/definitions/3.0.0/serverVariables.json +++ b/definitions/3.0.0/serverVariables.json @@ -1,4 +1,6 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/serverVariables.json", "type": "object", "additionalProperties": { "oneOf": [ @@ -9,7 +11,5 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariable.json" } ] - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/serverVariables.json" -} \ No newline at end of file + } +} diff --git a/definitions/3.0.0/servers.json b/definitions/3.0.0/servers.json index 9c6e9486..d7de7e6b 100644 --- a/definitions/3.0.0/servers.json +++ b/definitions/3.0.0/servers.json @@ -1,4 +1,6 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/servers.json", "description": "An object representing multiple servers.", "type": "object", "additionalProperties": { @@ -7,13 +9,11 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/server.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/server.json" } ] }, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/servers.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/servers.json" + } } diff --git a/definitions/3.0.0/specificationExtension.json b/definitions/3.0.0/specificationExtension.json index 37c426a1..803eca32 100644 --- a/definitions/3.0.0/specificationExtension.json +++ b/definitions/3.0.0/specificationExtension.json @@ -1,7 +1,7 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json", "description": "Any property starting with x- is valid.", - "additionalProperties": true, "additionalItems": true, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" -} \ No newline at end of file + "additionalProperties": true +} diff --git a/definitions/3.0.0/symmetricEncryption.json b/definitions/3.0.0/symmetricEncryption.json index 5cc61ef2..f4d757ec 100644 --- a/definitions/3.0.0/symmetricEncryption.json +++ b/definitions/3.0.0/symmetricEncryption.json @@ -1,17 +1,19 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json", "type": "object", "required": [ "type" ], "properties": { + "description": { + "type": "string" + }, "type": { "type": "string", "enum": [ "symmetricEncryption" ] - }, - "description": { - "type": "string" } }, "patternProperties": { @@ -19,10 +21,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/symmetricEncryption.json" - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json" + } } diff --git a/definitions/3.0.0/tag.json b/definitions/3.0.0/tag.json index 2e5ab3ea..7e94364c 100644 --- a/definitions/3.0.0/tag.json +++ b/definitions/3.0.0/tag.json @@ -1,18 +1,15 @@ { - "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/tag.json", "description": "Allows adding metadata to a single tag.", - "additionalProperties": false, + "type": "object", "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." + "description": "A short description for the tag. CommonMark syntax can be used for rich text representation.", + "type": "string" }, "externalDocs": { "oneOf": [ @@ -23,6 +20,10 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" } ] + }, + "name": { + "description": "The name of the tag.", + "type": "string" } }, "patternProperties": { @@ -30,9 +31,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/tag.json" - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/tag.json" + } } diff --git a/definitions/3.0.0/userPassword.json b/definitions/3.0.0/userPassword.json index 21a2b65a..b068d0e2 100644 --- a/definitions/3.0.0/userPassword.json +++ b/definitions/3.0.0/userPassword.json @@ -1,17 +1,19 @@ { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/userPassword.json", "type": "object", "required": [ "type" ], "properties": { + "description": { + "type": "string" + }, "type": { "type": "string", "enum": [ "userPassword" ] - }, - "description": { - "type": "string" } }, "patternProperties": { @@ -19,10 +21,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "additionalProperties": false, "example": { "$ref": "http://asyncapi.com/examples/3.0.0/userPassword.json" - }, - "additionalProperties": false, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/userPassword.json" + } } diff --git a/package-lock.json b/package-lock.json index affb1c97..9a6c6870 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@types/json-schema": "^7.0.11" }, "devDependencies": { + "@intelligence-ai/jsonschema": "^0.5.0", "ajv": "^8.12.0", "ajv-draft-04": "^1.0.0", "eslint": "^8.56.0", @@ -660,6 +661,15 @@ "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, + "node_modules/@intelligence-ai/jsonschema": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@intelligence-ai/jsonschema/-/jsonschema-0.5.0.tgz", + "integrity": "sha512-lTDSxZdyCkJuuV+5V1dpigFJHmBWbaA32ddhfBVfzTDpjvsbvGcDfwDdeCGq5WFNoAxFqLUBpnVgdMSS///phg==", + "dev": true, + "bin": { + "jsonschema": "cli.js" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", diff --git a/package.json b/package.json index b1e226c6..b99c8673 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "lint": "eslint --max-warnings 0 --config .eslintrc.yml .", "lint:fix": "eslint --max-warnings 0 --config .eslintrc.yml --fix .", "bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION", - "validate:schemas": "node scripts/validate-schemas.js" + "validate:schemas": "node scripts/validate-schemas.js && jsonschema fmt definitions/3.0.0 --verbose --check" }, "repository": { "type": "git", @@ -39,6 +39,7 @@ }, "homepage": "https://github.com/asyncapi/spec-json-schemas#readme", "devDependencies": { + "@intelligence-ai/jsonschema": "^0.5.0", "ajv": "^8.12.0", "ajv-draft-04": "^1.0.0", "eslint": "^8.56.0", From b0459dcacf49d83412d296056c27794175724d96 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 12 Jun 2024 11:54:39 -0400 Subject: [PATCH 2/2] Upgrade to JSON Schema CLI v0.5.1 Signed-off-by: Juan Cruz Viotti --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a6c6870..d8179646 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@types/json-schema": "^7.0.11" }, "devDependencies": { - "@intelligence-ai/jsonschema": "^0.5.0", + "@intelligence-ai/jsonschema": "^0.5.1", "ajv": "^8.12.0", "ajv-draft-04": "^1.0.0", "eslint": "^8.56.0", @@ -662,9 +662,9 @@ "dev": true }, "node_modules/@intelligence-ai/jsonschema": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@intelligence-ai/jsonschema/-/jsonschema-0.5.0.tgz", - "integrity": "sha512-lTDSxZdyCkJuuV+5V1dpigFJHmBWbaA32ddhfBVfzTDpjvsbvGcDfwDdeCGq5WFNoAxFqLUBpnVgdMSS///phg==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@intelligence-ai/jsonschema/-/jsonschema-0.5.1.tgz", + "integrity": "sha512-fCqQpH/6xzNv6shSS8RL70MjV/NTr8+0qbm7C38NSPE7gUIt6DlWu+DxsFuhR+EjNGsTVFAcV5Nnwr/rxl3jDw==", "dev": true, "bin": { "jsonschema": "cli.js" diff --git a/package.json b/package.json index b99c8673..2d19be55 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ }, "homepage": "https://github.com/asyncapi/spec-json-schemas#readme", "devDependencies": { - "@intelligence-ai/jsonschema": "^0.5.0", + "@intelligence-ai/jsonschema": "^0.5.1", "ajv": "^8.12.0", "ajv-draft-04": "^1.0.0", "eslint": "^8.56.0",