Skip to content

Commit

Permalink
feat: add reply object and reply address object (#330)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergio Moya <1083296+smoya@users.noreply.github.com>
  • Loading branch information
magicmatatjahu and smoya authored May 4, 2023
1 parent 2b3e23f commit b48eb67
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 18 deletions.
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": {
"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
32 changes: 32 additions & 0 deletions definitions/3.0.0/operationReply.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"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": {
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
"messages": {
"type": "array",
"items": {
"$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"
}

0 comments on commit b48eb67

Please sign in to comment.