@asyncapi/specs
Version:
AsyncAPI schema versions
132 lines (131 loc) • 3.77 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.1.0/messageObject.json",
"description": "Describes a message received on a given channel and operation.",
"type": "object",
"properties": {
"title": {
"description": "A human-friendly title for the message.",
"type": "string"
},
"description": {
"description": "A longer description of the message. CommonMark is allowed.",
"type": "string"
},
"examples": {
"description": "List of examples.",
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.1.0/messageExampleObject.json"
}
},
"deprecated": {
"default": false,
"type": "boolean"
},
"bindings": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json"
}
]
},
"contentType": {
"description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.",
"type": "string"
},
"correlationId": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/correlationId.json"
}
]
},
"externalDocs": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/externalDocs.json"
}
]
},
"headers": {
"$ref": "http://asyncapi.com/definitions/3.1.0/anySchema.json"
},
"name": {
"description": "Name of the message.",
"type": "string"
},
"payload": {
"$ref": "http://asyncapi.com/definitions/3.1.0/anySchema.json"
},
"summary": {
"description": "A brief summary of the message.",
"type": "string"
},
"tags": {
"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 message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/messageTrait.json"
},
{
"type": "array",
"items": [
{
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.1.0/messageTrait.json"
}
]
},
{
"type": "object",
"additionalItems": true
}
]
}
]
}
}
},
"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/messageObject.json"
}
}