diff --git a/definitions/3.0.0/multiFormatSchema.json b/definitions/3.0.0/multiFormatSchema.json index 548dd852..8f91cc05 100644 --- a/definitions/3.0.0/multiFormatSchema.json +++ b/definitions/3.0.0/multiFormatSchema.json @@ -33,7 +33,14 @@ "then": { "properties": { "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + ] } } } @@ -77,7 +84,14 @@ "then": { "properties": { "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + ] } } } @@ -99,7 +113,14 @@ "then": { "properties": { "schema": { - "$ref": "http://json-schema.org/draft-07/schema" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://json-schema.org/draft-07/schema" + } + ] } } } @@ -122,7 +143,14 @@ "then": { "properties": { "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" + } + ] } } } @@ -145,7 +173,14 @@ "then": { "properties": { "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + } + ] } } } diff --git a/schemas/3.0.0-without-$id.json b/schemas/3.0.0-without-$id.json index baff0ce8..bcc022e4 100644 --- a/schemas/3.0.0-without-$id.json +++ b/schemas/3.0.0-without-$id.json @@ -2177,7 +2177,14 @@ "then": { "properties": { "schema": { - "$ref": "#/definitions/schema" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/schema" + } + ] } } } @@ -2221,7 +2228,14 @@ "then": { "properties": { "schema": { - "$ref": "#/definitions/schema" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/schema" + } + ] } } } @@ -2243,7 +2257,14 @@ "then": { "properties": { "schema": { - "$ref": "#/definitions/json-schema-draft-07-schema" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + ] } } } @@ -2266,7 +2287,14 @@ "then": { "properties": { "schema": { - "$ref": "#/definitions/openapiSchema_3_0" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/openapiSchema_3_0" + } + ] } } } @@ -2289,7 +2317,14 @@ "then": { "properties": { "schema": { - "$ref": "#/definitions/avroSchema_v1" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/avroSchema_v1" + } + ] } } } diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index 4ed486ec..63849e6e 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -2226,7 +2226,14 @@ "then": { "properties": { "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + ] } } } @@ -2270,7 +2277,14 @@ "then": { "properties": { "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + } + ] } } } @@ -2292,7 +2306,14 @@ "then": { "properties": { "schema": { - "$ref": "http://json-schema.org/draft-07/schema" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://json-schema.org/draft-07/schema" + } + ] } } } @@ -2315,7 +2336,14 @@ "then": { "properties": { "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" + } + ] } } } @@ -2338,7 +2366,14 @@ "then": { "properties": { "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + } + ] } } } diff --git a/test/docs/3.0.0/streetlights-all.json b/test/docs/3.0.0/streetlights-all.json index 4dd731c9..aabad861 100644 --- a/test/docs/3.0.0/streetlights-all.json +++ b/test/docs/3.0.0/streetlights-all.json @@ -74,6 +74,11 @@ } } } + }, + "UserSignedUpV2": { + "payload": { + "$ref": "external-schema.json" + } } } } diff --git a/test/docs/3.0.0/streetlights-avro.json b/test/docs/3.0.0/streetlights-avro.json index 4113d94b..acbeea2c 100644 --- a/test/docs/3.0.0/streetlights-avro.json +++ b/test/docs/3.0.0/streetlights-avro.json @@ -76,6 +76,12 @@ "namespace": "com.example.avro", "type": "record" } + }, + "ReferencedSchema" : { + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "$ref": "reference-to-some-avro-file.avsc" + } } }, "messages": { diff --git a/test/docs/3.0.0/streetlights-openapi.json b/test/docs/3.0.0/streetlights-openapi.json index b0b799b8..84d64449 100644 --- a/test/docs/3.0.0/streetlights-openapi.json +++ b/test/docs/3.0.0/streetlights-openapi.json @@ -58,6 +58,14 @@ } }, "components": { + "schemas": { + "ReferencedSchema" : { + "schemaFormat": "application/vnd.oai.openapi;version=3.0.0", + "schema": { + "$ref": "reference-to-some-openapi-file.json" + } + } + }, "messages": { "UserSignedUp": { "payload": {