Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add reply object and reply address object #330

Merged
70 changes: 52 additions & 18 deletions definitions/3.0.0/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,36 @@
"$ref": "http://asyncapi.com/definitions/3.0.0/messageTrait.json"
}
},
"replies": {
"type": "object",
"patternProperties": {
"^[\\w\\d\\.\\-_]+$": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/operationReply.json"
}
]
}
}
},
"replyAddresses": {
"type": "object",
"patternProperties": {
"^[\\w\\d\\.\\-_]+$": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json"
}
]
}
}
},
"serverBindings": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing the serverBindings? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL, good catch! 👀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! Thanks!

"type": "object",
"additionalProperties": {
Expand All @@ -106,28 +136,32 @@
},
"tags": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
}
]
"patternProperties": {
"^[\\w\\d\\.\\-_]+$": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
}
]
}
}
},
"externalDocs": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
"patternProperties": {
"^[\\w\\d\\.\\-_]+$": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
}
}
}
},
Expand Down
16 changes: 16 additions & 0 deletions definitions/3.0.0/operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@
"channel": {
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
"messages": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
}
},
"reply": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/operationReply.json"
}
]
},
"traits": {
"type": "array",
"items": {
Expand Down
26 changes: 26 additions & 0 deletions definitions/3.0.0/operationReply.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"address": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json"
}
]
},
"channel": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field was created before my PR. I will add that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smoya Added :) Can you accept?

"$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"
}
25 changes: 25 additions & 0 deletions definitions/3.0.0/operationReplyAddress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"required": [
"location"
],
"properties": {
"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."
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json"
}