From 469431cbb4c1213de384f7f83297413786e0b73a Mon Sep 17 00:00:00 2001 From: Pavel Bodiachevskii Date: Thu, 28 Mar 2024 18:01:10 +0400 Subject: [PATCH] fix: AsyncAPI v3 shows warning in Studio and IntelliJ plugin when referencing a json schema New multiFormatSchema validation rules https://github.com/asyncapi/spec-json-schemas/issues/494 https://github.com/asyncapi/jasyncapi-idea-plugin/issues/49 --- definitions/3.0.0/multiFormatSchema.json | 384 +++++---- schemas/3.0.0-without-$id.json | 945 +++++++++++------------ 2 files changed, 624 insertions(+), 705 deletions(-) diff --git a/definitions/3.0.0/multiFormatSchema.json b/definitions/3.0.0/multiFormatSchema.json index dd03f474..077cdcf6 100644 --- a/definitions/3.0.0/multiFormatSchema.json +++ b/definitions/3.0.0/multiFormatSchema.json @@ -1,217 +1,41 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json", - "description": "An object representing Multi Format Schema. You can use it to attach Schemas different to AsyncAPI, like Avro or OpenAPI", + "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", - "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "required": ["schemaFormat", "schema"], - "properties": { - "schemaFormat": { - "type": "string", - "description": "Supported Schema formats" - }, - "schema": { - "type": "object", - "description": "Schema definition" + "if": { + "not": { + "type": "object" } }, - "minProperties": 2, - "maxProperties": 2, - "oneOf": [ - { - "type": "object", - "description": "Multi Format Schema: Avro Schema or Reference", - "properties": { - "schemaFormat": { - "type": "string", - "enum": [ - "application/vnd.apache.avro;version=1.9.0", - "application/vnd.apache.avro+json;version=1.9.0", - "application/vnd.apache.avro+yaml;version=1.9.0" - ] - }, - "schema": { - "oneOf": [ - { - "type": "object", - "description": "Avro Schema", - "not": {"required": ["$ref"]}, - "$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" - }, - { - "type": "object", - "description": "Reference to Avro Schema", - "required": ["$ref"], - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - } - ] - } - } - }, - { - "type": "object", - "description": "Multi Format Schema: OpenAPI Schema or Reference", - "properties": { - "schemaFormat": { - "type": "string", - "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" - ] - }, - "schema": { - "oneOf": [ - { - "type": "object", - "description": "OpenAPI Schema", - "not": {"required": ["$ref"]}, - "$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" - }, - { - "type": "object", - "description": "Reference to OpenAPI Schema", - "required": ["$ref"], - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - } - ] - } - } - }, - { - "type": "object", - "description": "Multi Format Schema: Json Schema or Reference", - "properties": { - "schemaFormat": { - "type": "string", - "enum": [ - "application/schema+json;version=draft-07", - "application/schema+yaml;version=draft-07" - ] - }, - "schema": { - "description": "Because of $ref collision in Reference and Json Schema", - "anyOf": [ - { - "type": "object", - "description": "Json Schema", - "not": {"required": ["$ref"]}, - "$ref": "http://json-schema.org/draft-07/schema" - }, - { - "type": "object", - "description": "Reference to Json Schema", - "required": ["$ref"], - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - } - ] - } - } - }, - { - "type": "object", - "description": "Multi Format Schema: AsyncAPI Schema or Reference", - "properties": { - "schemaFormat": { - "type": "string", - "enum": [ - "application/vnd.aai.asyncapi;version=2.0.0", - "application/vnd.aai.asyncapi+json;version=2.0.0", - "application/vnd.aai.asyncapi+yaml;version=2.0.0", - - "application/vnd.aai.asyncapi;version=2.1.0", - "application/vnd.aai.asyncapi+json;version=2.1.0", - "application/vnd.aai.asyncapi+yaml;version=2.1.0", - - "application/vnd.aai.asyncapi;version=2.2.0", - "application/vnd.aai.asyncapi+json;version=2.2.0", - "application/vnd.aai.asyncapi+yaml;version=2.2.0", - - "application/vnd.aai.asyncapi;version=2.3.0", - "application/vnd.aai.asyncapi+json;version=2.3.0", - "application/vnd.aai.asyncapi+yaml;version=2.3.0", - - "application/vnd.aai.asyncapi;version=2.4.0", - "application/vnd.aai.asyncapi+json;version=2.4.0", - "application/vnd.aai.asyncapi+yaml;version=2.4.0", - - "application/vnd.aai.asyncapi;version=2.5.0", - "application/vnd.aai.asyncapi+json;version=2.5.0", - "application/vnd.aai.asyncapi+yaml;version=2.5.0", - - "application/vnd.aai.asyncapi;version=2.6.0", - "application/vnd.aai.asyncapi+json;version=2.6.0", - "application/vnd.aai.asyncapi+yaml;version=2.6.0", - - "application/vnd.aai.asyncapi;version=3.0.0", - "application/vnd.aai.asyncapi+json;version=3.0.0", - "application/vnd.aai.asyncapi+yaml;version=3.0.0" - ] - }, - "schema": { - "description": "Because of $ref collision in Reference and AsyncAPI Schema", - "anyOf": [ - { - "type": "object", - "description": "AsyncAPI Schema", - "not": {"required": ["$ref"]}, - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - }, - { - "type": "object", - "description": "Reference to AsyncAPI Schema", - "required": ["$ref"], - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - } - ] - } - } - }, - { - "type": "object", - "description": "Multi Format Schema: Unknown Schema is AsyncAPI Schema", - "properties": { - "schemaFormat": { - "type": "string", - "not": { + "then": { + "$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/vnd.aai.asyncapi;version=2.0.0", - "application/vnd.aai.asyncapi+json;version=2.0.0", - "application/vnd.aai.asyncapi+yaml;version=2.0.0", - - "application/vnd.aai.asyncapi;version=2.1.0", - "application/vnd.aai.asyncapi+json;version=2.1.0", - "application/vnd.aai.asyncapi+yaml;version=2.1.0", - - "application/vnd.aai.asyncapi;version=2.2.0", - "application/vnd.aai.asyncapi+json;version=2.2.0", - "application/vnd.aai.asyncapi+yaml;version=2.2.0", - - "application/vnd.aai.asyncapi;version=2.3.0", - "application/vnd.aai.asyncapi+json;version=2.3.0", - "application/vnd.aai.asyncapi+yaml;version=2.3.0", - - "application/vnd.aai.asyncapi;version=2.4.0", - "application/vnd.aai.asyncapi+json;version=2.4.0", - "application/vnd.aai.asyncapi+yaml;version=2.4.0", - - "application/vnd.aai.asyncapi;version=2.5.0", - "application/vnd.aai.asyncapi+json;version=2.5.0", - "application/vnd.aai.asyncapi+yaml;version=2.5.0", - - "application/vnd.aai.asyncapi;version=2.6.0", - "application/vnd.aai.asyncapi+json;version=2.6.0", - "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/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", - + "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", @@ -220,17 +44,159 @@ "application/vnd.apache.avro+json;version=1.9.0", "application/vnd.apache.avro+yaml;version=1.9.0", - "application/schema+json;version=draft-07", - "application/schema+yaml;version=draft-07" + "application/raml+yaml;version=1.0" + ] + } + ] + } + }, + "allOf": [ + { + "if": { + "not": { + "description": "If no schemaFormat has been defined, default to schema or reference", + "required": [ + "schemaFormat" ] } }, - "schema": { - "type": "object", - "description": "AsyncAPI Schema", - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + "then": { + "properties": { + "schema": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + } + } + }, + { + "if": { + "description": "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "$ref": "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + } + ] + } + } } } - } - ] + ] + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json" } \ No newline at end of file diff --git a/schemas/3.0.0-without-$id.json b/schemas/3.0.0-without-$id.json index cbd96cae..19f9eef9 100644 --- a/schemas/3.0.0-without-$id.json +++ b/schemas/3.0.0-without-$id.json @@ -2731,250 +2731,489 @@ ] }, "multiFormatSchema": { - "description": "An object representing Multi Format Schema. You can use it to attach Schemas different to AsyncAPI, like Avro or OpenAPI", + "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", - "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "#/definitions/specificationExtension" } }, - "required": [ - "schemaFormat", - "schema" - ], - "properties": { - "schemaFormat": { - "type": "string", - "description": "Supported Schema formats" - }, - "schema": { - "type": "object", - "description": "Schema definition" + "if": { + "not": { + "type": "object" } }, - "minProperties": 2, - "maxProperties": 2, - "oneOf": [ - { - "type": "object", - "description": "Multi Format Schema: Avro Schema or Reference", - "properties": { - "schemaFormat": { - "type": "string", - "enum": [ - "application/vnd.apache.avro;version=1.9.0", - "application/vnd.apache.avro+json;version=1.9.0", - "application/vnd.apache.avro+yaml;version=1.9.0" - ] + "then": { + "$ref": "#/definitions/schema" + }, + "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": { + "not": { + "description": "If no schemaFormat has been defined, default to schema or reference", + "required": [ + "schemaFormat" + ] + } }, - "schema": { - "oneOf": [ - { - "type": "object", - "description": "Avro Schema", - "not": { - "required": [ - "$ref" - ] - }, - "$ref": "#/definitions/avroSchema_v1" - }, - { - "type": "object", - "description": "Reference to Avro Schema", - "required": [ - "$ref" - ], - "$ref": "#/definitions/Reference" + "then": { + "properties": { + "schema": { + "$ref": "#/definitions/schema" } - ] + } + } + }, + { + "if": { + "description": "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/openapiSchema_3_0" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/avroSchema_v1" + } + ] + } + } } } - }, - { + ] + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { "type": "object", - "description": "Multi Format Schema: OpenAPI Schema or Reference", + "required": [ + "url" + ], "properties": { - "schemaFormat": { - "type": "string", - "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" - ] + "description": { + "type": "string" }, - "schema": { - "oneOf": [ - { - "type": "object", - "description": "OpenAPI Schema", - "not": { - "required": [ - "$ref" - ] - }, - "$ref": "#/definitions/openapiSchema_3_0" - }, - { - "type": "object", - "description": "Reference to OpenAPI Schema", - "required": [ - "$ref" - ], - "$ref": "#/definitions/Reference" - } - ] + "url": { + "type": "string", + "format": "uri-reference" } - } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false }, - { + "Discriminator": { "type": "object", - "description": "Multi Format Schema: Json Schema or Reference", + "required": [ + "propertyName" + ], "properties": { - "schemaFormat": { - "type": "string", - "enum": [ - "application/schema+json;version=draft-07", - "application/schema+yaml;version=draft-07" - ] + "propertyName": { + "type": "string" }, - "schema": { - "description": "Because of $ref collision in Reference and Json Schema", - "anyOf": [ - { - "type": "object", - "description": "Json Schema", - "not": { - "required": [ - "$ref" - ] - }, - "$ref": "#/definitions/json-schema-draft-07-schema" - }, - { - "type": "object", - "description": "Reference to Json Schema", - "required": [ - "$ref" - ], - "$ref": "#/definitions/Reference" - } - ] + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, - { + "Reference": { "type": "object", - "description": "Multi Format Schema: AsyncAPI Schema or Reference", - "properties": { - "schemaFormat": { + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { "type": "string", - "enum": [ - "application/vnd.aai.asyncapi;version=2.0.0", - "application/vnd.aai.asyncapi+json;version=2.0.0", - "application/vnd.aai.asyncapi+yaml;version=2.0.0", - "application/vnd.aai.asyncapi;version=2.1.0", - "application/vnd.aai.asyncapi+json;version=2.1.0", - "application/vnd.aai.asyncapi+yaml;version=2.1.0", - "application/vnd.aai.asyncapi;version=2.2.0", - "application/vnd.aai.asyncapi+json;version=2.2.0", - "application/vnd.aai.asyncapi+yaml;version=2.2.0", - "application/vnd.aai.asyncapi;version=2.3.0", - "application/vnd.aai.asyncapi+json;version=2.3.0", - "application/vnd.aai.asyncapi+yaml;version=2.3.0", - "application/vnd.aai.asyncapi;version=2.4.0", - "application/vnd.aai.asyncapi+json;version=2.4.0", - "application/vnd.aai.asyncapi+yaml;version=2.4.0", - "application/vnd.aai.asyncapi;version=2.5.0", - "application/vnd.aai.asyncapi+json;version=2.5.0", - "application/vnd.aai.asyncapi+yaml;version=2.5.0", - "application/vnd.aai.asyncapi;version=2.6.0", - "application/vnd.aai.asyncapi+json;version=2.6.0", - "application/vnd.aai.asyncapi+yaml;version=2.6.0", - "application/vnd.aai.asyncapi;version=3.0.0", - "application/vnd.aai.asyncapi+json;version=3.0.0", - "application/vnd.aai.asyncapi+yaml;version=3.0.0" - ] - }, - "schema": { - "description": "Because of $ref collision in Reference and AsyncAPI Schema", - "anyOf": [ - { - "type": "object", - "description": "AsyncAPI Schema", - "not": { - "required": [ - "$ref" - ] - }, - "$ref": "#/definitions/schema" - }, - { - "type": "object", - "description": "Reference to AsyncAPI Schema", - "required": [ - "$ref" - ], - "$ref": "#/definitions/Reference" - } - ] + "format": "uri-reference" } } }, - { + "XML": { "type": "object", - "description": "Multi Format Schema: Unknown Schema is AsyncAPI Schema", "properties": { - "schemaFormat": { + "name": { + "type": "string" + }, + "namespace": { "type": "string", - "not": { - "enum": [ - "application/vnd.aai.asyncapi;version=2.0.0", - "application/vnd.aai.asyncapi+json;version=2.0.0", - "application/vnd.aai.asyncapi+yaml;version=2.0.0", - "application/vnd.aai.asyncapi;version=2.1.0", - "application/vnd.aai.asyncapi+json;version=2.1.0", - "application/vnd.aai.asyncapi+yaml;version=2.1.0", - "application/vnd.aai.asyncapi;version=2.2.0", - "application/vnd.aai.asyncapi+json;version=2.2.0", - "application/vnd.aai.asyncapi+yaml;version=2.2.0", - "application/vnd.aai.asyncapi;version=2.3.0", - "application/vnd.aai.asyncapi+json;version=2.3.0", - "application/vnd.aai.asyncapi+yaml;version=2.3.0", - "application/vnd.aai.asyncapi;version=2.4.0", - "application/vnd.aai.asyncapi+json;version=2.4.0", - "application/vnd.aai.asyncapi+yaml;version=2.4.0", - "application/vnd.aai.asyncapi;version=2.5.0", - "application/vnd.aai.asyncapi+json;version=2.5.0", - "application/vnd.aai.asyncapi+yaml;version=2.5.0", - "application/vnd.aai.asyncapi;version=2.6.0", - "application/vnd.aai.asyncapi+json;version=2.6.0", - "application/vnd.aai.asyncapi+yaml;version=2.6.0", - "application/vnd.aai.asyncapi;version=3.0.0", - "application/vnd.aai.asyncapi+json;version=3.0.0", - "application/vnd.aai.asyncapi+yaml;version=3.0.0", - "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/schema+json;version=draft-07", - "application/schema+yaml;version=draft-07" - ] - } + "format": "uri" }, - "schema": { - "type": "object", - "description": "AsyncAPI Schema", - "$ref": "#/definitions/schema" + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false } - } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false } - ] - }, - "avroSchema_v1": { + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { "definitions": { "avroSchema": { "title": "Avro Schema", @@ -3296,292 +3535,6 @@ ], "title": "Avro Schema Definition" }, - "openapiSchema_3_0": { - "type": "object", - "definitions": { - "ExternalDocumentation": { - "type": "object", - "required": [ - "url" - ], - "properties": { - "description": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri-reference" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Discriminator": { - "type": "object", - "required": [ - "propertyName" - ], - "properties": { - "propertyName": { - "type": "string" - }, - "mapping": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "Reference": { - "type": "object", - "required": [ - "$ref" - ], - "patternProperties": { - "^\\$ref$": { - "type": "string", - "format": "uri-reference" - } - } - }, - "XML": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "namespace": { - "type": "string", - "format": "uri" - }, - "prefix": { - "type": "string" - }, - "attribute": { - "type": "boolean", - "default": false - }, - "wrapped": { - "type": "boolean", - "default": false - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - } - }, - "properties": { - "title": { - "type": "string" - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "boolean", - "default": false - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "boolean", - "default": false - }, - "maxLength": { - "type": "integer", - "minimum": 0 - }, - "minLength": { - "type": "integer", - "minimum": 0, - "default": 0 - }, - "pattern": { - "type": "string", - "format": "regex" - }, - "maxItems": { - "type": "integer", - "minimum": 0 - }, - "minItems": { - "type": "integer", - "minimum": 0, - "default": 0 - }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxProperties": { - "type": "integer", - "minimum": 0 - }, - "minProperties": { - "type": "integer", - "minimum": 0, - "default": 0 - }, - "required": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "uniqueItems": true - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": false - }, - "type": { - "type": "string", - "enum": [ - "array", - "boolean", - "integer", - "number", - "object", - "string" - ] - }, - "not": { - "oneOf": [ - { - "$ref": "#/definitions/openapiSchema_3_0" - }, - { - "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" - } - ] - }, - "allOf": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/openapiSchema_3_0" - }, - { - "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" - } - ] - } - }, - "oneOf": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/openapiSchema_3_0" - }, - { - "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" - } - ] - } - }, - "anyOf": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/openapiSchema_3_0" - }, - { - "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" - } - ] - } - }, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/openapiSchema_3_0" - }, - { - "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" - } - ] - }, - "properties": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/openapiSchema_3_0" - }, - { - "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" - } - ] - } - }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/openapiSchema_3_0" - }, - { - "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" - }, - { - "type": "boolean" - } - ], - "default": true - }, - "description": { - "type": "string" - }, - "format": { - "type": "string" - }, - "default": true, - "nullable": { - "type": "boolean", - "default": false - }, - "discriminator": { - "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "example": true, - "externalDocs": { - "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" - }, - "deprecated": { - "type": "boolean", - "default": false - }, - "xml": { - "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" - } - }, - "patternProperties": { - "^x-": true - }, - "additionalProperties": false - }, "correlationId": { "type": "object", "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.",