Skip to content

Commit

Permalink
fix: add separate messsage example object (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored May 14, 2024
1 parent dc0d01d commit 6c5b1a7
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 96 deletions.
35 changes: 35 additions & 0 deletions definitions/3.0.0/messageExampleObject.json
Original file line number Diff line number Diff line change
@@ -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"
}
32 changes: 1 addition & 31 deletions definitions/3.0.0/messageObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion definitions/3.0.0/messageTrait.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"type": "array",
"description": "List of examples.",
"items": {
"type": "object"
"$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json"
}
},
"bindings": {
Expand Down
67 changes: 35 additions & 32 deletions schemas/3.0.0-without-$id.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -4678,7 +4681,7 @@
"type": "array",
"description": "List of examples.",
"items": {
"type": "object"
"$ref": "#/definitions/messageExampleObject"
}
},
"bindings": {
Expand Down
68 changes: 36 additions & 32 deletions schemas/3.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -4748,7 +4752,7 @@
"type": "array",
"description": "List of examples.",
"items": {
"type": "object"
"$ref": "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json"
}
},
"bindings": {
Expand Down

0 comments on commit 6c5b1a7

Please sign in to comment.