@asyncapi/specs
Version:
AsyncAPI schema versions
108 lines (107 loc) • 3.78 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.1.0/operation.json",
"description": "Describes a specific operation.",
"type": "object",
"required": [ "action", "channel" ],
"properties": {
"title": {
"description": "A human-friendly title for the operation.",
"type": "string"
},
"description": {
"description": "A longer description of the operation. CommonMark is allowed.",
"type": "string"
},
"action": {
"description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.",
"type": "string",
"enum": [ "send", "receive" ]
},
"bindings": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json"
}
]
},
"channel": {
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
"externalDocs": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/externalDocs.json"
}
]
},
"messages": {
"description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.",
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
}
},
"reply": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/operationReply.json"
}
]
},
"security": {
"$ref": "http://asyncapi.com/definitions/3.1.0/securityRequirements.json"
},
"summary": {
"description": "A brief summary of the operation.",
"type": "string"
},
"tags": {
"description": "A list of tags for logical grouping and categorization of operations.",
"type": "array",
"uniqueItems": true,
"items": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/tag.json"
}
]
}
},
"traits": {
"description": "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/operationTrait.json"
}
]
}
}
},
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.1.0/specificationExtension.json"
}
},
"additionalProperties": false,
"example": {
"$ref": "http://asyncapi.com/examples/3.1.0/operation.json"
}
}