From 6c5b1a763649dd1a7d6ec5387550d8f0580792a1 Mon Sep 17 00:00:00 2001 From: Jonas Lagoni Date: Tue, 14 May 2024 14:07:38 +0200 Subject: [PATCH 1/2] fix: add separate messsage example object (#536) --- definitions/3.0.0/messageExampleObject.json | 35 +++++++++++ definitions/3.0.0/messageObject.json | 32 +--------- definitions/3.0.0/messageTrait.json | 2 +- schemas/3.0.0-without-$id.json | 67 ++++++++++---------- schemas/3.0.0.json | 68 +++++++++++---------- 5 files changed, 108 insertions(+), 96 deletions(-) create mode 100644 definitions/3.0.0/messageExampleObject.json diff --git a/definitions/3.0.0/messageExampleObject.json b/definitions/3.0.0/messageExampleObject.json new file mode 100644 index 00000000..3a59ffcf --- /dev/null +++ b/definitions/3.0.0/messageExampleObject.json @@ -0,0 +1,35 @@ +{ + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object", + "description": "Example of the application headers. It can be of any type." + }, + "payload": { + "description": "Example of the message payload. It can be of any type." + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" +} diff --git a/definitions/3.0.0/messageObject.json b/definitions/3.0.0/messageObject.json index 3c35a299..f8cd37bb 100644 --- a/definitions/3.0.0/messageObject.json +++ b/definitions/3.0.0/messageObject.json @@ -76,37 +76,7 @@ "type": "array", "description": "List of examples.", "items": { - "type": "object", - "additionalProperties": false, - "anyOf": [ - { - "required": [ - "payload" - ] - }, - { - "required": [ - "headers" - ] - } - ], - "properties": { - "name": { - "type": "string", - "description": "Machine readable name of the message example." - }, - "summary": { - "type": "string", - "description": "A brief summary of the message example." - }, - "headers": { - "type": "object", - "description": "Example of the application headers. It can be of any type." - }, - "payload": { - "description": "Example of the message payload. It can be of any type." - } - } + "$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" } }, "bindings": { diff --git a/definitions/3.0.0/messageTrait.json b/definitions/3.0.0/messageTrait.json index 587d140b..3e5d4829 100644 --- a/definitions/3.0.0/messageTrait.json +++ b/definitions/3.0.0/messageTrait.json @@ -73,7 +73,7 @@ "type": "array", "description": "List of examples.", "items": { - "type": "object" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" } }, "bindings": { diff --git a/schemas/3.0.0-without-$id.json b/schemas/3.0.0-without-$id.json index 3a8ce1ef..4ca677a4 100644 --- a/schemas/3.0.0-without-$id.json +++ b/schemas/3.0.0-without-$id.json @@ -2572,37 +2572,7 @@ "type": "array", "description": "List of examples.", "items": { - "type": "object", - "additionalProperties": false, - "anyOf": [ - { - "required": [ - "payload" - ] - }, - { - "required": [ - "headers" - ] - } - ], - "properties": { - "name": { - "type": "string", - "description": "Machine readable name of the message example." - }, - "summary": { - "type": "string", - "description": "A brief summary of the message example." - }, - "headers": { - "type": "object", - "description": "Example of the application headers. It can be of any type." - }, - "payload": { - "description": "Example of the message payload. It can be of any type." - } - } + "$ref": "#/definitions/messageExampleObject" } }, "bindings": { @@ -3564,6 +3534,39 @@ } ] }, + "messageExampleObject": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object", + "description": "Example of the application headers. It can be of any type." + }, + "payload": { + "description": "Example of the message payload. It can be of any type." + } + } + }, "messageBindingsObject": { "type": "object", "description": "Map describing protocol-specific definitions for a message.", @@ -4678,7 +4681,7 @@ "type": "array", "description": "List of examples.", "items": { - "type": "object" + "$ref": "#/definitions/messageExampleObject" } }, "bindings": { diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index 889d975f..f86ffae0 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -2624,37 +2624,7 @@ "type": "array", "description": "List of examples.", "items": { - "type": "object", - "additionalProperties": false, - "anyOf": [ - { - "required": [ - "payload" - ] - }, - { - "required": [ - "headers" - ] - } - ], - "properties": { - "name": { - "type": "string", - "description": "Machine readable name of the message example." - }, - "summary": { - "type": "string", - "description": "A brief summary of the message example." - }, - "headers": { - "type": "object", - "description": "Example of the application headers. It can be of any type." - }, - "payload": { - "description": "Example of the message payload. It can be of any type." - } - } + "$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" } }, "bindings": { @@ -3621,6 +3591,40 @@ } ] }, + "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json", + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object", + "description": "Example of the application headers. It can be of any type." + }, + "payload": { + "description": "Example of the message payload. It can be of any type." + } + } + }, "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json": { "$id": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json", "type": "object", @@ -4748,7 +4752,7 @@ "type": "array", "description": "List of examples.", "items": { - "type": "object" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" } }, "bindings": { From 8ab1e6689c7cf1a3e8bf56d30dfb7f787c642a3d Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 14 May 2024 14:11:24 +0200 Subject: [PATCH 2/2] chore(release): v6.7.1 (#538) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6ba770c..69c488ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/specs", - "version": "6.7.0", + "version": "6.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/specs", - "version": "6.7.0", + "version": "6.7.1", "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.11" diff --git a/package.json b/package.json index e1add524..b1e226c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/specs", - "version": "6.7.0", + "version": "6.7.1", "description": "AsyncAPI schema versions", "main": "index.js", "types": "index.d.ts",