From a9caf9b30eab49b0917dc43b3c4c281094eda453 Mon Sep 17 00:00:00 2001 From: Clemens Vasters Date: Thu, 7 Dec 2023 20:06:47 +0100 Subject: [PATCH] message-metadata split (#63) * message-metadata split Signed-off-by: Clemens Vasters * baseDefinitionUrl reference Signed-off-by: Clemens Vasters * spec links Signed-off-by: Clemens Vasters * adjusted for core spec changes Signed-off-by: Clemens Vasters * adjusted for new lowercase rules Signed-off-by: Clemens Vasters * tweaks for multiple ifvalue in the same object Signed-off-by: Clemens Vasters * common attribute casing Signed-off-by: Clemens Vasters --------- Signed-off-by: Clemens Vasters --- cloudevents/schemas/document-schema.avsc | 929 ++++++------ cloudevents/schemas/document-schema.json | 1311 +++++++++-------- cloudevents/schemas/openapi.json | 754 +++++----- cloudevents/spec.md | 23 +- .../templates/xregistry_openapi_template.json | 40 +- endpoint/model.json | 574 ++++---- endpoint/schemas/document-schema.avsc | 812 +++++----- endpoint/schemas/document-schema.json | 1262 ++++++++-------- endpoint/spec.md | 8 +- message/model.json | 1298 ++++++++-------- message/schemas/document-schema.avsc | 676 ++++----- message/schemas/document-schema.json | 1130 +++++++------- message/schemas/openapi.json | 486 +++--- message/spec.md | 183 ++- schema/model.json | 6 +- schema/schemas/document-schema.avsc | 82 +- schema/schemas/document-schema.json | 30 +- schema/schemas/openapi.json | 100 +- tools/schema-generator.py | 287 ++-- 19 files changed, 5137 insertions(+), 4854 deletions(-) diff --git a/cloudevents/schemas/document-schema.avsc b/cloudevents/schemas/document-schema.avsc index c45dc57..2be74be 100644 --- a/cloudevents/schemas/document-schema.avsc +++ b/cloudevents/schemas/document-schema.avsc @@ -12,43 +12,43 @@ "name": "EndpointType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -58,14 +58,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -75,14 +75,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -93,8 +93,13 @@ }, { "type": "string", - "name": "Format", - "doc": "Endpoint message format identifier. If set, all definitions MUST use this format value." + "name": "format", + "doc": "Endpoint metadata format identifier. If set, all definitions MUST use this format value." + }, + { + "type": "string", + "name": "binding", + "doc": "Endpoint message binding identifier. If set, all definitions MUST use this binding value." }, { "type": { @@ -104,43 +109,45 @@ { "type": { "type": "array", + "name": "AuthorizationArrayType", "items": { "type": "record", "name": "AuthorizationType", "fields": [ { "type": "string", - "name": "Type", + "name": "type", "doc": "The authentication/authorization type. OAuth2, Plain, APIKey, and X509Cert are well-defined." }, { "type": "string", - "name": "Resourceuri", + "name": "resourceuri", "doc": "The resource uri for which authorization shall be granted (if applicable)" }, { "type": "string", - "name": "Authorityuri", + "name": "authorityuri", "doc": "The authority uri where authorization shall be requested (if applicable)" }, { "type": { "type": "array", + "name": "GrantTypesArrayType", "items": { "type": "string" } }, - "name": "GrantTypes", + "name": "grantTypes", "doc": "The grant types that can be requested (if applicable)" } ] } }, - "name": "Authorization", + "name": "authorization", "doc": "Authorization options. These are hints for the adapter for interacting with the authorization endpoint. This is not a credentials configuration." }, { - "name": "Protocol", + "name": "protocol", "type": [ { "type": "record", @@ -153,61 +160,35 @@ "fields": [ { "type": "string", - "name": "Node", + "name": "node", "doc": "The AMQP node name. Commonly the name of a queue or a topic." }, { "type": "boolean", - "name": "Durable", + "name": "durable", "doc": "The AMQP durable flag. Whether the node is durable or transient." }, { "type": { "type": "map", "name": "ProtocolAmqp10LinkPropertiesType", - "values": { - "type": "record", - "name": "ProtocolAmqp10LinkPropertiesItemType", - "fields": [ - { - "type": "string", - "name": "Name", - "doc": "Link property name" - }, - { - "type": "string", - "name": "Value", - "doc": "Link property value" - } - ] - } + "values": "string" }, - "name": "LinkProperties", + "name": "linkProperties", "doc": "An optional map of AMQP link properties to use with the endpoint" }, { "type": { - "type": "record", + "type": "map", "name": "ProtocolAmqp10ConnectionPropertiesType", - "fields": [ - { - "type": "string", - "name": "Name", - "doc": "Connection property name" - }, - { - "type": "string", - "name": "Value", - "doc": "Connection property value" - } - ] + "values": "string" }, - "name": "ConnectionProperties", + "name": "connectionProperties", "doc": "An optional map of AMQP connection properties to use with the endpoint" }, { "type": "string", - "name": "DistributionMode", + "name": "distributionMode", "doc": "The AMQP distribution mode for receivers. Can be 'move' or 'copy'. A value of 'move' indicates an exclusive lock on the message. A value of 'copy' indicates a non-exclusive lock on the message." }, { @@ -222,7 +203,7 @@ } ] }, - "name": "Options", + "name": "options", "doc": "AMQP 1.0 connection options" } ] @@ -238,37 +219,37 @@ "fields": [ { "type": "string", - "name": "Topic", + "name": "topic", "doc": "The MQTT topic path" }, { "type": "int", - "name": "Qos", + "name": "qos", "doc": "The MQTT QoS level. May be 0, 1, or 2." }, { "type": "boolean", - "name": "Retain", + "name": "retain", "doc": "The MQTT retain flag to use for publishers on ths endpoint" }, { "type": "boolean", - "name": "CleanSession", + "name": "cleanSession", "doc": "The MQTT clean session flag to use for publishers on this endpoint" }, { "type": "string", - "name": "WillTopic", + "name": "willTopic", "doc": "The MQTT will topic to configure for publishers on this endpoint" }, { "type": "string", - "name": "WillMessage", + "name": "willMessage", "doc": "The MQTT will message definition to configure for publishers on this endpoint" } ] }, - "name": "Options", + "name": "options", "doc": "MQTT 5.0 connection options" } ] @@ -284,37 +265,37 @@ "fields": [ { "type": "string", - "name": "Topic", + "name": "topic", "doc": "MQTT topic path" }, { "type": "int", - "name": "Qos", + "name": "qos", "doc": "The MQTT QoS level\u00c3\u00b6. May be 0, 1, or 2." }, { "type": "boolean", - "name": "Retain", + "name": "retain", "doc": "The MQTT retain flag to use for publishers on ths endpoint" }, { "type": "boolean", - "name": "CleanSession", + "name": "cleanSession", "doc": "The MQTT clean session flag to use for publishers on this endpoint" }, { "type": "string", - "name": "WillTopic", + "name": "willTopic", "doc": "The MQTT will topic to configure for publishers on this endpoint" }, { "type": "string", - "name": "WillMessage", + "name": "willMessage", "doc": "The MQTT will message definition to configure for publishers on this endpoint" } ] }, - "name": "Options", + "name": "options", "doc": "MQTT 3.1.1 connection options" } ] @@ -330,59 +311,60 @@ "fields": [ { "type": "string", - "name": "Method", + "name": "method", "doc": "The HTTP method name" }, { "type": { "type": "array", + "name": "ProtocolHTTPHeadersArrayType", "items": { "type": "record", "name": "ProtocolHTTPHeadersType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "HTTP header name" }, { "type": "string", - "name": "Value", + "name": "value", "doc": "HTTP header value" } ] } }, - "name": "Headers", + "name": "headers", "doc": "HTTP headers to use with the endpoint. The same header may be specified multiple times with different values. The HTTP header names are case insensitive." }, { "type": { - "type": "map", - "name": "ProtocolHTTPQueryType", - "values": { + "type": "array", + "name": "ProtocolHTTPQueryArrayType", + "items": { "type": "record", - "name": "ProtocolHTTPQueryItemType", + "name": "ProtocolHTTPQueryType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The HTTP query parameter name" }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The HTTP query parameter value" } ] } }, - "name": "Query", + "name": "query", "doc": "HTTP query parameters" } ] }, - "name": "Options", + "name": "options", "doc": "HTTP options. These apply to all HTTP versions since the application model is the same across versions." } ] @@ -398,27 +380,27 @@ "fields": [ { "type": "string", - "name": "Topic", + "name": "topic", "doc": "Apache Kafka topic name" }, { "type": "int", - "name": "Acks", + "name": "acks", "doc": "The Apache Kafka acks setting to use. If no acks setting is specified, the default is -1." }, { "type": "bytes", - "name": "Key", + "name": "key", "doc": "The Apache Kafka record key" }, { "type": "string", - "name": "ConsumerGroup", + "name": "consumergroup", "doc": "The Apache Kafka consumer group name to use for consumers" }, { "type": "int", - "name": "Partition", + "name": "partition", "doc": "Optional. The Apache Kafka partition number to use when writing to or receiving from Apache Kafka" }, { @@ -431,23 +413,23 @@ "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The Apache Kafka header name" }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The Apache Kafka header value" } ] } }, - "name": "Headers", + "name": "headers", "doc": "The Apache Kafka headers for publishers on this endpoint" } ] }, - "name": "Options", + "name": "options", "doc": "Apache Kafka options" } ] @@ -463,12 +445,12 @@ "fields": [ { "type": "string", - "name": "Subject", + "name": "subject", "doc": "The NATS subject" } ] }, - "name": "Options", + "name": "options", "doc": "NATS options" } ] @@ -479,21 +461,22 @@ { "type": { "type": "array", + "name": "EndpointsArrayType", "items": { "type": "string" } }, - "name": "Endpoints", + "name": "endpoints", "doc": "The network addresses that are for communication with the endpoint. The endpoints are ordered by preference, with the first endpoint being the preferred endpoint. Some protocol implementations might not support multiple endpoints, in which case all but the first endpoint might be ignored. Whether the URI just identifies a network host or links directly to a resource managed by the network host is protocol specific." }, { "type": "boolean", - "name": "Strict", + "name": "strict", "doc": "If `true`, the endpoint metadata represents a public, live endpoint that is available for communication and a strict validator MAY test the liveness of the endpoint." } ] }, - "name": "Config", + "name": "config", "doc": "Configuration information for this endpoint" }, { @@ -505,43 +488,43 @@ "name": "DefinitionType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -551,14 +534,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -568,14 +551,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -585,864 +568,877 @@ ] }, { - "name": "Format", + "type": "string", + "name": "baseDefinitionUrl", + "doc": "Reference to a base definition for this definition, either via a (relative) URL or a fragment identifier. The base definition is overridden by this definition. If not present, this definition does not override any base definition." + }, + { + "name": "format", + "type": [ + { + "type": "record", + "name": "FormatNoneType", + "fields": [] + }, + { + "type": "record", + "name": "FormatCloudevents10Type", + "fields": [ + { + "type": { + "type": "record", + "name": "FormatCloudevents10MetadataType", + "fields": [ + { + "type": { + "type": "record", + "name": "FormatCloudevents10TypeType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents type value template." + } + ] + }, + "name": "type", + "doc": "CloudEvents type." + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10SourceType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents source value template." + } + ] + }, + "name": "source", + "doc": "CloudEvents source" + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10SubjectType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents subject value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "CloudEvents subject required." + } + ] + }, + "name": "subject", + "doc": "CloudEvents subject" + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10IdType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents id value template." + } + ] + }, + "name": "id", + "doc": "CloudEvents id" + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10TimeType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "The timestamp value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "The timestamp required." + } + ] + }, + "name": "time", + "doc": "The timestamp of when the event happened." + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10DataschemaType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "The uri value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "The uri required." + } + ] + }, + "name": "dataschema", + "doc": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." + }, + { + "name": "Extensions", + "type": { + "type": "map", + "name": "FormatCloudevents10ExtensionsType", + "default": {}, + "values": { + "type": "record", + "name": "FormatCloudevents10ExtensionItemType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "The value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "Whether the extension is required" + } + ] + } + }, + "doc": "CloudEvent extension property" + } + ] + }, + "name": "metadata", + "doc": "CloudEvents metadata constraints." + } + ] + } + ], + "doc": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups." + }, + { + "name": "binding", "type": [ { "type": "record", - "name": "FormatAmqp10Type", + "name": "BindingNoneType", + "fields": [] + }, + { + "type": "record", + "name": "BindingAmqp10Type", "fields": [ { "type": { "type": "record", - "name": "FormatAmqp10MetadataType", + "name": "BindingAmqp10MessageType", "fields": [ { "type": { "type": "record", - "name": "FormatAmqp10PropertiesType", + "name": "BindingAmqp10PropertiesType", "fields": [ { "type": { "type": "record", - "name": "FormatAmqp10MessageIdType", + "name": "BindingAmqp10MessageIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP message-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP message-id required." } ] }, - "name": "MessageId", + "name": "messageId", "doc": "AMQP message-id." }, { "type": { "type": "record", - "name": "FormatAmqp10UserIdType", + "name": "BindingAmqp10UserIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP user-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP user-id required." } ] }, - "name": "UserId", + "name": "userId", "doc": "AMQP user-id." }, { "type": { "type": "record", - "name": "FormatAmqp10ToType", + "name": "BindingAmqp10ToType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP to value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP to required." } ] }, - "name": "To", + "name": "to", "doc": "AMQP to." }, { "type": { "type": "record", - "name": "FormatAmqp10SubjectType", + "name": "BindingAmqp10SubjectType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP subject value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP subject required." } ] }, - "name": "Subject", + "name": "subject", "doc": "AMQP subject." }, { "type": { "type": "record", - "name": "FormatAmqp10ReplyToType", + "name": "BindingAmqp10ReplyToType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP reply-to value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP reply-to required." } ] }, - "name": "ReplyTo", + "name": "replyTo", "doc": "AMQP reply-to." }, { "type": { "type": "record", - "name": "FormatAmqp10CorrelationIdType", + "name": "BindingAmqp10CorrelationIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP correlation-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP correlation-id required." } ] }, - "name": "CorrelationId", + "name": "correlationId", "doc": "AMQP correlation-id." }, { "type": { "type": "record", - "name": "FormatAmqp10ContentTypeType", + "name": "BindingAmqp10ContentTypeType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP content-type value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP content-type required." } ] }, - "name": "ContentType", + "name": "contentType", "doc": "AMQP content-type." }, { "type": { "type": "record", - "name": "FormatAmqp10ContentEncodingType", + "name": "BindingAmqp10ContentEncodingType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP content-encoding value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP content-encoding required." } ] }, - "name": "ContentEncoding", + "name": "contentEncoding", "doc": "AMQP content-encoding." }, { "type": { "type": "record", - "name": "FormatAmqp10AbsoluteExpiryTimeType", + "name": "BindingAmqp10AbsoluteExpiryTimeType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP absolute-expiry-time value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP absolute-expiry-time required." } ] }, - "name": "AbsoluteExpiryTime", + "name": "absoluteExpiryTime", "doc": "AMQP absolute-expiry-time." }, { "type": { "type": "record", - "name": "FormatAmqp10GroupIdType", + "name": "BindingAmqp10GroupIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP group-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP group-id required." } ] }, - "name": "GroupId", + "name": "groupId", "doc": "AMQP group-id." }, { "type": { "type": "record", - "name": "FormatAmqp10GroupSequenceType", + "name": "BindingAmqp10GroupSequenceType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP group-sequence value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP group-sequence required." } ] }, - "name": "GroupSequence", + "name": "groupSequence", "doc": "AMQP group-sequence." }, { "type": { "type": "record", - "name": "FormatAmqp10ReplyToGroupIdType", + "name": "BindingAmqp10ReplyToGroupIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP reply-to-group-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP reply-to-group-id required." } ] }, - "name": "ReplyToGroupId", + "name": "replyToGroupId", "doc": "AMQP reply-to-group-id." } ] }, - "name": "Properties" + "name": "properties" }, { "type": { "type": "map", - "name": "FormatAmqp10ApplicationPropertiesType", + "name": "BindingAmqp10ApplicationPropertiesType", "values": { "type": "record", - "name": "FormatAmqp10ApplicationPropertiesItemType", + "name": "BindingAmqp10ApplicationPropertiesItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "The application property name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "The application property value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "The application property required." }, { "type": "string", - "name": "Type", + "name": "type", "doc": "The application property type." } ] } }, - "name": "ApplicationProperties" + "name": "applicationProperties" }, { "type": { "type": "map", - "name": "FormatAmqp10MessageAnnotationsType", + "name": "BindingAmqp10MessageAnnotationsType", "values": { "type": "record", - "name": "FormatAmqp10MessageAnnotationsItemType", + "name": "BindingAmqp10MessageAnnotationsItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "The message annotation name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "The message annotation value" }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "Whether the message annotation is required" }, { "type": "string", - "name": "Type", + "name": "type", "doc": "The message annotation type." } ] } }, - "name": "MessageAnnotations" + "name": "messageAnnotations" }, { "type": { "type": "map", - "name": "FormatAmqp10DeliveryAnnotationsType", + "name": "BindingAmqp10DeliveryAnnotationsType", "values": { "type": "record", - "name": "FormatAmqp10DeliveryAnnotationsItemType", + "name": "BindingAmqp10DeliveryAnnotationsItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "The delivery annotation name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "The delivery annotation value" }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "Whether the annotation is required" }, { "type": "string", - "name": "Type", + "name": "type", "doc": "The annotation type." } ] } }, - "name": "DeliveryAnnotations" + "name": "deliveryAnnotations" }, { "type": { "type": "map", - "name": "FormatAmqp10HeaderType", + "name": "BindingAmqp10HeaderType", "values": { "type": "record", - "name": "FormatAmqp10HeaderItemType", + "name": "BindingAmqp10HeaderItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "AMQP header name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP header value." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP header required." }, { "type": "string", - "name": "Type", + "name": "type", "doc": "AMQP header type." } ] } }, - "name": "Header" + "name": "header" }, { "type": { "type": "map", - "name": "FormatAmqp10FooterType", + "name": "BindingAmqp10FooterType", "values": { "type": "record", - "name": "FormatAmqp10FooterItemType", + "name": "BindingAmqp10FooterItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "AMQP footer name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP footer value." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP footer required." }, { "type": "string", - "name": "Type", + "name": "type", "doc": "AMQP footer type." } ] } }, - "name": "Footer" + "name": "footer" } ] }, - "name": "Metadata", + "name": "message", "doc": "AMQP message metadata constraints." } ] }, { "type": "record", - "name": "FormatMqtt311Type", + "name": "BindingMqtt311Type", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt311MetadataType", + "name": "BindingMqtt311MessageType", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt311QosType", + "name": "BindingMqtt311QosType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT qos value template." } ] }, - "name": "Qos", + "name": "qos", "doc": "MQTT qos." }, { "type": { "type": "record", - "name": "FormatMqtt311RetainType", + "name": "BindingMqtt311RetainType", "fields": [ { "type": "boolean", - "name": "Value", + "name": "value", "doc": "MQTT retain value template." } ] }, - "name": "Retain", + "name": "retain", "doc": "MQTT retain." }, { "type": { "type": "record", - "name": "FormatMqtt311TopicNameType", + "name": "BindingMqtt311TopicNameType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT topic-name value template." } ] }, - "name": "TopicName", + "name": "topicName", "doc": "MQTT topic-name." } ] }, - "name": "Metadata", + "name": "message", "doc": "MQTT message metadata constraints." } ] }, { "type": "record", - "name": "FormatMqtt50Type", + "name": "BindingMqtt50Type", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt50MetadataType", + "name": "BindingMqtt50MessageType", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt50QosType", + "name": "BindingMqtt50QosType", "fields": [ { "type": "int", - "name": "Value", + "name": "value", "doc": "MQTT qos value template." } ] }, - "name": "Qos", + "name": "qos", "doc": "MQTT qos." }, { "type": { "type": "record", - "name": "FormatMqtt50RetainType", + "name": "BindingMqtt50RetainType", "fields": [ { "type": "boolean", - "name": "Value", + "name": "value", "doc": "MQTT retain value template." } ] }, - "name": "Retain", + "name": "retain", "doc": "MQTT retain." }, { "type": { "type": "record", - "name": "FormatMqtt50TopicNameType", + "name": "BindingMqtt50TopicNameType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT topic-name value template." } ] }, - "name": "TopicName", + "name": "topicName", "doc": "MQTT topic-name." }, { "type": { "type": "record", - "name": "FormatMqtt50MessageExpiryIntervalType", + "name": "BindingMqtt50MessageExpiryIntervalType", "fields": [ { "type": "int", - "name": "Value", + "name": "value", "doc": "MQTT message-expiry-interval value template." } ] }, - "name": "MessageExpiryInterval", + "name": "messageExpiryInterval", "doc": "MQTT message-expiry-interval." }, { "type": { "type": "record", - "name": "FormatMqtt50ResponseTopicType", + "name": "BindingMqtt50ResponseTopicType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT response-topic value template." } ] }, - "name": "ResponseTopic", + "name": "responseTopic", "doc": "MQTT response-topic." }, { "type": { "type": "record", - "name": "FormatMqtt50CorrelationDataType", + "name": "BindingMqtt50CorrelationDataType", "fields": [ { "type": "bytes", - "name": "Value", + "name": "value", "doc": "MQTT correlation-data value template." } ] }, - "name": "CorrelationData", + "name": "correlationData", "doc": "MQTT correlation-data." }, { "type": { "type": "record", - "name": "FormatMqtt50ContentTypeType", + "name": "BindingMqtt50ContentTypeType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT content-type value template." } ] }, - "name": "ContentType", + "name": "contentType", "doc": "MQTT content-type." }, { "type": { "type": "array", + "name": "BindingMqtt50UserPropertiesArrayType", "items": { "type": "record", - "name": "FormatMqtt50UserPropertiesType", + "name": "BindingMqtt50UserPropertiesType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "MQTT user-property name." }, { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT user-property value." } ] } }, - "name": "UserProperties", + "name": "userProperties", "doc": "MQTT user-properties." } ] }, - "name": "Metadata", + "name": "message", "doc": "MQTT message metadata constraints." } ] }, { "type": "record", - "name": "FormatKafka011Type", + "name": "BindingKAFKAType", "fields": [ { "type": { "type": "record", - "name": "FormatKafka011MetadataType", + "name": "BindingKAFKAMessageType", "fields": [ { "type": "string", - "name": "Topic", + "name": "topic", "doc": "The Apache Kafka topic." }, { "type": "int", - "name": "Partition", + "name": "partition", "doc": "The Apache Kafka partition." }, { "type": "bytes", - "name": "Key", + "name": "key", "doc": "The Apache Kafka key." }, { "type": { "type": "map", - "name": "FormatKafka011HeadersType", + "name": "BindingKAFKAHeadersType", "values": { "type": "record", - "name": "FormatKafka011HeadersItemType", + "name": "BindingKAFKAHeadersItemType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The Apache Kafka header name." }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The Apache Kafka header value." } ] } }, - "name": "Headers", + "name": "headers", "doc": "The Apache Kafka headers." }, { "type": "int", - "name": "Timestamp", + "name": "timestamp", "doc": "The Apache Kafka timestamp." } ] }, - "name": "Metadata", + "name": "message", "doc": "The Apache Kafka message metadata constraints." } ] }, { "type": "record", - "name": "FormatCloudevents10Type", + "name": "BindingHTTPType", "fields": [ { "type": { "type": "record", - "name": "FormatCloudevents10MetadataType", - "fields": [ - { - "type": { - "type": "record", - "name": "FormatCloudevents10TypeType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents type value template." - } - ] - }, - "name": "Type", - "doc": "CloudEvents type." - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10SourceType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents source value template." - } - ] - }, - "name": "Source", - "doc": "CloudEvents source" - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10SubjectType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents subject value template." - }, - { - "type": "boolean", - "name": "Required", - "doc": "CloudEvents subject required." - } - ] - }, - "name": "Subject", - "doc": "CloudEvents subject" - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10IdType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents id value template." - } - ] - }, - "name": "Id", - "doc": "CloudEvents id" - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10TimeType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "The timestamp value template." - }, - { - "type": "boolean", - "name": "Required", - "doc": "The timestamp required." - } - ] - }, - "name": "Time", - "doc": "The timestamp of when the event happened." - }, - { - "type": "string", - "name": "Dataschema", - "doc": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." - }, - { - "name": "Extensions", - "type": { - "type": "map", - "name": "FormatCloudevents10ExtensionsType", - "default": {}, - "values": { - "type": "record", - "name": "FormatCloudevents10ExtensionItemType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "The value template." - }, - { - "type": "boolean", - "name": "Required", - "doc": "Whether the extension is required" - } - ] - } - }, - "doc": "CloudEvent extension property" - } - ] - }, - "name": "Metadata", - "doc": "CloudEvents metadata constraints." - } - ] - }, - { - "type": "record", - "name": "FormatHttp11Type", - "fields": [ - { - "type": { - "type": "record", - "name": "FormatHttp11MetadataType", + "name": "BindingHTTPMessageType", "fields": [ { "type": { "type": "array", + "name": "BindingHTTPHeadersArrayType", "items": { "type": "record", - "name": "FormatHttp11HeadersType", + "name": "BindingHTTPHeadersType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The HTTP header name." }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The HTTP header value." } ] } }, - "name": "Headers", + "name": "headers", "doc": "The HTTP headers." }, { @@ -1483,28 +1479,28 @@ } ] }, - "name": "Query", + "name": "query", "doc": "The HTTP query parameters." }, { "type": "string", - "name": "Path", + "name": "path", "doc": "The HTTP path as a uri template." }, { "type": "string", - "name": "Method", + "name": "method", "doc": "The HTTP method." } ] }, - "name": "Metadata", + "name": "message", "doc": "The HTTP message metadata constraints." } ] } ], - "doc": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups." + "doc": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups." } ] } @@ -1515,51 +1511,51 @@ } }, { - "name": "definitionGroups", + "name": "definitiongroups", "type": { "type": "map", "values": { "type": "record", - "name": "DefinitionGroupType", + "name": "DefinitiongroupType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -1569,14 +1565,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -1586,14 +1582,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -1604,8 +1600,13 @@ }, { "type": "string", - "name": "Format", - "doc": "Message format identifier. All definitions in this group share this format. Mixed-format groups are not permitted." + "name": "format", + "doc": "Format identifier that defines the common metadata information for the message. All definitions in this group share this format. Mixed-format groups are not permitted." + }, + { + "type": "string", + "name": "binding", + "doc": "Binding identifier that defines the transport message binding. All definitions in this group share this binding type. Mixed-binding groups are not permitted." }, { "name": "definitions", @@ -1619,51 +1620,51 @@ } }, { - "name": "schemaGroups", + "name": "schemagroups", "type": { "type": "map", "values": { "type": "record", - "name": "SchemaGroupType", + "name": "SchemagroupType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -1673,14 +1674,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -1690,14 +1691,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -1715,43 +1716,43 @@ "name": "SchemaType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -1761,14 +1762,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -1778,14 +1779,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -1804,43 +1805,43 @@ "name": "SchemaVersionType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -1850,14 +1851,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -1867,14 +1868,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -1885,22 +1886,22 @@ }, { "type": "string", - "name": "Format", + "name": "format", "doc": "Schema format identifier for this schema version." }, { "type": "GenericRecord", - "name": "Schemaobject", + "name": "schemaobject", "doc": "Inlined schema document object" }, { "type": "string", - "name": "Schema", + "name": "schema", "doc": "Inlined schema document string" }, { "type": "string", - "name": "Schemaurl", + "name": "schemaurl", "doc": "Inlined schema document string" } ] @@ -1911,11 +1912,11 @@ "name": "SchemaVersionInfo", "fields": [ { - "name": "VersionsUrl", + "name": "versionsUrl", "type": "string" }, { - "name": "VersionCount", + "name": "versionCount", "type": "int" } ] diff --git a/cloudevents/schemas/document-schema.json b/cloudevents/schemas/document-schema.json index 2c6424d..474367b 100644 --- a/cloudevents/schemas/document-schema.json +++ b/cloudevents/schemas/document-schema.json @@ -8,16 +8,16 @@ "$ref": "#/definitions/endpoint" } }, - "definitionGroups": { + "definitiongroups": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/definitionGroup" + "$ref": "#/definitions/definitiongroup" } }, - "schemaGroups": { + "schemagroups": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/schemaGroup" + "$ref": "#/definitions/schemagroup" } } }, @@ -48,698 +48,721 @@ "labels": { "type": "object" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" + }, + "baseDefinitionUrl": { + "type": "string", + "format": "uri", + "description": "Reference to a base definition for this definition, either via a (relative) URL or a fragment identifier. The base definition is overridden by this definition. If not present, this definition does not override any base definition." } }, "required": [ "id" ], - "oneOf": [ + "allOf": [ { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "AMQP/1.0" - ] + "oneOf": [ + { + "properties": { + "format": { + "type": "string", + "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "None" + ], + "default": "None" + } + } }, - "metadata": { - "type": "object", - "description": "AMQP message metadata constraints.", + { "properties": { - "properties": { + "format": { + "type": "string", + "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "CloudEvents/1.0" + ] + }, + "metadata": { "type": "object", + "description": "CloudEvents metadata constraints.", "properties": { - "message-id": { + "type": { "type": "object", - "description": "AMQP message-id.", + "description": "CloudEvents type.", "properties": { "value": { "type": "string", - "description": "AMQP message-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP message-id required." + "description": "CloudEvents type value template." } } }, - "user-id": { + "source": { "type": "object", - "description": "AMQP user-id.", + "description": "CloudEvents source", "properties": { "value": { "type": "string", - "description": "AMQP user-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP user-id required." + "description": "CloudEvents source value template." } } }, - "to": { + "subject": { "type": "object", - "description": "AMQP to.", + "description": "CloudEvents subject", "properties": { "value": { "type": "string", - "description": "AMQP to value template." + "description": "CloudEvents subject value template." }, "required": { "type": "boolean", - "description": "AMQP to required." + "description": "CloudEvents subject required." } } }, - "subject": { + "id": { "type": "object", - "description": "AMQP subject.", + "description": "CloudEvents id", "properties": { "value": { "type": "string", - "description": "AMQP subject value template." - }, - "required": { - "type": "boolean", - "description": "AMQP subject required." + "description": "CloudEvents id value template." } } }, - "reply-to": { + "time": { "type": "object", - "description": "AMQP reply-to.", + "description": "The timestamp of when the event happened.", "properties": { "value": { "type": "string", - "description": "AMQP reply-to value template." + "description": "The timestamp value template." }, "required": { "type": "boolean", - "description": "AMQP reply-to required." + "description": "The timestamp required." } } }, - "correlation-id": { + "dataschema": { "type": "object", - "description": "AMQP correlation-id.", + "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default.", "properties": { "value": { "type": "string", - "description": "AMQP correlation-id value template." + "format": "uri-template", + "description": "The uri value template." }, "required": { "type": "boolean", - "description": "AMQP correlation-id required." + "description": "The uri required." } } - }, - "content-type": { + } + }, + "additionalProperties": { + "type": "object", + "description": "CloudEvent extension property", + "properties": { + "value": { + "type": "string", + "description": "The value template." + }, + "required": { + "type": "boolean", + "description": "Whether the extension is required" + } + } + } + } + }, + "required": [ + "format" + ] + } + ] + }, + { + "oneOf": [ + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "None" + ], + "default": "None" + } + } + }, + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "AMQP/1.0" + ] + }, + "message": { + "type": "object", + "description": "AMQP message metadata constraints.", + "properties": { + "properties": { "type": "object", - "description": "AMQP content-type.", "properties": { - "value": { - "type": "string", - "description": "AMQP content-type value template." + "message_id": { + "type": "object", + "description": "AMQP message-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP message-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP message-id required." + } + } }, - "required": { - "type": "boolean", - "description": "AMQP content-type required." + "user_id": { + "type": "object", + "description": "AMQP user-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP user-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP user-id required." + } + } + }, + "to": { + "type": "object", + "description": "AMQP to.", + "properties": { + "value": { + "type": "string", + "description": "AMQP to value template." + }, + "required": { + "type": "boolean", + "description": "AMQP to required." + } + } + }, + "subject": { + "type": "object", + "description": "AMQP subject.", + "properties": { + "value": { + "type": "string", + "description": "AMQP subject value template." + }, + "required": { + "type": "boolean", + "description": "AMQP subject required." + } + } + }, + "reply_to": { + "type": "object", + "description": "AMQP reply-to.", + "properties": { + "value": { + "type": "string", + "description": "AMQP reply-to value template." + }, + "required": { + "type": "boolean", + "description": "AMQP reply-to required." + } + } + }, + "correlation_id": { + "type": "object", + "description": "AMQP correlation-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP correlation-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP correlation-id required." + } + } + }, + "content_type": { + "type": "object", + "description": "AMQP content-type.", + "properties": { + "value": { + "type": "string", + "description": "AMQP content-type value template." + }, + "required": { + "type": "boolean", + "description": "AMQP content-type required." + } + } + }, + "content_encoding": { + "type": "object", + "description": "AMQP content-encoding.", + "properties": { + "value": { + "type": "string", + "description": "AMQP content-encoding value template." + }, + "required": { + "type": "boolean", + "description": "AMQP content-encoding required." + } + } + }, + "absolute_expiry_time": { + "type": "object", + "description": "AMQP absolute-expiry-time.", + "properties": { + "value": { + "type": "string", + "description": "AMQP absolute-expiry-time value template." + }, + "required": { + "type": "boolean", + "description": "AMQP absolute-expiry-time required." + } + } + }, + "group_id": { + "type": "object", + "description": "AMQP group-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP group-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP group-id required." + } + } + }, + "group_sequence": { + "type": "object", + "description": "AMQP group-sequence.", + "properties": { + "value": { + "type": "string", + "description": "AMQP group-sequence value template." + }, + "required": { + "type": "boolean", + "description": "AMQP group-sequence required." + } + } + }, + "reply_to_group_id": { + "type": "object", + "description": "AMQP reply-to-group-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP reply-to-group-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP reply-to-group-id required." + } + } } } }, - "content-encoding": { + "application_properties": { "type": "object", - "description": "AMQP content-encoding.", - "properties": { - "value": { - "type": "string", - "description": "AMQP content-encoding value template." - }, - "required": { - "type": "boolean", - "description": "AMQP content-encoding required." + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The application property value template." + }, + "required": { + "type": "boolean", + "description": "The application property required." + }, + "type": { + "type": "string", + "description": "The application property type." + } } } }, - "absolute-expiry-time": { + "message_annotations": { "type": "object", - "description": "AMQP absolute-expiry-time.", - "properties": { - "value": { - "type": "string", - "description": "AMQP absolute-expiry-time value template." - }, - "required": { - "type": "boolean", - "description": "AMQP absolute-expiry-time required." + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The message annotation value" + }, + "required": { + "type": "boolean", + "description": "Whether the message annotation is required" + }, + "type": { + "type": "string", + "description": "The message annotation type." + } + } + } + }, + "delivery_annotations": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The delivery annotation value" + }, + "required": { + "type": "boolean", + "description": "Whether the annotation is required" + }, + "type": { + "type": "string", + "description": "The annotation type." + } } } }, - "group-id": { + "header": { "type": "object", - "description": "AMQP group-id.", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "AMQP header value." + }, + "required": { + "type": "boolean", + "description": "AMQP header required." + }, + "type": { + "type": "string", + "description": "AMQP header type." + } + } + } + }, + "footer": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "AMQP footer value." + }, + "required": { + "type": "boolean", + "description": "AMQP footer required." + }, + "type": { + "type": "string", + "description": "AMQP footer type." + } + } + } + } + } + } + }, + "required": [ + "binding" + ] + }, + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "MQTT/3.1.1" + ] + }, + "message": { + "type": "object", + "description": "MQTT message metadata constraints.", + "properties": { + "qos": { + "type": "object", + "description": "MQTT qos.", "properties": { "value": { "type": "string", - "description": "AMQP group-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP group-id required." + "description": "MQTT qos value template." } } }, - "group-sequence": { + "retain": { "type": "object", - "description": "AMQP group-sequence.", + "description": "MQTT retain.", "properties": { "value": { - "type": "string", - "description": "AMQP group-sequence value template." - }, - "required": { "type": "boolean", - "description": "AMQP group-sequence required." + "description": "MQTT retain value template." } } }, - "reply-to-group-id": { + "topic_name": { "type": "object", - "description": "AMQP reply-to-group-id.", + "description": "MQTT topic-name.", "properties": { "value": { "type": "string", - "description": "AMQP reply-to-group-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP reply-to-group-id required." + "description": "MQTT topic-name value template." } } } } + } + }, + "required": [ + "binding" + ] + }, + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "MQTT/5.0" + ] }, - "application-properties": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The application property name." - }, - "value": { - "type": "string", - "description": "The application property value template." - }, - "required": { - "type": "boolean", - "description": "The application property required." - }, - "type": { - "type": "string", - "description": "The application property type." - } - } - } - }, - "message-annotations": { + "message": { "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The message annotation name." - }, - "value": { - "type": "string", - "description": "The message annotation value" - }, - "required": { - "type": "boolean", - "description": "Whether the message annotation is required" - }, - "type": { - "type": "string", - "description": "The message annotation type." + "description": "MQTT message metadata constraints.", + "properties": { + "qos": { + "type": "object", + "description": "MQTT qos.", + "properties": { + "value": { + "type": "integer", + "description": "MQTT qos value template." + } } }, - "required": [ - "name" - ] - } - }, - "delivery-annotations": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The delivery annotation name." - }, - "value": { - "type": "string", - "description": "The delivery annotation value" - }, - "required": { - "type": "boolean", - "description": "Whether the annotation is required" - }, - "type": { - "type": "string", - "description": "The annotation type." + "retain": { + "type": "object", + "description": "MQTT retain.", + "properties": { + "value": { + "type": "boolean", + "description": "MQTT retain value template." + } } }, - "required": [ - "name" - ] - } - }, - "header": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "AMQP header name." - }, - "value": { - "type": "string", - "description": "AMQP header value." - }, - "required": { - "type": "boolean", - "description": "AMQP header required." - }, - "type": { - "type": "string", - "description": "AMQP header type." + "topic_name": { + "type": "object", + "description": "MQTT topic-name.", + "properties": { + "value": { + "type": "string", + "description": "MQTT topic-name value template." + } } }, - "required": [ - "name" - ] - } - }, - "footer": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "AMQP footer name." - }, - "value": { - "type": "string", - "description": "AMQP footer value." - }, - "required": { - "type": "boolean", - "description": "AMQP footer required." - }, - "type": { - "type": "string", - "description": "AMQP footer type." + "message_expiry_interval": { + "type": "object", + "description": "MQTT message-expiry-interval.", + "properties": { + "value": { + "type": "integer", + "description": "MQTT message-expiry-interval value template." + } } }, - "required": [ - "name" - ] - } - } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "MQTT/3.1.1" - ] - }, - "metadata": { - "type": "object", - "description": "MQTT message metadata constraints.", - "properties": { - "qos": { - "type": "object", - "description": "MQTT qos.", - "properties": { - "value": { - "type": "string", - "description": "MQTT qos value template." - } - } - }, - "retain": { - "type": "object", - "description": "MQTT retain.", - "properties": { - "value": { - "type": "boolean", - "description": "MQTT retain value template." - } - } - }, - "topic-name": { - "type": "object", - "description": "MQTT topic-name.", - "properties": { - "value": { - "type": "string", - "description": "MQTT topic-name value template." - } - } - } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "MQTT/5.0" - ] - }, - "metadata": { - "type": "object", - "description": "MQTT message metadata constraints.", - "properties": { - "qos": { - "type": "object", - "description": "MQTT qos.", - "properties": { - "value": { - "type": "integer", - "description": "MQTT qos value template." - } - } - }, - "retain": { - "type": "object", - "description": "MQTT retain.", - "properties": { - "value": { - "type": "boolean", - "description": "MQTT retain value template." - } - } - }, - "topic-name": { - "type": "object", - "description": "MQTT topic-name.", - "properties": { - "value": { - "type": "string", - "description": "MQTT topic-name value template." - } - } - }, - "message-expiry-interval": { - "type": "object", - "description": "MQTT message-expiry-interval.", - "properties": { - "value": { - "type": "integer", - "description": "MQTT message-expiry-interval value template." - } - } - }, - "response-topic": { - "type": "object", - "description": "MQTT response-topic.", - "properties": { - "value": { - "type": "string", - "description": "MQTT response-topic value template." - } - } - }, - "correlation-data": { - "type": "object", - "description": "MQTT correlation-data.", - "properties": { - "value": { - "type": "string", - "format": "base64", - "description": "MQTT correlation-data value template." - } - } - }, - "content-type": { - "type": "object", - "description": "MQTT content-type.", - "properties": { - "value": { - "type": "string", - "description": "MQTT content-type value template." - } - } - }, - "user-properties": { - "type": "array", - "description": "MQTT user-properties.", - "items": { - "properties": { - "name": { - "type": "string", - "description": "MQTT user-property name." - }, - "value": { - "type": "string", - "description": "MQTT user-property value." + "response_topic": { + "type": "object", + "description": "MQTT response-topic.", + "properties": { + "value": { + "type": "string", + "description": "MQTT response-topic value template." + } + } + }, + "correlation_data": { + "type": "object", + "description": "MQTT correlation-data.", + "properties": { + "value": { + "type": "string", + "format": "base64", + "description": "MQTT correlation-data value template." + } + } + }, + "content_type": { + "type": "object", + "description": "MQTT content-type.", + "properties": { + "value": { + "type": "string", + "description": "MQTT content-type value template." + } + } + }, + "user_properties": { + "type": "array", + "description": "MQTT user-properties.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "MQTT user-property name." + }, + "value": { + "type": "string", + "description": "MQTT user-property value." + } + } } } } } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "KAFKA/0.11" + }, + "required": [ + "binding" ] }, - "metadata": { - "type": "object", - "description": "The Apache Kafka message metadata constraints.", + { "properties": { - "topic": { - "type": "string", - "description": "The Apache Kafka topic." - }, - "partition": { - "type": "integer", - "description": "The Apache Kafka partition." - }, - "key": { + "binding": { "type": "string", - "format": "base64", - "description": "The Apache Kafka key." + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "KAFKA" + ] }, - "headers": { + "message": { "type": "object", - "description": "The Apache Kafka headers.", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The Apache Kafka header name." - }, - "value": { - "type": "string", - "description": "The Apache Kafka header value." + "description": "The Apache Kafka message metadata constraints.", + "properties": { + "topic": { + "type": "string", + "description": "The Apache Kafka topic." + }, + "partition": { + "type": "integer", + "description": "The Apache Kafka partition." + }, + "key": { + "type": "string", + "format": "base64", + "description": "The Apache Kafka key." + }, + "headers": { + "type": "object", + "description": "The Apache Kafka headers.", + "additionalProperties": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The Apache Kafka header name." + }, + "value": { + "type": "string", + "description": "The Apache Kafka header value." + } + } } + }, + "timestamp": { + "type": "integer", + "description": "The Apache Kafka timestamp." } } - }, - "timestamp": { - "type": "integer", - "description": "The Apache Kafka timestamp." } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "CloudEvents/1.0" + }, + "required": [ + "binding" ] }, - "metadata": { - "type": "object", - "description": "CloudEvents metadata constraints.", + { "properties": { - "type": { - "type": "object", - "description": "CloudEvents type.", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents type value template." - } - } - }, - "source": { - "type": "object", - "description": "CloudEvents source", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents source value template." - } - } + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "HTTP" + ] }, - "subject": { + "message": { "type": "object", - "description": "CloudEvents subject", + "description": "The HTTP message metadata constraints.", "properties": { - "value": { - "type": "string", - "description": "CloudEvents subject value template." + "headers": { + "type": "array", + "description": "The HTTP headers.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The HTTP header name." + }, + "value": { + "type": "string", + "description": "The HTTP header value." + } + } + } }, - "required": { - "type": "boolean", - "description": "CloudEvents subject required." - } - } - }, - "id": { - "type": "object", - "description": "CloudEvents id", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents id value template." - } - } - }, - "time": { - "type": "object", - "description": "The timestamp of when the event happened.", - "properties": { - "value": { + "query": { + "type": "object", + "description": "The HTTP query parameters." + }, + "path": { "type": "string", - "description": "The timestamp value template." + "description": "The HTTP path as a uri template." }, - "required": { - "type": "boolean", - "description": "The timestamp required." + "method": { + "type": "string", + "description": "The HTTP method." } } - }, - "dataschema": { - "type": "string", - "format": "uri-template", - "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." } }, - "additionalProperties": { - "type": "object", - "description": "CloudEvent extension property", - "properties": { - "value": { - "type": "string", - "description": "The value template." - }, - "required": { - "type": "boolean", - "description": "Whether the extension is required" - } - } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "HTTP/1.1" + "required": [ + "binding" ] - }, - "metadata": { - "type": "object", - "description": "The HTTP message metadata constraints.", - "properties": { - "headers": { - "type": "array", - "description": "The HTTP headers.", - "items": { - "properties": { - "name": { - "type": "string", - "description": "The HTTP header name." - }, - "value": { - "type": "string", - "description": "The HTTP header value." - } - } - } - }, - "query": { - "type": "object", - "description": "The HTTP query parameters." - }, - "path": { - "type": "string", - "description": "The HTTP path as a uri template." - }, - "method": { - "type": "string", - "description": "The HTTP method." - } - } } - }, - "required": [ - "format" ] } ] @@ -772,22 +795,26 @@ }, "format": { "type": "string", - "description": "Endpoint message format identifier. If set, all definitions MUST use this format value." + "description": "Endpoint metadata format identifier. If set, all definitions MUST use this format value." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, + "binding": { + "type": "string", + "description": "Endpoint message binding identifier. If set, all definitions MUST use this binding value." + }, "config": { "type": "object", "description": "Configuration information for this endpoint", @@ -796,6 +823,10 @@ "type": "array", "description": "Authorization options. These are hints for the adapter for interacting with the authorization endpoint. This is not a credentials configuration.", "items": { + "type": "object", + "required": [ + "type" + ], "properties": { "type": { "type": "string", @@ -816,10 +847,7 @@ "type": "string" } } - }, - "required": [ - "type" - ] + } } }, "endpoints": { @@ -860,52 +888,25 @@ "type": "boolean", "description": "The AMQP durable flag. Whether the node is durable or transient." }, - "link-properties": { + "link_properties": { "type": "object", "description": "An optional map of AMQP link properties to use with the endpoint", "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "Link property name" - }, - "value": { - "type": "string", - "description": "Link property value" - } - }, - "required": [ - "name", - "value" - ] + "type": "string" } }, - "connection-properties": { + "connection_properties": { "type": "object", "description": "An optional map of AMQP connection properties to use with the endpoint", - "properties": { - "name": { - "type": "string", - "description": "Connection property name" - }, - "value": { - "type": "string", - "description": "Connection property value" - } - }, - "required": [ - "name", - "value" - ] + "additionalProperties": { + "type": "string" + } }, - "distribution-mode": { + "distribution_mode": { "type": "string", "description": "The AMQP distribution mode for receivers. Can be 'move' or 'copy'. A value of 'move' indicates an exclusive lock on the message. A value of 'copy' indicates a non-exclusive lock on the message." } }, - "required": [ - "node" - ], "additionalProperties": { "type": "string", "description": "Further options to configure the AMQP 1.0 client" @@ -941,15 +942,15 @@ "type": "boolean", "description": "The MQTT retain flag to use for publishers on ths endpoint" }, - "clean-session": { + "clean_session": { "type": "boolean", "description": "The MQTT clean session flag to use for publishers on this endpoint" }, - "will-topic": { + "will_topic": { "type": "string", "description": "The MQTT will topic to configure for publishers on this endpoint" }, - "will-message": { + "will_message": { "type": "string", "format": "uri", "description": "The MQTT will message definition to configure for publishers on this endpoint" @@ -986,15 +987,15 @@ "type": "boolean", "description": "The MQTT retain flag to use for publishers on ths endpoint" }, - "clean-session": { + "clean_session": { "type": "boolean", "description": "The MQTT clean session flag to use for publishers on this endpoint" }, - "will-topic": { + "will_topic": { "type": "string", "description": "The MQTT will topic to configure for publishers on this endpoint" }, - "will-message": { + "will_message": { "type": "string", "format": "uri", "description": "The MQTT will message definition to configure for publishers on this endpoint" @@ -1027,6 +1028,11 @@ "type": "array", "description": "HTTP headers to use with the endpoint. The same header may be specified multiple times with different values. The HTTP header names are case insensitive.", "items": { + "type": "object", + "required": [ + "name", + "value" + ], "properties": { "name": { "type": "string", @@ -1036,17 +1042,18 @@ "type": "string", "description": "HTTP header value" } - }, - "required": [ - "name", - "value" - ] + } } }, "query": { - "type": "object", + "type": "array", "description": "HTTP query parameters", - "additionalProperties": { + "items": { + "type": "object", + "required": [ + "name", + "value" + ], "properties": { "name": { "type": "string", @@ -1056,17 +1063,10 @@ "type": "string", "description": "The HTTP query parameter value" } - }, - "required": [ - "name", - "value" - ] + } } } - }, - "required": [ - "method" - ] + } } }, "required": [ @@ -1085,6 +1085,9 @@ "options": { "type": "object", "description": "Apache Kafka options", + "required": [ + "topic" + ], "properties": { "topic": { "type": "string", @@ -1099,7 +1102,7 @@ "format": "base64", "description": "The Apache Kafka record key" }, - "consumer-group": { + "consumergroup": { "type": "string", "description": "The Apache Kafka consumer group name to use for consumers" }, @@ -1111,6 +1114,11 @@ "type": "object", "description": "The Apache Kafka headers for publishers on this endpoint", "additionalProperties": { + "type": "object", + "required": [ + "name", + "value" + ], "properties": { "name": { "type": "string", @@ -1120,17 +1128,10 @@ "type": "string", "description": "The Apache Kafka header value" } - }, - "required": [ - "name", - "value" - ] + } } } - }, - "required": [ - "topic" - ] + } } }, "required": [ @@ -1149,15 +1150,15 @@ "options": { "type": "object", "description": "NATS options", + "required": [ + "subject" + ], "properties": { "subject": { "type": "string", "description": "The NATS subject" } - }, - "required": [ - "subject" - ] + } } }, "required": [ @@ -1174,11 +1175,10 @@ } }, "required": [ - "id", - "format" + "id" ] }, - "definitionGroup": { + "definitiongroup": { "type": "object", "properties": { "id": { @@ -1206,22 +1206,26 @@ }, "format": { "type": "string", - "description": "Message format identifier. All definitions in this group share this format. Mixed-format groups are not permitted." + "description": "Format identifier that defines the common metadata information for the message. All definitions in this group share this format. Mixed-format groups are not permitted." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, + "binding": { + "type": "string", + "description": "Binding identifier that defines the transport message binding. All definitions in this group share this binding type. Mixed-binding groups are not permitted." + }, "definitions": { "type": "object", "additionalProperties": { @@ -1230,8 +1234,7 @@ } }, "required": [ - "id", - "format" + "id" ] }, "schemaVersion": { @@ -1264,17 +1267,17 @@ "type": "string", "description": "Schema format identifier for this schema version." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, @@ -1326,17 +1329,17 @@ "format": { "type": "string" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, @@ -1370,7 +1373,7 @@ } ] }, - "schemaGroup": { + "schemagroup": { "type": "object", "properties": { "id": { @@ -1399,17 +1402,17 @@ "format": { "type": "string" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, diff --git a/cloudevents/schemas/openapi.json b/cloudevents/schemas/openapi.json index 59773e3..9db0151 100644 --- a/cloudevents/schemas/openapi.json +++ b/cloudevents/schemas/openapi.json @@ -81,10 +81,10 @@ } } }, - "/endpoints/{groupId}": { + "/endpoints/{groupid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { @@ -184,21 +184,21 @@ } } }, - "/definitionGroups/{groupId}": { + "/definitiongroups/{groupid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { - "operationId": "getDefinitionGroup", + "operationId": "getDefinitiongroup", "responses": { "200": { "description": "The resource group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/definitionGroup" + "$ref": "#/components/schemas/definitiongroup" } } } @@ -225,14 +225,14 @@ } } ], - "operationId": "putDefinitionGroup", + "operationId": "putDefinitiongroup", "description": "creates or updates the resource group", "requestBody": { "description": "A request to create or update the discovery group's collection of groups with the given group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/definitionGroup" + "$ref": "#/components/schemas/definitiongroup" } } } @@ -243,7 +243,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/definitionGroup" + "$ref": "#/components/schemas/definitiongroup" } } } @@ -260,7 +260,7 @@ } }, "delete": { - "operationId": "deleteDefinitionGroup", + "operationId": "deleteDefinitiongroup", "parameters": [ { "in": "query", @@ -287,21 +287,21 @@ } } }, - "/schemaGroups/{groupId}": { + "/schemagroups/{groupid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { - "operationId": "getSchemaGroup", + "operationId": "getSchemagroup", "responses": { "200": { "description": "The resource group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/schemaGroup" + "$ref": "#/components/schemas/schemagroup" } } } @@ -328,14 +328,14 @@ } } ], - "operationId": "putSchemaGroup", + "operationId": "putSchemagroup", "description": "creates or updates the resource group", "requestBody": { "description": "A request to create or update the discovery group's collection of groups with the given group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/schemaGroup" + "$ref": "#/components/schemas/schemagroup" } } } @@ -346,7 +346,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/schemaGroup" + "$ref": "#/components/schemas/schemagroup" } } } @@ -363,7 +363,7 @@ } }, "delete": { - "operationId": "deleteSchemaGroup", + "operationId": "deleteSchemagroup", "parameters": [ { "in": "query", @@ -390,10 +390,10 @@ } } }, - "/endpoints/{groupId}/definitions": { + "/endpoints/{groupid}/definitions": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { @@ -465,14 +465,14 @@ } } }, - "/definitionGroups/{groupId}/definitions": { + "/definitiongroups/{groupid}/definitions": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { - "operationId": "getDefinitionGroupDefinitionsAll", + "operationId": "getDefinitiongroupDefinitionsAll", "description": "Get an optionally filtered collection of resources", "parameters": [ { @@ -540,14 +540,14 @@ } } }, - "/schemaGroups/{groupId}/schemas": { + "/schemagroups/{groupid}/schemas": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { - "operationId": "getSchemaGroupSchemasAll", + "operationId": "getSchemagroupSchemasAll", "description": "Get an optionally filtered collection of resources", "parameters": [ { @@ -615,13 +615,13 @@ } } }, - "/endpoints/{groupId}/definitions/{resourceId}": { + "/endpoints/{groupid}/definitions/{resourceid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { "in": "query", @@ -908,13 +908,13 @@ } } }, - "/definitionGroups/{groupId}/definitions/{resourceId}": { + "/definitiongroups/{groupid}/definitions/{resourceid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { "in": "query", @@ -927,7 +927,7 @@ } ], "get": { - "operationId": "getDefinitionGroupDefinition", + "operationId": "getDefinitiongroupDefinition", "responses": { "200": { "description": "The corresponding resource", @@ -1026,7 +1026,7 @@ ], "summary": "Create or update a resource", "description": "Create a resource. ", - "operationId": "putDefinitionGroupDefinition", + "operationId": "putDefinitiongroupDefinition", "requestBody": { "description": "The resource to be created/updated", "content": { @@ -1066,7 +1066,7 @@ "post": { "summary": "Post new resource version", "description": "Register resource version If resource of specified name does not exist in specified group, resource and resource version is created at version 1. If resource of specified name exists already in specified group, resource is created at latest version + 1. If resource with identical content already exists, existing resource's ID is returned. \n", - "operationId": "postDefinitionGroupDefinition", + "operationId": "postDefinitiongroupDefinition", "parameters": [ { "$ref": "#/components/parameters/resource-description" @@ -1174,7 +1174,7 @@ "delete": { "summary": "Delete resource", "description": "Delete resource", - "operationId": "deleteDefinitionGroupDefinition", + "operationId": "deleteDefinitiongroupDefinition", "parameters": [ { "in": "query", @@ -1201,13 +1201,13 @@ } } }, - "/schemaGroups/{groupId}/schemas/{resourceId}": { + "/schemagroups/{groupid}/schemas/{resourceid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { "in": "query", @@ -1220,7 +1220,7 @@ } ], "get": { - "operationId": "getSchemaGroupSchema", + "operationId": "getSchemagroupSchema", "responses": { "200": { "description": "The corresponding resource", @@ -1319,7 +1319,7 @@ ], "summary": "Create or update a resource", "description": "Create a resource. ", - "operationId": "putSchemaGroupSchema", + "operationId": "putSchemagroupSchema", "requestBody": { "description": "The resource to be created/updated", "content": { @@ -1359,7 +1359,7 @@ "post": { "summary": "Post new resource version", "description": "Register resource version If resource of specified name does not exist in specified group, resource and resource version is created at version 1. If resource of specified name exists already in specified group, resource is created at latest version + 1. If resource with identical content already exists, existing resource's ID is returned. \n", - "operationId": "postSchemaGroupSchema", + "operationId": "postSchemagroupSchema", "parameters": [ { "$ref": "#/components/parameters/resource-description" @@ -1467,7 +1467,7 @@ "delete": { "summary": "Delete resource", "description": "Delete resource", - "operationId": "deleteSchemaGroupSchema", + "operationId": "deleteSchemagroupSchema", "parameters": [ { "in": "query", @@ -1494,13 +1494,13 @@ } } }, - "/endpoints/{groupId}/definitions/{resourceId}/versions": { + "/endpoints/{groupid}/definitions/{resourceid}/versions": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" } ], "get": { @@ -1562,17 +1562,17 @@ } } }, - "/definitionGroups/{groupId}/definitions/{resourceId}/versions": { + "/definitiongroups/{groupid}/definitions/{resourceid}/versions": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" } ], "get": { - "operationId": "getDefinitionGroupDefinitionVersionsAll", + "operationId": "getDefinitiongroupDefinitionVersionsAll", "description": "Get an optionally filtered collection of versions", "parameters": [ { @@ -1630,17 +1630,17 @@ } } }, - "/schemaGroups/{groupId}/schemas/{resourceId}/versions": { + "/schemagroups/{groupid}/schemas/{resourceid}/versions": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" } ], "get": { - "operationId": "getSchemaGroupSchemaVersionsAll", + "operationId": "getSchemagroupSchemaVersionsAll", "description": "Get an optionally filtered collection of versions", "parameters": [ { @@ -1698,16 +1698,16 @@ } } }, - "/endpoints/{groupId}/definitions/{resourceId}/versions/{versionId}": { + "/endpoints/{groupid}/definitions/{resourceid}/versions/{versionid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { - "$ref": "#/components/parameters/versionId" + "$ref": "#/components/parameters/versionid" }, { "in": "query", @@ -1862,16 +1862,16 @@ } } }, - "/definitionGroups/{groupId}/definitions/{resourceId}/versions/{versionId}": { + "/definitiongroups/{groupid}/definitions/{resourceid}/versions/{versionid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { - "$ref": "#/components/parameters/versionId" + "$ref": "#/components/parameters/versionid" }, { "in": "query", @@ -1885,7 +1885,7 @@ } ], "get": { - "operationId": "getDefinitionGroupDefinitionVersion", + "operationId": "getDefinitiongroupDefinitionVersion", "description": "Gets the document stored for the schema version", "responses": { "200": { @@ -1964,7 +1964,7 @@ } } ], - "operationId": "updateDefinitionGroupDefinitionVersion", + "operationId": "updateDefinitiongroupDefinitionVersion", "description": "Updates the metadata for the schema version", "requestBody": { "description": "The schema version document", @@ -2012,7 +2012,7 @@ } } ], - "operationId": "deleteDefinitionGroupDefinitionVersion", + "operationId": "deleteDefinitiongroupDefinitionVersion", "responses": { "204": { "description": "Ok" @@ -2026,16 +2026,16 @@ } } }, - "/schemaGroups/{groupId}/schemas/{resourceId}/versions/{versionId}": { + "/schemagroups/{groupid}/schemas/{resourceid}/versions/{versionid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { - "$ref": "#/components/parameters/versionId" + "$ref": "#/components/parameters/versionid" }, { "in": "query", @@ -2049,7 +2049,7 @@ } ], "get": { - "operationId": "getSchemaGroupSchemaVersion", + "operationId": "getSchemagroupSchemaVersion", "description": "Gets the document stored for the schema version", "responses": { "200": { @@ -2128,7 +2128,7 @@ } } ], - "operationId": "updateSchemaGroupSchemaVersion", + "operationId": "updateSchemagroupSchemaVersion", "description": "Updates the metadata for the schema version", "requestBody": { "description": "The schema version document", @@ -2176,7 +2176,7 @@ } } ], - "operationId": "deleteSchemaGroupSchemaVersion", + "operationId": "deleteSchemagroupSchemaVersion", "responses": { "204": { "description": "Ok" @@ -2229,9 +2229,9 @@ "format": "uri-reference" } }, - "groupId": { + "groupid": { "in": "path", - "name": "groupId", + "name": "groupid", "description": "The id of the group", "required": true, "schema": { @@ -2240,9 +2240,9 @@ "format": "uri-reference" } }, - "resourceId": { + "resourceid": { "in": "path", - "name": "resourceId", + "name": "resourceid", "description": "The id of the schema", "required": true, "schema": { @@ -2251,9 +2251,9 @@ "format": "uri-reference" } }, - "versionId": { + "versionid": { "in": "path", - "name": "versionId", + "name": "versionid", "description": "The id of the schema", "required": true, "schema": { @@ -2508,37 +2508,168 @@ "$ref": "#/components/schemas/endpoint" } }, - "definitionGroups": { + "definitiongroups": { "type": "object", "additionalProperties": { - "$ref": "#/components/schemas/definitionGroup" + "$ref": "#/components/schemas/definitiongroup" } }, - "schemaGroups": { + "schemagroups": { "type": "object", "additionalProperties": { - "$ref": "#/components/schemas/schemaGroup" + "$ref": "#/components/schemas/schemagroup" } } } }, - "format_AMQP_1_0": { + "format_None": { "properties": { "format": { "type": "string", "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ - "AMQP/1.0" + "None" + ], + "default": "None" + } + } + }, + "format_CloudEvents_1_0": { + "properties": { + "format": { + "type": "string", + "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "CloudEvents/1.0" ] }, "metadata": { + "type": "object", + "description": "CloudEvents metadata constraints.", + "properties": { + "type": { + "type": "object", + "description": "CloudEvents type.", + "properties": { + "value": { + "type": "string", + "description": "CloudEvents type value template." + } + } + }, + "source": { + "type": "object", + "description": "CloudEvents source", + "properties": { + "value": { + "type": "string", + "description": "CloudEvents source value template." + } + } + }, + "subject": { + "type": "object", + "description": "CloudEvents subject", + "properties": { + "value": { + "type": "string", + "description": "CloudEvents subject value template." + }, + "required": { + "type": "boolean", + "description": "CloudEvents subject required." + } + } + }, + "id": { + "type": "object", + "description": "CloudEvents id", + "properties": { + "value": { + "type": "string", + "description": "CloudEvents id value template." + } + } + }, + "time": { + "type": "object", + "description": "The timestamp of when the event happened.", + "properties": { + "value": { + "type": "string", + "description": "The timestamp value template." + }, + "required": { + "type": "boolean", + "description": "The timestamp required." + } + } + }, + "dataschema": { + "type": "object", + "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default.", + "properties": { + "value": { + "type": "string", + "format": "uri-template", + "description": "The uri value template." + }, + "required": { + "type": "boolean", + "description": "The uri required." + } + } + } + }, + "additionalProperties": { + "type": "object", + "description": "CloudEvent extension property", + "properties": { + "value": { + "type": "string", + "description": "The value template." + }, + "required": { + "type": "boolean", + "description": "Whether the extension is required" + } + } + } + } + }, + "required": [ + "format" + ] + }, + "binding_None": { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "None" + ], + "default": "None" + } + } + }, + "binding_AMQP_1_0": { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "AMQP/1.0" + ] + }, + "message": { "type": "object", "description": "AMQP message metadata constraints.", "properties": { "properties": { "type": "object", "properties": { - "message-id": { + "message_id": { "type": "object", "description": "AMQP message-id.", "properties": { @@ -2552,7 +2683,7 @@ } } }, - "user-id": { + "user_id": { "type": "object", "description": "AMQP user-id.", "properties": { @@ -2594,7 +2725,7 @@ } } }, - "reply-to": { + "reply_to": { "type": "object", "description": "AMQP reply-to.", "properties": { @@ -2608,7 +2739,7 @@ } } }, - "correlation-id": { + "correlation_id": { "type": "object", "description": "AMQP correlation-id.", "properties": { @@ -2622,7 +2753,7 @@ } } }, - "content-type": { + "content_type": { "type": "object", "description": "AMQP content-type.", "properties": { @@ -2636,7 +2767,7 @@ } } }, - "content-encoding": { + "content_encoding": { "type": "object", "description": "AMQP content-encoding.", "properties": { @@ -2650,7 +2781,7 @@ } } }, - "absolute-expiry-time": { + "absolute_expiry_time": { "type": "object", "description": "AMQP absolute-expiry-time.", "properties": { @@ -2664,7 +2795,7 @@ } } }, - "group-id": { + "group_id": { "type": "object", "description": "AMQP group-id.", "properties": { @@ -2678,7 +2809,7 @@ } } }, - "group-sequence": { + "group_sequence": { "type": "object", "description": "AMQP group-sequence.", "properties": { @@ -2692,7 +2823,7 @@ } } }, - "reply-to-group-id": { + "reply_to_group_id": { "type": "object", "description": "AMQP reply-to-group-id.", "properties": { @@ -2708,14 +2839,11 @@ } } }, - "application-properties": { + "application_properties": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "The application property name." - }, "value": { "type": "string", "description": "The application property value template." @@ -2731,14 +2859,11 @@ } } }, - "message-annotations": { + "message_annotations": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "The message annotation name." - }, "value": { "type": "string", "description": "The message annotation value" @@ -2751,20 +2876,14 @@ "type": "string", "description": "The message annotation type." } - }, - "required": [ - "name" - ] + } } }, - "delivery-annotations": { + "delivery_annotations": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "The delivery annotation name." - }, "value": { "type": "string", "description": "The delivery annotation value" @@ -2777,20 +2896,14 @@ "type": "string", "description": "The annotation type." } - }, - "required": [ - "name" - ] + } } }, "header": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "AMQP header name." - }, "value": { "type": "string", "description": "AMQP header value." @@ -2803,20 +2916,14 @@ "type": "string", "description": "AMQP header type." } - }, - "required": [ - "name" - ] + } } }, "footer": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "AMQP footer name." - }, "value": { "type": "string", "description": "AMQP footer value." @@ -2829,29 +2936,26 @@ "type": "string", "description": "AMQP footer type." } - }, - "required": [ - "name" - ] + } } } } } }, "required": [ - "format" + "binding" ] }, - "format_MQTT_3_1_1": { + "binding_MQTT_3_1_1": { "properties": { - "format": { + "binding": { "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ "MQTT/3.1.1" ] }, - "metadata": { + "message": { "type": "object", "description": "MQTT message metadata constraints.", "properties": { @@ -2875,7 +2979,7 @@ } } }, - "topic-name": { + "topic_name": { "type": "object", "description": "MQTT topic-name.", "properties": { @@ -2889,19 +2993,19 @@ } }, "required": [ - "format" + "binding" ] }, - "format_MQTT_5_0": { + "binding_MQTT_5_0": { "properties": { - "format": { + "binding": { "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ "MQTT/5.0" ] }, - "metadata": { + "message": { "type": "object", "description": "MQTT message metadata constraints.", "properties": { @@ -2925,7 +3029,7 @@ } } }, - "topic-name": { + "topic_name": { "type": "object", "description": "MQTT topic-name.", "properties": { @@ -2935,7 +3039,7 @@ } } }, - "message-expiry-interval": { + "message_expiry_interval": { "type": "object", "description": "MQTT message-expiry-interval.", "properties": { @@ -2945,7 +3049,7 @@ } } }, - "response-topic": { + "response_topic": { "type": "object", "description": "MQTT response-topic.", "properties": { @@ -2955,7 +3059,7 @@ } } }, - "correlation-data": { + "correlation_data": { "type": "object", "description": "MQTT correlation-data.", "properties": { @@ -2966,7 +3070,7 @@ } } }, - "content-type": { + "content_type": { "type": "object", "description": "MQTT content-type.", "properties": { @@ -2976,10 +3080,11 @@ } } }, - "user-properties": { + "user_properties": { "type": "array", "description": "MQTT user-properties.", "items": { + "type": "object", "properties": { "name": { "type": "string", @@ -2996,19 +3101,19 @@ } }, "required": [ - "format" + "binding" ] }, - "format_KAFKA_0_11": { + "binding_KAFKA": { "properties": { - "format": { + "binding": { "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ - "KAFKA/0.11" + "KAFKA" ] }, - "metadata": { + "message": { "type": "object", "description": "The Apache Kafka message metadata constraints.", "properties": { @@ -3029,6 +3134,7 @@ "type": "object", "description": "The Apache Kafka headers.", "additionalProperties": { + "type": "object", "properties": { "name": { "type": "string", @@ -3049,116 +3155,19 @@ } }, "required": [ - "format" - ] - }, - "format_CloudEvents_1_0": { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "CloudEvents/1.0" - ] - }, - "metadata": { - "type": "object", - "description": "CloudEvents metadata constraints.", - "properties": { - "type": { - "type": "object", - "description": "CloudEvents type.", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents type value template." - } - } - }, - "source": { - "type": "object", - "description": "CloudEvents source", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents source value template." - } - } - }, - "subject": { - "type": "object", - "description": "CloudEvents subject", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents subject value template." - }, - "required": { - "type": "boolean", - "description": "CloudEvents subject required." - } - } - }, - "id": { - "type": "object", - "description": "CloudEvents id", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents id value template." - } - } - }, - "time": { - "type": "object", - "description": "The timestamp of when the event happened.", - "properties": { - "value": { - "type": "string", - "description": "The timestamp value template." - }, - "required": { - "type": "boolean", - "description": "The timestamp required." - } - } - }, - "dataschema": { - "type": "string", - "format": "uri-template", - "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." - } - }, - "additionalProperties": { - "type": "object", - "description": "CloudEvent extension property", - "properties": { - "value": { - "type": "string", - "description": "The value template." - }, - "required": { - "type": "boolean", - "description": "Whether the extension is required" - } - } - } - } - }, - "required": [ - "format" + "binding" ] }, - "format_HTTP_1_1": { + "binding_HTTP": { "properties": { - "format": { + "binding": { "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ - "HTTP/1.1" + "HTTP" ] }, - "metadata": { + "message": { "type": "object", "description": "The HTTP message metadata constraints.", "properties": { @@ -3166,6 +3175,7 @@ "type": "array", "description": "The HTTP headers.", "items": { + "type": "object", "properties": { "name": { "type": "string", @@ -3194,7 +3204,7 @@ } }, "required": [ - "format" + "binding" ] }, "definition": { @@ -3223,33 +3233,38 @@ "labels": { "type": "object" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" + }, + "baseDefinitionUrl": { + "type": "string", + "format": "uri", + "description": "Reference to a base definition for this definition, either via a (relative) URL or a fragment identifier. The base definition is overridden by this definition. If not present, this definition does not override any base definition." } }, "required": [ "id" ], "discriminator": { - "propertyName": "format", + "propertyName": "binding", "mapping": { - "AMQP/1.0": "#/components/schemas/format_AMQP_1_0", - "MQTT/3.1.1": "#/components/schemas/format_MQTT_3_1_1", - "MQTT/5.0": "#/components/schemas/format_MQTT_5_0", - "KAFKA/0.11": "#/components/schemas/format_KAFKA_0_11", - "CloudEvents/1.0": "#/components/schemas/format_CloudEvents_1_0", - "HTTP/1.1": "#/components/schemas/format_HTTP_1_1" + "None": "#/components/schemas/binding_None", + "AMQP/1.0": "#/components/schemas/binding_AMQP_1_0", + "MQTT/3.1.1": "#/components/schemas/binding_MQTT_3_1_1", + "MQTT/5.0": "#/components/schemas/binding_MQTT_5_0", + "KAFKA": "#/components/schemas/binding_KAFKA", + "HTTP": "#/components/schemas/binding_HTTP" } } }, @@ -3274,52 +3289,25 @@ "type": "boolean", "description": "The AMQP durable flag. Whether the node is durable or transient." }, - "link-properties": { + "link_properties": { "type": "object", "description": "An optional map of AMQP link properties to use with the endpoint", "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "Link property name" - }, - "value": { - "type": "string", - "description": "Link property value" - } - }, - "required": [ - "name", - "value" - ] + "type": "string" } }, - "connection-properties": { + "connection_properties": { "type": "object", "description": "An optional map of AMQP connection properties to use with the endpoint", - "properties": { - "name": { - "type": "string", - "description": "Connection property name" - }, - "value": { - "type": "string", - "description": "Connection property value" - } - }, - "required": [ - "name", - "value" - ] + "additionalProperties": { + "type": "string" + } }, - "distribution-mode": { + "distribution_mode": { "type": "string", "description": "The AMQP distribution mode for receivers. Can be 'move' or 'copy'. A value of 'move' indicates an exclusive lock on the message. A value of 'copy' indicates a non-exclusive lock on the message." } }, - "required": [ - "node" - ], "additionalProperties": { "type": "string", "description": "Further options to configure the AMQP 1.0 client" @@ -3355,15 +3343,15 @@ "type": "boolean", "description": "The MQTT retain flag to use for publishers on ths endpoint" }, - "clean-session": { + "clean_session": { "type": "boolean", "description": "The MQTT clean session flag to use for publishers on this endpoint" }, - "will-topic": { + "will_topic": { "type": "string", "description": "The MQTT will topic to configure for publishers on this endpoint" }, - "will-message": { + "will_message": { "type": "string", "format": "uri", "description": "The MQTT will message definition to configure for publishers on this endpoint" @@ -3400,15 +3388,15 @@ "type": "boolean", "description": "The MQTT retain flag to use for publishers on ths endpoint" }, - "clean-session": { + "clean_session": { "type": "boolean", "description": "The MQTT clean session flag to use for publishers on this endpoint" }, - "will-topic": { + "will_topic": { "type": "string", "description": "The MQTT will topic to configure for publishers on this endpoint" }, - "will-message": { + "will_message": { "type": "string", "format": "uri", "description": "The MQTT will message definition to configure for publishers on this endpoint" @@ -3441,6 +3429,11 @@ "type": "array", "description": "HTTP headers to use with the endpoint. The same header may be specified multiple times with different values. The HTTP header names are case insensitive.", "items": { + "type": "object", + "required": [ + "name", + "value" + ], "properties": { "name": { "type": "string", @@ -3450,17 +3443,18 @@ "type": "string", "description": "HTTP header value" } - }, - "required": [ - "name", - "value" - ] + } } }, "query": { - "type": "object", + "type": "array", "description": "HTTP query parameters", - "additionalProperties": { + "items": { + "type": "object", + "required": [ + "name", + "value" + ], "properties": { "name": { "type": "string", @@ -3470,17 +3464,10 @@ "type": "string", "description": "The HTTP query parameter value" } - }, - "required": [ - "name", - "value" - ] + } } } - }, - "required": [ - "method" - ] + } } }, "required": [ @@ -3499,6 +3486,9 @@ "options": { "type": "object", "description": "Apache Kafka options", + "required": [ + "topic" + ], "properties": { "topic": { "type": "string", @@ -3513,7 +3503,7 @@ "format": "base64", "description": "The Apache Kafka record key" }, - "consumer-group": { + "consumergroup": { "type": "string", "description": "The Apache Kafka consumer group name to use for consumers" }, @@ -3525,6 +3515,11 @@ "type": "object", "description": "The Apache Kafka headers for publishers on this endpoint", "additionalProperties": { + "type": "object", + "required": [ + "name", + "value" + ], "properties": { "name": { "type": "string", @@ -3534,17 +3529,10 @@ "type": "string", "description": "The Apache Kafka header value" } - }, - "required": [ - "name", - "value" - ] + } } } - }, - "required": [ - "topic" - ] + } } }, "required": [ @@ -3563,15 +3551,15 @@ "options": { "type": "object", "description": "NATS options", + "required": [ + "subject" + ], "properties": { "subject": { "type": "string", "description": "The NATS subject" } - }, - "required": [ - "subject" - ] + } } }, "required": [ @@ -3606,22 +3594,26 @@ }, "format": { "type": "string", - "description": "Endpoint message format identifier. If set, all definitions MUST use this format value." + "description": "Endpoint metadata format identifier. If set, all definitions MUST use this format value." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, + "binding": { + "type": "string", + "description": "Endpoint message binding identifier. If set, all definitions MUST use this binding value." + }, "config": { "type": "object", "description": "Configuration information for this endpoint", @@ -3630,6 +3622,10 @@ "type": "array", "description": "Authorization options. These are hints for the adapter for interacting with the authorization endpoint. This is not a credentials configuration.", "items": { + "type": "object", + "required": [ + "type" + ], "properties": { "type": { "type": "string", @@ -3650,10 +3646,7 @@ "type": "string" } } - }, - "required": [ - "type" - ] + } } }, "endpoints": { @@ -3671,7 +3664,18 @@ }, "required": [ "protocol" - ] + ], + "discriminator": { + "propertyName": "protocol", + "mapping": { + "AMQP/1.0": "#/components/schemas/protocol_AMQP_1_0", + "MQTT/5.0": "#/components/schemas/protocol_MQTT_5_0", + "MQTT/3.1.1": "#/components/schemas/protocol_MQTT_3_1_1", + "HTTP": "#/components/schemas/protocol_HTTP", + "KAFKA": "#/components/schemas/protocol_KAFKA", + "NATS": "#/components/schemas/protocol_NATS" + } + } }, "definitions": { "type": "object", @@ -3681,11 +3685,10 @@ } }, "required": [ - "id", - "format" + "id" ] }, - "definitionGroup": { + "definitiongroup": { "type": "object", "properties": { "id": { @@ -3713,22 +3716,26 @@ }, "format": { "type": "string", - "description": "Message format identifier. All definitions in this group share this format. Mixed-format groups are not permitted." + "description": "Format identifier that defines the common metadata information for the message. All definitions in this group share this format. Mixed-format groups are not permitted." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, + "binding": { + "type": "string", + "description": "Binding identifier that defines the transport message binding. All definitions in this group share this binding type. Mixed-binding groups are not permitted." + }, "definitions": { "type": "object", "additionalProperties": { @@ -3737,8 +3744,7 @@ } }, "required": [ - "id", - "format" + "id" ] }, "schemaVersion": { @@ -3771,17 +3777,17 @@ "type": "string", "description": "Schema format identifier for this schema version." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, @@ -3833,17 +3839,17 @@ "format": { "type": "string" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, @@ -3877,7 +3883,7 @@ } ] }, - "schemaGroup": { + "schemagroup": { "type": "object", "properties": { "id": { @@ -3906,17 +3912,17 @@ "format": { "type": "string" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, diff --git a/cloudevents/spec.md b/cloudevents/spec.md index 56ca449..1771d6c 100644 --- a/cloudevents/spec.md +++ b/cloudevents/spec.md @@ -314,9 +314,10 @@ While the CloudEvents Registry is primarily motivated by enabling development of CloudEvents-based event flows, the registry is not limited to CloudEvents. It can be used to describe any asynchronous messaging or eventing endpoint and its messages, including endpoints that do not use CloudEvents at all. The [Message -Formats](../message/spec.md#message-formats) section therefore not only -describes the attribute meta-schema for CloudEvents, but also meta-schemas for -the native message envelopes of MQTT, AMQP, and other messaging protocols. +Formats](../message/spec.md#metadata-formats-and-message-bindings) section +therefore not only describes the attribute meta-schema for CloudEvents, but also +meta-schemas for the native message envelopes of MQTT, AMQP, and other messaging +protocols. The registry is designed to be extensible to support any structured data encoding and related schemas for message or event payloads. The [Schema @@ -351,17 +352,17 @@ embedded or referenced. Any of the three sub-registries MAY be omitted. "$schema": "https://cloudevents.io/schemas/registry", "specversion": "0.4-wip", - "endpointsUrl": "URL", - "endpointsCount": INT, + "endpointsurl": "URL", + "endpointscount": INT, "endpoints": { ... }, - "definitionGroupsUrl": "URL", - "definitionGroupsCount": INT, - "definitionGroups": { ... }, + "definitiongroupsurl": "URL", + "definitiongroupscount": INT, + "definitiongroups": { ... }, - "schemaGroupsUrl": "URL", - "schemaGroupsCount": INT, - "schemaGroups": { ... } + "schemagroupsurl": "URL", + "schemagroupscount": INT, + "schemagroups": { ... } } ``` diff --git a/core/templates/xregistry_openapi_template.json b/core/templates/xregistry_openapi_template.json index ac32455..8410d2b 100644 --- a/core/templates/xregistry_openapi_template.json +++ b/core/templates/xregistry_openapi_template.json @@ -133,10 +133,10 @@ } } }, - "/{%-groupNamePlural-%}/{groupId}": { + "/{%-groupNamePlural-%}/{groupid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { @@ -236,10 +236,10 @@ } } }, - "/{%-groupNamePlural-%}/{groupId}/{%-resourceNamePlural-%}": { + "/{%-groupNamePlural-%}/{groupid}/{%-resourceNamePlural-%}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { @@ -311,13 +311,13 @@ } } }, - "/{%-groupNamePlural-%}/{groupId}/{%-resourceNamePlural-%}/{resourceId}": { + "/{%-groupNamePlural-%}/{groupid}/{%-resourceNamePlural-%}/{resourceid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { "in": "query", @@ -604,13 +604,13 @@ } } }, - "/{%-groupNamePlural-%}/{groupId}/{%-resourceNamePlural-%}/{resourceId}/versions": { + "/{%-groupNamePlural-%}/{groupid}/{%-resourceNamePlural-%}/{resourceid}/versions": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" } ], "get": { @@ -672,16 +672,16 @@ } } }, - "/{%-groupNamePlural-%}/{groupId}/{%-resourceNamePlural-%}/{resourceId}/versions/{versionId}": { + "/{%-groupNamePlural-%}/{groupid}/{%-resourceNamePlural-%}/{resourceid}/versions/{versionid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { - "$ref": "#/components/parameters/versionId" + "$ref": "#/components/parameters/versionid" }, { "in": "query", @@ -875,9 +875,9 @@ "format": "uri-reference" } }, - "groupId": { + "groupid": { "in": "path", - "name": "groupId", + "name": "groupid", "description": "The id of the group", "required": true, "schema": { @@ -886,9 +886,9 @@ "format": "uri-reference" } }, - "resourceId": { + "resourceid": { "in": "path", - "name": "resourceId", + "name": "resourceid", "description": "The id of the schema", "required": true, "schema": { @@ -897,9 +897,9 @@ "format": "uri-reference" } }, - "versionId": { + "versionid": { "in": "path", - "name": "versionId", + "name": "versionid", "description": "The id of the schema", "required": true, "schema": { diff --git a/endpoint/model.json b/endpoint/model.json index f023e9e..8c7c6a6 100644 --- a/endpoint/model.json +++ b/endpoint/model.json @@ -3,344 +3,362 @@ "json-schema/draft-07" ], "groups": { - "endpoints": - { + "endpoints": { "singular": "endpoint", "plural": "endpoints", "attributes": { "format": { - "description": "Endpoint message format identifier. If set, all definitions MUST use this format value.", + "description": "Endpoint metadata format identifier. If set, all definitions MUST use this format value.", "type": "string", - "required": true + "required": false + }, + "binding": { + "description": "Endpoint message binding identifier. If set, all definitions MUST use this binding value.", + "type": "string", + "required": false }, "config": { "description": "Configuration information for this endpoint", "type": "object", - "attributes": { - "authorization": { - "description": "Authorization options. These are hints for the adapter for interacting with the authorization endpoint. This is not a credentials configuration.", - "type": "array", - "required": false, - "itemType": "object", - "attributes": { - "type": { - "description": "The authentication/authorization type. OAuth2, Plain, APIKey, and X509Cert are well-defined.", - "type": "string", - "required": true - }, - "resourceuri": { - "description": "The resource uri for which authorization shall be granted (if applicable)", - "type": "string", - "required": false - }, - "authorityuri": { - "description": "The authority uri where authorization shall be requested (if applicable)", - "type": "string", - "required": false - }, - "grant_types": { - "description": "The grant types that can be requested (if applicable)", - "type": "array", - "required": false, - "itemType": "string" + "item": { + "attributes": { + "authorization": { + "description": "Authorization options. These are hints for the adapter for interacting with the authorization endpoint. This is not a credentials configuration.", + "type": "array", + "required": false, + "item": { + "type": "object", + "item": { + "attributes": { + "type": { + "description": "The authentication/authorization type. OAuth2, Plain, APIKey, and X509Cert are well-defined.", + "type": "string", + "required": true + }, + "resourceuri": { + "description": "The resource uri for which authorization shall be granted (if applicable)", + "type": "string", + "required": false + }, + "authorityuri": { + "description": "The authority uri where authorization shall be requested (if applicable)", + "type": "string", + "required": false + }, + "grant_types": { + "description": "The grant types that can be requested (if applicable)", + "type": "array", + "required": false, + "item": { + "type": "string" + } + } + } + } } - } - }, - "protocol": { - "description": "endpoint protocol identifier", - "type": "string", - "required": true, - "ifValue": { - "AMQP/1.0": { - "siblingAttributes": { - "options": { - "description": "AMQP 1.0 connection options", - "type": "object", - "attributes": { - "node": { - "description": "The AMQP node name. Commonly the name of a queue or a topic.", - "type": "string", - "required": true - }, - "durable": { - "description": "The AMQP durable flag. Whether the node is durable or transient.", - "type": "boolean", - "required": false - }, - "link-properties": { - "description": "An optional map of AMQP link properties to use with the endpoint", - "type": "map", - "required": false, - "itemType": "object", - "keyType": "string", + }, + "protocol": { + "description": "endpoint protocol identifier", + "type": "string", + "required": true, + "ifvalue": { + "AMQP/1.0": { + "siblingattributes": { + "options": { + "description": "AMQP 1.0 connection options", + "type": "object", + "item": { "attributes": { - "name": { - "description": "Link property name", + "node": { + "description": "The AMQP node name. Commonly the name of a queue or a topic.", "type": "string", - "required": true + "required": false }, - "value": { - "description": "Link property value", + "durable": { + "description": "The AMQP durable flag. Whether the node is durable or transient.", + "type": "boolean", + "required": false + }, + "link_properties": { + "description": "An optional map of AMQP link properties to use with the endpoint", + "type": "map", + "required": false, + "item": { + "type": "string", + "description": "Link property value" + } + }, + "connection_properties": { + "description": "An optional map of AMQP connection properties to use with the endpoint", + "type": "map", + "required": false, + "item": { + "description": "Connection property value", + "type": "string" + } + }, + "distribution_mode": { + "description": "The AMQP distribution mode for receivers. Can be 'move' or 'copy'. A value of 'move' indicates an exclusive lock on the message. A value of 'copy' indicates a non-exclusive lock on the message.", "type": "string", - "required": true + "required": false, + "values": [ + "move", + "copy" + ] + }, + "*": { + "description": "Further options to configure the AMQP 1.0 client", + "type": "string", + "required": false } } - }, - "connection-properties": { - "description": "An optional map of AMQP connection properties to use with the endpoint", - "type": "object", - "required": false, + } + } + } + }, + "MQTT/5.0": { + "siblingattributes": { + "options": { + "description": "MQTT 5.0 connection options", + "type": "object", + "item": { "attributes": { - "name": { - "description": "Connection property name", + "topic": { + "description": "The MQTT topic path", "type": "string", - "required": true + "required": false + }, + "qos": { + "description": "The MQTT QoS level. May be 0, 1, or 2.", + "type": "integer", + "required": false }, - "value": { - "description": "Connection property value", + "retain": { + "description": "The MQTT retain flag to use for publishers on ths endpoint", + "type": "boolean", + "required": false + }, + "clean_session": { + "description": "The MQTT clean session flag to use for publishers on this endpoint", + "type": "boolean", + "required": false + }, + "will_topic": { + "description": "The MQTT will topic to configure for publishers on this endpoint", "type": "string", - "required": true + "required": false + }, + "will_message": { + "description": "The MQTT will message definition to configure for publishers on this endpoint", + "type": "uri", + "required": false } } - }, - "distribution-mode": { - "description": "The AMQP distribution mode for receivers. Can be 'move' or 'copy'. A value of 'move' indicates an exclusive lock on the message. A value of 'copy' indicates a non-exclusive lock on the message.", - "type": "string", - "required": false, - "values": [ - "move", - "copy" - ] - }, - "*": { - "description": "Further options to configure the AMQP 1.0 client", - "type": "string", - "required": false - } - } - } - } - }, - "MQTT/5.0": { - "siblingAttributes": { - "options": { - "description": "MQTT 5.0 connection options", - "type": "object", - "attributes": { - "topic": { - "description": "The MQTT topic path", - "type": "string", - "required": false - }, - "qos": { - "description": "The MQTT QoS level. May be 0, 1, or 2.", - "type": "integer", - "required": false - }, - "retain": { - "description": "The MQTT retain flag to use for publishers on ths endpoint", - "type": "boolean", - "required": false - }, - "clean-session": { - "description": "The MQTT clean session flag to use for publishers on this endpoint", - "type": "boolean", - "required": false - }, - "will-topic": { - "description": "The MQTT will topic to configure for publishers on this endpoint", - "type": "string", - "required": false - }, - "will-message": { - "description": "The MQTT will message definition to configure for publishers on this endpoint", - "type": "uri", - "required": false - } - } - } - } - }, - "MQTT/3.1.1": { - "siblingAttributes": { - "options": { - "description": "MQTT 3.1.1 connection options", - "type": "object", - "attributes": { - "topic": { - "description": "MQTT topic path", - "type": "string", - "required": false - }, - "qos": { - "description": "The MQTT QoS levelö. May be 0, 1, or 2.", - "type": "integer", - "required": false - }, - "retain": { - "description": "The MQTT retain flag to use for publishers on ths endpoint", - "type": "boolean", - "required": false - }, - "clean-session": { - "description": "The MQTT clean session flag to use for publishers on this endpoint", - "type": "boolean", - "required": false - }, - "will-topic": { - "description": "The MQTT will topic to configure for publishers on this endpoint", - "type": "string", - "required": false - }, - "will-message": { - "description": "The MQTT will message definition to configure for publishers on this endpoint", - "type": "uri", - "required": false } } } - } - }, - "HTTP": { - "siblingAttributes": { - "options": { - "description": "HTTP options. These apply to all HTTP versions since the application model is the same across versions.", - "type": "object", - "attributes": { - "method": { - "description": "The HTTP method name", - "type": "string", - "required": true - }, - "headers": { - "description": "HTTP headers to use with the endpoint. The same header may be specified multiple times with different values. The HTTP header names are case insensitive.", - "type": "array", - "required": false, - "itemType": "object", + }, + "MQTT/3.1.1": { + "siblingattributes": { + "options": { + "description": "MQTT 3.1.1 connection options", + "type": "object", + "item": { "attributes": { - "name": { - "description": "HTTP header name", + "topic": { + "description": "MQTT topic path", "type": "string", - "required": true + "required": false }, - "value": { - "description": "HTTP header value", + "qos": { + "description": "The MQTT QoS levelö. May be 0, 1, or 2.", + "type": "integer", + "required": false + }, + "retain": { + "description": "The MQTT retain flag to use for publishers on ths endpoint", + "type": "boolean", + "required": false + }, + "clean_session": { + "description": "The MQTT clean session flag to use for publishers on this endpoint", + "type": "boolean", + "required": false + }, + "will_topic": { + "description": "The MQTT will topic to configure for publishers on this endpoint", "type": "string", - "required": true + "required": false + }, + "will_message": { + "description": "The MQTT will message definition to configure for publishers on this endpoint", + "type": "uri", + "required": false } } - }, - "query": { - "description": "HTTP query parameters", - "type": "map", - "required": false, - "itemType": "object", - "keyType": "string", + } + } + } + }, + "HTTP": { + "siblingattributes": { + "options": { + "description": "HTTP options. These apply to all HTTP versions since the application model is the same across versions.", + "type": "object", + "item": { "attributes": { - "name": { - "description": "The HTTP query parameter name", + "method": { + "description": "The HTTP method name", "type": "string", - "required": true + "required": false }, - "value": { - "description": "The HTTP query parameter value", - "type": "string", - "required": true + "headers": { + "description": "HTTP headers to use with the endpoint. The same header may be specified multiple times with different values. The HTTP header names are case insensitive.", + "type": "array", + "required": false, + "item": { + "type": "object", + "item": { + "attributes": { + "name": { + "description": "HTTP header name", + "type": "string", + "required": true + }, + "value": { + "description": "HTTP header value", + "type": "string", + "required": true + } + } + } + } + }, + "query": { + "description": "HTTP query parameters", + "type": "array", + "required": false, + "item": { + "type": "object", + "item": { + "attributes": { + "name": { + "description": "The HTTP query parameter name", + "type": "string", + "required": true + }, + "value": { + "description": "The HTTP query parameter value", + "type": "string", + "required": true + } + } + } + } } } } } } - } - }, - "KAFKA": { - "siblingAttributes": { - "options": { - "description": "Apache Kafka options", - "type": "object", - "attributes": { - "topic": { - "description": "Apache Kafka topic name", - "type": "string", - "required": true - }, - "acks": { - "description": "The Apache Kafka acks setting to use. If no acks setting is specified, the default is -1.", - "type": "integer", - "required": false - }, - "key": { - "description": "The Apache Kafka record key", - "type": "binary", - "required": false - }, - "consumer-group": { - "description": "The Apache Kafka consumer group name to use for consumers", - "type": "string", - "required": false - }, - "partition": { - "description": "Optional. The Apache Kafka partition number to use when writing to or receiving from Apache Kafka", - "type": "integer", - "required": false - }, - "headers": { - "description": "The Apache Kafka headers for publishers on this endpoint", - "type": "map", - "required": false, - "itemType": "object", - "keyType": "string", + }, + "KAFKA": { + "siblingattributes": { + "options": { + "description": "Apache Kafka options", + "type": "object", + "item": { "attributes": { - "name": { - "description": "The Apache Kafka header name", + "topic": { + "description": "Apache Kafka topic name", "type": "string", "required": true }, - "value": { - "description": "The Apache Kafka header value", + "acks": { + "description": "The Apache Kafka acks setting to use. If no acks setting is specified, the default is -1.", + "type": "integer", + "required": false + }, + "key": { + "description": "The Apache Kafka record key", + "type": "binary", + "required": false + }, + "consumergroup": { + "description": "The Apache Kafka consumer group name to use for consumers", "type": "string", - "required": true + "required": false + }, + "partition": { + "description": "Optional. The Apache Kafka partition number to use when writing to or receiving from Apache Kafka", + "type": "integer", + "required": false + }, + "headers": { + "description": "The Apache Kafka headers for publishers on this endpoint", + "type": "map", + "required": false, + "item": { + "type": "object", + "item": { + "attributes": { + "name": { + "description": "The Apache Kafka header name", + "type": "string", + "required": true + }, + "value": { + "description": "The Apache Kafka header value", + "type": "string", + "required": true + } + } + } + } } } } } } - } - }, - "NATS": { - "siblingAttributes": { - "options": { - "description": "NATS options", - "type": "object", - "attributes": { - "subject": { - "description": "The NATS subject", - "type": "string", - "required": true + }, + "NATS": { + "siblingattributes": { + "options": { + "description": "NATS options", + "type": "object", + "item": { + "attributes": { + "subject": { + "description": "The NATS subject", + "type": "string", + "required": true + } + } } } } } } + }, + "endpoints": { + "description": "The network addresses that are for communication with the endpoint. The endpoints are ordered by preference, with the first endpoint being the preferred endpoint. Some protocol implementations might not support multiple endpoints, in which case all but the first endpoint might be ignored. Whether the URI just identifies a network host or links directly to a resource managed by the network host is protocol specific.", + "type": "array", + "required": false, + "item": { + "type": "uri" + } + }, + "strict": { + "description": "If `true`, the endpoint metadata represents a public, live endpoint that is available for communication and a strict validator MAY test the liveness of the endpoint.", + "type": "boolean", + "required": false } - }, - "endpoints": { - "description": "The network addresses that are for communication with the endpoint. The endpoints are ordered by preference, with the first endpoint being the preferred endpoint. Some protocol implementations might not support multiple endpoints, in which case all but the first endpoint might be ignored. Whether the URI just identifies a network host or links directly to a resource managed by the network host is protocol specific.", - "type": "array", - "required": false, - "itemType": "uri" - }, - "strict": { - "description": "If `true`, the endpoint metadata represents a public, live endpoint that is available for communication and a strict validator MAY test the liveness of the endpoint.", - "type": "boolean", - "required": false } } } }, "resources": { - "definitions" : { - "uri": "../message/model.json#/groups/definitionGroups/resources/definitions" + "definitions": { + "uri": "../message/model.json#/groups/definitiongroups/resources/definitions" } } } diff --git a/endpoint/schemas/document-schema.avsc b/endpoint/schemas/document-schema.avsc index fb45e5c..30cae1a 100644 --- a/endpoint/schemas/document-schema.avsc +++ b/endpoint/schemas/document-schema.avsc @@ -12,43 +12,43 @@ "name": "EndpointType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -58,14 +58,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -75,14 +75,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -93,8 +93,13 @@ }, { "type": "string", - "name": "Format", - "doc": "Endpoint message format identifier. If set, all definitions MUST use this format value." + "name": "format", + "doc": "Endpoint metadata format identifier. If set, all definitions MUST use this format value." + }, + { + "type": "string", + "name": "binding", + "doc": "Endpoint message binding identifier. If set, all definitions MUST use this binding value." }, { "type": { @@ -104,43 +109,45 @@ { "type": { "type": "array", + "name": "AuthorizationArrayType", "items": { "type": "record", "name": "AuthorizationType", "fields": [ { "type": "string", - "name": "Type", + "name": "type", "doc": "The authentication/authorization type. OAuth2, Plain, APIKey, and X509Cert are well-defined." }, { "type": "string", - "name": "Resourceuri", + "name": "resourceuri", "doc": "The resource uri for which authorization shall be granted (if applicable)" }, { "type": "string", - "name": "Authorityuri", + "name": "authorityuri", "doc": "The authority uri where authorization shall be requested (if applicable)" }, { "type": { "type": "array", + "name": "GrantTypesArrayType", "items": { "type": "string" } }, - "name": "GrantTypes", + "name": "grantTypes", "doc": "The grant types that can be requested (if applicable)" } ] } }, - "name": "Authorization", + "name": "authorization", "doc": "Authorization options. These are hints for the adapter for interacting with the authorization endpoint. This is not a credentials configuration." }, { - "name": "Protocol", + "name": "protocol", "type": [ { "type": "record", @@ -153,61 +160,35 @@ "fields": [ { "type": "string", - "name": "Node", + "name": "node", "doc": "The AMQP node name. Commonly the name of a queue or a topic." }, { "type": "boolean", - "name": "Durable", + "name": "durable", "doc": "The AMQP durable flag. Whether the node is durable or transient." }, { "type": { "type": "map", "name": "ProtocolAmqp10LinkPropertiesType", - "values": { - "type": "record", - "name": "ProtocolAmqp10LinkPropertiesItemType", - "fields": [ - { - "type": "string", - "name": "Name", - "doc": "Link property name" - }, - { - "type": "string", - "name": "Value", - "doc": "Link property value" - } - ] - } + "values": "string" }, - "name": "LinkProperties", + "name": "linkProperties", "doc": "An optional map of AMQP link properties to use with the endpoint" }, { "type": { - "type": "record", + "type": "map", "name": "ProtocolAmqp10ConnectionPropertiesType", - "fields": [ - { - "type": "string", - "name": "Name", - "doc": "Connection property name" - }, - { - "type": "string", - "name": "Value", - "doc": "Connection property value" - } - ] + "values": "string" }, - "name": "ConnectionProperties", + "name": "connectionProperties", "doc": "An optional map of AMQP connection properties to use with the endpoint" }, { "type": "string", - "name": "DistributionMode", + "name": "distributionMode", "doc": "The AMQP distribution mode for receivers. Can be 'move' or 'copy'. A value of 'move' indicates an exclusive lock on the message. A value of 'copy' indicates a non-exclusive lock on the message." }, { @@ -222,7 +203,7 @@ } ] }, - "name": "Options", + "name": "options", "doc": "AMQP 1.0 connection options" } ] @@ -238,37 +219,37 @@ "fields": [ { "type": "string", - "name": "Topic", + "name": "topic", "doc": "The MQTT topic path" }, { "type": "int", - "name": "Qos", + "name": "qos", "doc": "The MQTT QoS level. May be 0, 1, or 2." }, { "type": "boolean", - "name": "Retain", + "name": "retain", "doc": "The MQTT retain flag to use for publishers on ths endpoint" }, { "type": "boolean", - "name": "CleanSession", + "name": "cleanSession", "doc": "The MQTT clean session flag to use for publishers on this endpoint" }, { "type": "string", - "name": "WillTopic", + "name": "willTopic", "doc": "The MQTT will topic to configure for publishers on this endpoint" }, { "type": "string", - "name": "WillMessage", + "name": "willMessage", "doc": "The MQTT will message definition to configure for publishers on this endpoint" } ] }, - "name": "Options", + "name": "options", "doc": "MQTT 5.0 connection options" } ] @@ -284,37 +265,37 @@ "fields": [ { "type": "string", - "name": "Topic", + "name": "topic", "doc": "MQTT topic path" }, { "type": "int", - "name": "Qos", + "name": "qos", "doc": "The MQTT QoS level\u00c3\u00b6. May be 0, 1, or 2." }, { "type": "boolean", - "name": "Retain", + "name": "retain", "doc": "The MQTT retain flag to use for publishers on ths endpoint" }, { "type": "boolean", - "name": "CleanSession", + "name": "cleanSession", "doc": "The MQTT clean session flag to use for publishers on this endpoint" }, { "type": "string", - "name": "WillTopic", + "name": "willTopic", "doc": "The MQTT will topic to configure for publishers on this endpoint" }, { "type": "string", - "name": "WillMessage", + "name": "willMessage", "doc": "The MQTT will message definition to configure for publishers on this endpoint" } ] }, - "name": "Options", + "name": "options", "doc": "MQTT 3.1.1 connection options" } ] @@ -330,59 +311,60 @@ "fields": [ { "type": "string", - "name": "Method", + "name": "method", "doc": "The HTTP method name" }, { "type": { "type": "array", + "name": "ProtocolHTTPHeadersArrayType", "items": { "type": "record", "name": "ProtocolHTTPHeadersType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "HTTP header name" }, { "type": "string", - "name": "Value", + "name": "value", "doc": "HTTP header value" } ] } }, - "name": "Headers", + "name": "headers", "doc": "HTTP headers to use with the endpoint. The same header may be specified multiple times with different values. The HTTP header names are case insensitive." }, { "type": { - "type": "map", - "name": "ProtocolHTTPQueryType", - "values": { + "type": "array", + "name": "ProtocolHTTPQueryArrayType", + "items": { "type": "record", - "name": "ProtocolHTTPQueryItemType", + "name": "ProtocolHTTPQueryType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The HTTP query parameter name" }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The HTTP query parameter value" } ] } }, - "name": "Query", + "name": "query", "doc": "HTTP query parameters" } ] }, - "name": "Options", + "name": "options", "doc": "HTTP options. These apply to all HTTP versions since the application model is the same across versions." } ] @@ -398,27 +380,27 @@ "fields": [ { "type": "string", - "name": "Topic", + "name": "topic", "doc": "Apache Kafka topic name" }, { "type": "int", - "name": "Acks", + "name": "acks", "doc": "The Apache Kafka acks setting to use. If no acks setting is specified, the default is -1." }, { "type": "bytes", - "name": "Key", + "name": "key", "doc": "The Apache Kafka record key" }, { "type": "string", - "name": "ConsumerGroup", + "name": "consumergroup", "doc": "The Apache Kafka consumer group name to use for consumers" }, { "type": "int", - "name": "Partition", + "name": "partition", "doc": "Optional. The Apache Kafka partition number to use when writing to or receiving from Apache Kafka" }, { @@ -431,23 +413,23 @@ "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The Apache Kafka header name" }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The Apache Kafka header value" } ] } }, - "name": "Headers", + "name": "headers", "doc": "The Apache Kafka headers for publishers on this endpoint" } ] }, - "name": "Options", + "name": "options", "doc": "Apache Kafka options" } ] @@ -463,12 +445,12 @@ "fields": [ { "type": "string", - "name": "Subject", + "name": "subject", "doc": "The NATS subject" } ] }, - "name": "Options", + "name": "options", "doc": "NATS options" } ] @@ -479,21 +461,22 @@ { "type": { "type": "array", + "name": "EndpointsArrayType", "items": { "type": "string" } }, - "name": "Endpoints", + "name": "endpoints", "doc": "The network addresses that are for communication with the endpoint. The endpoints are ordered by preference, with the first endpoint being the preferred endpoint. Some protocol implementations might not support multiple endpoints, in which case all but the first endpoint might be ignored. Whether the URI just identifies a network host or links directly to a resource managed by the network host is protocol specific." }, { "type": "boolean", - "name": "Strict", + "name": "strict", "doc": "If `true`, the endpoint metadata represents a public, live endpoint that is available for communication and a strict validator MAY test the liveness of the endpoint." } ] }, - "name": "Config", + "name": "config", "doc": "Configuration information for this endpoint" }, { @@ -505,43 +488,43 @@ "name": "DefinitionType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -551,14 +534,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -568,14 +551,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -585,864 +568,877 @@ ] }, { - "name": "Format", + "type": "string", + "name": "baseDefinitionUrl", + "doc": "Reference to a base definition for this definition, either via a (relative) URL or a fragment identifier. The base definition is overridden by this definition. If not present, this definition does not override any base definition." + }, + { + "name": "format", "type": [ { "type": "record", - "name": "FormatAmqp10Type", + "name": "FormatNoneType", + "fields": [] + }, + { + "type": "record", + "name": "FormatCloudevents10Type", "fields": [ { "type": { "type": "record", - "name": "FormatAmqp10MetadataType", + "name": "FormatCloudevents10MetadataType", "fields": [ { "type": { "type": "record", - "name": "FormatAmqp10PropertiesType", + "name": "FormatCloudevents10TypeType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents type value template." + } + ] + }, + "name": "type", + "doc": "CloudEvents type." + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10SourceType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents source value template." + } + ] + }, + "name": "source", + "doc": "CloudEvents source" + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10SubjectType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents subject value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "CloudEvents subject required." + } + ] + }, + "name": "subject", + "doc": "CloudEvents subject" + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10IdType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents id value template." + } + ] + }, + "name": "id", + "doc": "CloudEvents id" + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10TimeType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "The timestamp value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "The timestamp required." + } + ] + }, + "name": "time", + "doc": "The timestamp of when the event happened." + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10DataschemaType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "The uri value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "The uri required." + } + ] + }, + "name": "dataschema", + "doc": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." + }, + { + "name": "Extensions", + "type": { + "type": "map", + "name": "FormatCloudevents10ExtensionsType", + "default": {}, + "values": { + "type": "record", + "name": "FormatCloudevents10ExtensionItemType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "The value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "Whether the extension is required" + } + ] + } + }, + "doc": "CloudEvent extension property" + } + ] + }, + "name": "metadata", + "doc": "CloudEvents metadata constraints." + } + ] + } + ], + "doc": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups." + }, + { + "name": "binding", + "type": [ + { + "type": "record", + "name": "BindingNoneType", + "fields": [] + }, + { + "type": "record", + "name": "BindingAmqp10Type", + "fields": [ + { + "type": { + "type": "record", + "name": "BindingAmqp10MessageType", + "fields": [ + { + "type": { + "type": "record", + "name": "BindingAmqp10PropertiesType", "fields": [ { "type": { "type": "record", - "name": "FormatAmqp10MessageIdType", + "name": "BindingAmqp10MessageIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP message-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP message-id required." } ] }, - "name": "MessageId", + "name": "messageId", "doc": "AMQP message-id." }, { "type": { "type": "record", - "name": "FormatAmqp10UserIdType", + "name": "BindingAmqp10UserIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP user-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP user-id required." } ] }, - "name": "UserId", + "name": "userId", "doc": "AMQP user-id." }, { "type": { "type": "record", - "name": "FormatAmqp10ToType", + "name": "BindingAmqp10ToType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP to value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP to required." } ] }, - "name": "To", + "name": "to", "doc": "AMQP to." }, { "type": { "type": "record", - "name": "FormatAmqp10SubjectType", + "name": "BindingAmqp10SubjectType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP subject value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP subject required." } ] }, - "name": "Subject", + "name": "subject", "doc": "AMQP subject." }, { "type": { "type": "record", - "name": "FormatAmqp10ReplyToType", + "name": "BindingAmqp10ReplyToType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP reply-to value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP reply-to required." } ] }, - "name": "ReplyTo", + "name": "replyTo", "doc": "AMQP reply-to." }, { "type": { "type": "record", - "name": "FormatAmqp10CorrelationIdType", + "name": "BindingAmqp10CorrelationIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP correlation-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP correlation-id required." } ] }, - "name": "CorrelationId", + "name": "correlationId", "doc": "AMQP correlation-id." }, { "type": { "type": "record", - "name": "FormatAmqp10ContentTypeType", + "name": "BindingAmqp10ContentTypeType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP content-type value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP content-type required." } ] }, - "name": "ContentType", + "name": "contentType", "doc": "AMQP content-type." }, { "type": { "type": "record", - "name": "FormatAmqp10ContentEncodingType", + "name": "BindingAmqp10ContentEncodingType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP content-encoding value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP content-encoding required." } ] }, - "name": "ContentEncoding", + "name": "contentEncoding", "doc": "AMQP content-encoding." }, { "type": { "type": "record", - "name": "FormatAmqp10AbsoluteExpiryTimeType", + "name": "BindingAmqp10AbsoluteExpiryTimeType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP absolute-expiry-time value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP absolute-expiry-time required." } ] }, - "name": "AbsoluteExpiryTime", + "name": "absoluteExpiryTime", "doc": "AMQP absolute-expiry-time." }, { "type": { "type": "record", - "name": "FormatAmqp10GroupIdType", + "name": "BindingAmqp10GroupIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP group-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP group-id required." } ] }, - "name": "GroupId", + "name": "groupId", "doc": "AMQP group-id." }, { "type": { "type": "record", - "name": "FormatAmqp10GroupSequenceType", + "name": "BindingAmqp10GroupSequenceType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP group-sequence value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP group-sequence required." } ] }, - "name": "GroupSequence", + "name": "groupSequence", "doc": "AMQP group-sequence." }, { "type": { "type": "record", - "name": "FormatAmqp10ReplyToGroupIdType", + "name": "BindingAmqp10ReplyToGroupIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP reply-to-group-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP reply-to-group-id required." } ] }, - "name": "ReplyToGroupId", + "name": "replyToGroupId", "doc": "AMQP reply-to-group-id." } ] }, - "name": "Properties" + "name": "properties" }, { "type": { "type": "map", - "name": "FormatAmqp10ApplicationPropertiesType", + "name": "BindingAmqp10ApplicationPropertiesType", "values": { "type": "record", - "name": "FormatAmqp10ApplicationPropertiesItemType", + "name": "BindingAmqp10ApplicationPropertiesItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "The application property name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "The application property value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "The application property required." }, { "type": "string", - "name": "Type", + "name": "type", "doc": "The application property type." } ] } }, - "name": "ApplicationProperties" + "name": "applicationProperties" }, { "type": { "type": "map", - "name": "FormatAmqp10MessageAnnotationsType", + "name": "BindingAmqp10MessageAnnotationsType", "values": { "type": "record", - "name": "FormatAmqp10MessageAnnotationsItemType", + "name": "BindingAmqp10MessageAnnotationsItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "The message annotation name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "The message annotation value" }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "Whether the message annotation is required" }, { "type": "string", - "name": "Type", + "name": "type", "doc": "The message annotation type." } ] } }, - "name": "MessageAnnotations" + "name": "messageAnnotations" }, { "type": { "type": "map", - "name": "FormatAmqp10DeliveryAnnotationsType", + "name": "BindingAmqp10DeliveryAnnotationsType", "values": { "type": "record", - "name": "FormatAmqp10DeliveryAnnotationsItemType", + "name": "BindingAmqp10DeliveryAnnotationsItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "The delivery annotation name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "The delivery annotation value" }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "Whether the annotation is required" }, { "type": "string", - "name": "Type", + "name": "type", "doc": "The annotation type." } ] } }, - "name": "DeliveryAnnotations" + "name": "deliveryAnnotations" }, { "type": { "type": "map", - "name": "FormatAmqp10HeaderType", + "name": "BindingAmqp10HeaderType", "values": { "type": "record", - "name": "FormatAmqp10HeaderItemType", + "name": "BindingAmqp10HeaderItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "AMQP header name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP header value." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP header required." }, { "type": "string", - "name": "Type", + "name": "type", "doc": "AMQP header type." } ] } }, - "name": "Header" + "name": "header" }, { "type": { "type": "map", - "name": "FormatAmqp10FooterType", + "name": "BindingAmqp10FooterType", "values": { "type": "record", - "name": "FormatAmqp10FooterItemType", + "name": "BindingAmqp10FooterItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "AMQP footer name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP footer value." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP footer required." }, { "type": "string", - "name": "Type", + "name": "type", "doc": "AMQP footer type." } ] } }, - "name": "Footer" + "name": "footer" } ] }, - "name": "Metadata", + "name": "message", "doc": "AMQP message metadata constraints." } ] }, { "type": "record", - "name": "FormatMqtt311Type", + "name": "BindingMqtt311Type", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt311MetadataType", + "name": "BindingMqtt311MessageType", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt311QosType", + "name": "BindingMqtt311QosType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT qos value template." } ] }, - "name": "Qos", + "name": "qos", "doc": "MQTT qos." }, { "type": { "type": "record", - "name": "FormatMqtt311RetainType", + "name": "BindingMqtt311RetainType", "fields": [ { "type": "boolean", - "name": "Value", + "name": "value", "doc": "MQTT retain value template." } ] }, - "name": "Retain", + "name": "retain", "doc": "MQTT retain." }, { "type": { "type": "record", - "name": "FormatMqtt311TopicNameType", + "name": "BindingMqtt311TopicNameType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT topic-name value template." } ] }, - "name": "TopicName", + "name": "topicName", "doc": "MQTT topic-name." } ] }, - "name": "Metadata", + "name": "message", "doc": "MQTT message metadata constraints." } ] }, { "type": "record", - "name": "FormatMqtt50Type", + "name": "BindingMqtt50Type", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt50MetadataType", + "name": "BindingMqtt50MessageType", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt50QosType", + "name": "BindingMqtt50QosType", "fields": [ { "type": "int", - "name": "Value", + "name": "value", "doc": "MQTT qos value template." } ] }, - "name": "Qos", + "name": "qos", "doc": "MQTT qos." }, { "type": { "type": "record", - "name": "FormatMqtt50RetainType", + "name": "BindingMqtt50RetainType", "fields": [ { "type": "boolean", - "name": "Value", + "name": "value", "doc": "MQTT retain value template." } ] }, - "name": "Retain", + "name": "retain", "doc": "MQTT retain." }, { "type": { "type": "record", - "name": "FormatMqtt50TopicNameType", + "name": "BindingMqtt50TopicNameType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT topic-name value template." } ] }, - "name": "TopicName", + "name": "topicName", "doc": "MQTT topic-name." }, { "type": { "type": "record", - "name": "FormatMqtt50MessageExpiryIntervalType", + "name": "BindingMqtt50MessageExpiryIntervalType", "fields": [ { "type": "int", - "name": "Value", + "name": "value", "doc": "MQTT message-expiry-interval value template." } ] }, - "name": "MessageExpiryInterval", + "name": "messageExpiryInterval", "doc": "MQTT message-expiry-interval." }, { "type": { "type": "record", - "name": "FormatMqtt50ResponseTopicType", + "name": "BindingMqtt50ResponseTopicType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT response-topic value template." } ] }, - "name": "ResponseTopic", + "name": "responseTopic", "doc": "MQTT response-topic." }, { "type": { "type": "record", - "name": "FormatMqtt50CorrelationDataType", + "name": "BindingMqtt50CorrelationDataType", "fields": [ { "type": "bytes", - "name": "Value", + "name": "value", "doc": "MQTT correlation-data value template." } ] }, - "name": "CorrelationData", + "name": "correlationData", "doc": "MQTT correlation-data." }, { "type": { "type": "record", - "name": "FormatMqtt50ContentTypeType", + "name": "BindingMqtt50ContentTypeType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT content-type value template." } ] }, - "name": "ContentType", + "name": "contentType", "doc": "MQTT content-type." }, { "type": { "type": "array", + "name": "BindingMqtt50UserPropertiesArrayType", "items": { "type": "record", - "name": "FormatMqtt50UserPropertiesType", + "name": "BindingMqtt50UserPropertiesType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "MQTT user-property name." }, { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT user-property value." } ] } }, - "name": "UserProperties", + "name": "userProperties", "doc": "MQTT user-properties." } ] }, - "name": "Metadata", + "name": "message", "doc": "MQTT message metadata constraints." } ] }, { "type": "record", - "name": "FormatKafka011Type", + "name": "BindingKAFKAType", "fields": [ { "type": { "type": "record", - "name": "FormatKafka011MetadataType", + "name": "BindingKAFKAMessageType", "fields": [ { "type": "string", - "name": "Topic", + "name": "topic", "doc": "The Apache Kafka topic." }, { "type": "int", - "name": "Partition", + "name": "partition", "doc": "The Apache Kafka partition." }, { "type": "bytes", - "name": "Key", + "name": "key", "doc": "The Apache Kafka key." }, { "type": { "type": "map", - "name": "FormatKafka011HeadersType", + "name": "BindingKAFKAHeadersType", "values": { "type": "record", - "name": "FormatKafka011HeadersItemType", + "name": "BindingKAFKAHeadersItemType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The Apache Kafka header name." }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The Apache Kafka header value." } ] } }, - "name": "Headers", + "name": "headers", "doc": "The Apache Kafka headers." }, { "type": "int", - "name": "Timestamp", + "name": "timestamp", "doc": "The Apache Kafka timestamp." } ] }, - "name": "Metadata", + "name": "message", "doc": "The Apache Kafka message metadata constraints." } ] }, { "type": "record", - "name": "FormatCloudevents10Type", + "name": "BindingHTTPType", "fields": [ { "type": { "type": "record", - "name": "FormatCloudevents10MetadataType", - "fields": [ - { - "type": { - "type": "record", - "name": "FormatCloudevents10TypeType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents type value template." - } - ] - }, - "name": "Type", - "doc": "CloudEvents type." - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10SourceType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents source value template." - } - ] - }, - "name": "Source", - "doc": "CloudEvents source" - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10SubjectType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents subject value template." - }, - { - "type": "boolean", - "name": "Required", - "doc": "CloudEvents subject required." - } - ] - }, - "name": "Subject", - "doc": "CloudEvents subject" - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10IdType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents id value template." - } - ] - }, - "name": "Id", - "doc": "CloudEvents id" - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10TimeType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "The timestamp value template." - }, - { - "type": "boolean", - "name": "Required", - "doc": "The timestamp required." - } - ] - }, - "name": "Time", - "doc": "The timestamp of when the event happened." - }, - { - "type": "string", - "name": "Dataschema", - "doc": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." - }, - { - "name": "Extensions", - "type": { - "type": "map", - "name": "FormatCloudevents10ExtensionsType", - "default": {}, - "values": { - "type": "record", - "name": "FormatCloudevents10ExtensionItemType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "The value template." - }, - { - "type": "boolean", - "name": "Required", - "doc": "Whether the extension is required" - } - ] - } - }, - "doc": "CloudEvent extension property" - } - ] - }, - "name": "Metadata", - "doc": "CloudEvents metadata constraints." - } - ] - }, - { - "type": "record", - "name": "FormatHttp11Type", - "fields": [ - { - "type": { - "type": "record", - "name": "FormatHttp11MetadataType", + "name": "BindingHTTPMessageType", "fields": [ { "type": { "type": "array", + "name": "BindingHTTPHeadersArrayType", "items": { "type": "record", - "name": "FormatHttp11HeadersType", + "name": "BindingHTTPHeadersType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The HTTP header name." }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The HTTP header value." } ] } }, - "name": "Headers", + "name": "headers", "doc": "The HTTP headers." }, { @@ -1483,28 +1479,28 @@ } ] }, - "name": "Query", + "name": "query", "doc": "The HTTP query parameters." }, { "type": "string", - "name": "Path", + "name": "path", "doc": "The HTTP path as a uri template." }, { "type": "string", - "name": "Method", + "name": "method", "doc": "The HTTP method." } ] }, - "name": "Metadata", + "name": "message", "doc": "The HTTP message metadata constraints." } ] } ], - "doc": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups." + "doc": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups." } ] } diff --git a/endpoint/schemas/document-schema.json b/endpoint/schemas/document-schema.json index a82272f..e11ec6e 100644 --- a/endpoint/schemas/document-schema.json +++ b/endpoint/schemas/document-schema.json @@ -36,698 +36,721 @@ "labels": { "type": "object" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" + }, + "baseDefinitionUrl": { + "type": "string", + "format": "uri", + "description": "Reference to a base definition for this definition, either via a (relative) URL or a fragment identifier. The base definition is overridden by this definition. If not present, this definition does not override any base definition." } }, "required": [ "id" ], - "oneOf": [ + "allOf": [ { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "AMQP/1.0" - ] + "oneOf": [ + { + "properties": { + "format": { + "type": "string", + "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "None" + ], + "default": "None" + } + } }, - "metadata": { - "type": "object", - "description": "AMQP message metadata constraints.", + { "properties": { - "properties": { + "format": { + "type": "string", + "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "CloudEvents/1.0" + ] + }, + "metadata": { "type": "object", + "description": "CloudEvents metadata constraints.", "properties": { - "message-id": { + "type": { "type": "object", - "description": "AMQP message-id.", + "description": "CloudEvents type.", "properties": { "value": { "type": "string", - "description": "AMQP message-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP message-id required." + "description": "CloudEvents type value template." } } }, - "user-id": { + "source": { "type": "object", - "description": "AMQP user-id.", + "description": "CloudEvents source", "properties": { "value": { "type": "string", - "description": "AMQP user-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP user-id required." + "description": "CloudEvents source value template." } } }, - "to": { + "subject": { "type": "object", - "description": "AMQP to.", + "description": "CloudEvents subject", "properties": { "value": { "type": "string", - "description": "AMQP to value template." + "description": "CloudEvents subject value template." }, "required": { "type": "boolean", - "description": "AMQP to required." + "description": "CloudEvents subject required." } } }, - "subject": { + "id": { "type": "object", - "description": "AMQP subject.", + "description": "CloudEvents id", "properties": { "value": { "type": "string", - "description": "AMQP subject value template." - }, - "required": { - "type": "boolean", - "description": "AMQP subject required." + "description": "CloudEvents id value template." } } }, - "reply-to": { + "time": { "type": "object", - "description": "AMQP reply-to.", + "description": "The timestamp of when the event happened.", "properties": { "value": { "type": "string", - "description": "AMQP reply-to value template." + "description": "The timestamp value template." }, "required": { "type": "boolean", - "description": "AMQP reply-to required." + "description": "The timestamp required." } } }, - "correlation-id": { + "dataschema": { "type": "object", - "description": "AMQP correlation-id.", + "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default.", "properties": { "value": { "type": "string", - "description": "AMQP correlation-id value template." + "format": "uri-template", + "description": "The uri value template." }, "required": { "type": "boolean", - "description": "AMQP correlation-id required." + "description": "The uri required." } } - }, - "content-type": { + } + }, + "additionalProperties": { + "type": "object", + "description": "CloudEvent extension property", + "properties": { + "value": { + "type": "string", + "description": "The value template." + }, + "required": { + "type": "boolean", + "description": "Whether the extension is required" + } + } + } + } + }, + "required": [ + "format" + ] + } + ] + }, + { + "oneOf": [ + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "None" + ], + "default": "None" + } + } + }, + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "AMQP/1.0" + ] + }, + "message": { + "type": "object", + "description": "AMQP message metadata constraints.", + "properties": { + "properties": { "type": "object", - "description": "AMQP content-type.", "properties": { - "value": { - "type": "string", - "description": "AMQP content-type value template." + "message_id": { + "type": "object", + "description": "AMQP message-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP message-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP message-id required." + } + } }, - "required": { - "type": "boolean", - "description": "AMQP content-type required." + "user_id": { + "type": "object", + "description": "AMQP user-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP user-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP user-id required." + } + } + }, + "to": { + "type": "object", + "description": "AMQP to.", + "properties": { + "value": { + "type": "string", + "description": "AMQP to value template." + }, + "required": { + "type": "boolean", + "description": "AMQP to required." + } + } + }, + "subject": { + "type": "object", + "description": "AMQP subject.", + "properties": { + "value": { + "type": "string", + "description": "AMQP subject value template." + }, + "required": { + "type": "boolean", + "description": "AMQP subject required." + } + } + }, + "reply_to": { + "type": "object", + "description": "AMQP reply-to.", + "properties": { + "value": { + "type": "string", + "description": "AMQP reply-to value template." + }, + "required": { + "type": "boolean", + "description": "AMQP reply-to required." + } + } + }, + "correlation_id": { + "type": "object", + "description": "AMQP correlation-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP correlation-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP correlation-id required." + } + } + }, + "content_type": { + "type": "object", + "description": "AMQP content-type.", + "properties": { + "value": { + "type": "string", + "description": "AMQP content-type value template." + }, + "required": { + "type": "boolean", + "description": "AMQP content-type required." + } + } + }, + "content_encoding": { + "type": "object", + "description": "AMQP content-encoding.", + "properties": { + "value": { + "type": "string", + "description": "AMQP content-encoding value template." + }, + "required": { + "type": "boolean", + "description": "AMQP content-encoding required." + } + } + }, + "absolute_expiry_time": { + "type": "object", + "description": "AMQP absolute-expiry-time.", + "properties": { + "value": { + "type": "string", + "description": "AMQP absolute-expiry-time value template." + }, + "required": { + "type": "boolean", + "description": "AMQP absolute-expiry-time required." + } + } + }, + "group_id": { + "type": "object", + "description": "AMQP group-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP group-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP group-id required." + } + } + }, + "group_sequence": { + "type": "object", + "description": "AMQP group-sequence.", + "properties": { + "value": { + "type": "string", + "description": "AMQP group-sequence value template." + }, + "required": { + "type": "boolean", + "description": "AMQP group-sequence required." + } + } + }, + "reply_to_group_id": { + "type": "object", + "description": "AMQP reply-to-group-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP reply-to-group-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP reply-to-group-id required." + } + } } } }, - "content-encoding": { + "application_properties": { "type": "object", - "description": "AMQP content-encoding.", - "properties": { - "value": { - "type": "string", - "description": "AMQP content-encoding value template." - }, - "required": { - "type": "boolean", - "description": "AMQP content-encoding required." + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The application property value template." + }, + "required": { + "type": "boolean", + "description": "The application property required." + }, + "type": { + "type": "string", + "description": "The application property type." + } } } }, - "absolute-expiry-time": { + "message_annotations": { "type": "object", - "description": "AMQP absolute-expiry-time.", - "properties": { - "value": { - "type": "string", - "description": "AMQP absolute-expiry-time value template." - }, - "required": { - "type": "boolean", - "description": "AMQP absolute-expiry-time required." + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The message annotation value" + }, + "required": { + "type": "boolean", + "description": "Whether the message annotation is required" + }, + "type": { + "type": "string", + "description": "The message annotation type." + } + } + } + }, + "delivery_annotations": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The delivery annotation value" + }, + "required": { + "type": "boolean", + "description": "Whether the annotation is required" + }, + "type": { + "type": "string", + "description": "The annotation type." + } + } + } + }, + "header": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "AMQP header value." + }, + "required": { + "type": "boolean", + "description": "AMQP header required." + }, + "type": { + "type": "string", + "description": "AMQP header type." + } } } }, - "group-id": { + "footer": { "type": "object", - "description": "AMQP group-id.", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "AMQP footer value." + }, + "required": { + "type": "boolean", + "description": "AMQP footer required." + }, + "type": { + "type": "string", + "description": "AMQP footer type." + } + } + } + } + } + } + }, + "required": [ + "binding" + ] + }, + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "MQTT/3.1.1" + ] + }, + "message": { + "type": "object", + "description": "MQTT message metadata constraints.", + "properties": { + "qos": { + "type": "object", + "description": "MQTT qos.", "properties": { "value": { "type": "string", - "description": "AMQP group-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP group-id required." + "description": "MQTT qos value template." } } }, - "group-sequence": { + "retain": { "type": "object", - "description": "AMQP group-sequence.", + "description": "MQTT retain.", "properties": { "value": { - "type": "string", - "description": "AMQP group-sequence value template." - }, - "required": { "type": "boolean", - "description": "AMQP group-sequence required." + "description": "MQTT retain value template." } } }, - "reply-to-group-id": { + "topic_name": { "type": "object", - "description": "AMQP reply-to-group-id.", + "description": "MQTT topic-name.", "properties": { "value": { "type": "string", - "description": "AMQP reply-to-group-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP reply-to-group-id required." + "description": "MQTT topic-name value template." } } } } + } + }, + "required": [ + "binding" + ] + }, + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "MQTT/5.0" + ] }, - "application-properties": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The application property name." - }, - "value": { - "type": "string", - "description": "The application property value template." - }, - "required": { - "type": "boolean", - "description": "The application property required." - }, - "type": { - "type": "string", - "description": "The application property type." - } - } - } - }, - "message-annotations": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The message annotation name." - }, - "value": { - "type": "string", - "description": "The message annotation value" - }, - "required": { - "type": "boolean", - "description": "Whether the message annotation is required" - }, - "type": { - "type": "string", - "description": "The message annotation type." - } - }, - "required": [ - "name" - ] - } - }, - "delivery-annotations": { + "message": { "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The delivery annotation name." - }, - "value": { - "type": "string", - "description": "The delivery annotation value" - }, - "required": { - "type": "boolean", - "description": "Whether the annotation is required" - }, - "type": { - "type": "string", - "description": "The annotation type." + "description": "MQTT message metadata constraints.", + "properties": { + "qos": { + "type": "object", + "description": "MQTT qos.", + "properties": { + "value": { + "type": "integer", + "description": "MQTT qos value template." + } } }, - "required": [ - "name" - ] - } - }, - "header": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "AMQP header name." - }, - "value": { - "type": "string", - "description": "AMQP header value." - }, - "required": { - "type": "boolean", - "description": "AMQP header required." - }, - "type": { - "type": "string", - "description": "AMQP header type." + "retain": { + "type": "object", + "description": "MQTT retain.", + "properties": { + "value": { + "type": "boolean", + "description": "MQTT retain value template." + } } }, - "required": [ - "name" - ] - } - }, - "footer": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "AMQP footer name." - }, - "value": { - "type": "string", - "description": "AMQP footer value." - }, - "required": { - "type": "boolean", - "description": "AMQP footer required." - }, - "type": { - "type": "string", - "description": "AMQP footer type." + "topic_name": { + "type": "object", + "description": "MQTT topic-name.", + "properties": { + "value": { + "type": "string", + "description": "MQTT topic-name value template." + } } }, - "required": [ - "name" - ] - } - } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "MQTT/3.1.1" - ] - }, - "metadata": { - "type": "object", - "description": "MQTT message metadata constraints.", - "properties": { - "qos": { - "type": "object", - "description": "MQTT qos.", - "properties": { - "value": { - "type": "string", - "description": "MQTT qos value template." - } - } - }, - "retain": { - "type": "object", - "description": "MQTT retain.", - "properties": { - "value": { - "type": "boolean", - "description": "MQTT retain value template." - } - } - }, - "topic-name": { - "type": "object", - "description": "MQTT topic-name.", - "properties": { - "value": { - "type": "string", - "description": "MQTT topic-name value template." - } - } - } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "MQTT/5.0" - ] - }, - "metadata": { - "type": "object", - "description": "MQTT message metadata constraints.", - "properties": { - "qos": { - "type": "object", - "description": "MQTT qos.", - "properties": { - "value": { - "type": "integer", - "description": "MQTT qos value template." - } - } - }, - "retain": { - "type": "object", - "description": "MQTT retain.", - "properties": { - "value": { - "type": "boolean", - "description": "MQTT retain value template." - } - } - }, - "topic-name": { - "type": "object", - "description": "MQTT topic-name.", - "properties": { - "value": { - "type": "string", - "description": "MQTT topic-name value template." - } - } - }, - "message-expiry-interval": { - "type": "object", - "description": "MQTT message-expiry-interval.", - "properties": { - "value": { - "type": "integer", - "description": "MQTT message-expiry-interval value template." - } - } - }, - "response-topic": { - "type": "object", - "description": "MQTT response-topic.", - "properties": { - "value": { - "type": "string", - "description": "MQTT response-topic value template." - } - } - }, - "correlation-data": { - "type": "object", - "description": "MQTT correlation-data.", - "properties": { - "value": { - "type": "string", - "format": "base64", - "description": "MQTT correlation-data value template." - } - } - }, - "content-type": { - "type": "object", - "description": "MQTT content-type.", - "properties": { - "value": { - "type": "string", - "description": "MQTT content-type value template." - } - } - }, - "user-properties": { - "type": "array", - "description": "MQTT user-properties.", - "items": { - "properties": { - "name": { - "type": "string", - "description": "MQTT user-property name." - }, - "value": { - "type": "string", - "description": "MQTT user-property value." + "message_expiry_interval": { + "type": "object", + "description": "MQTT message-expiry-interval.", + "properties": { + "value": { + "type": "integer", + "description": "MQTT message-expiry-interval value template." + } + } + }, + "response_topic": { + "type": "object", + "description": "MQTT response-topic.", + "properties": { + "value": { + "type": "string", + "description": "MQTT response-topic value template." + } + } + }, + "correlation_data": { + "type": "object", + "description": "MQTT correlation-data.", + "properties": { + "value": { + "type": "string", + "format": "base64", + "description": "MQTT correlation-data value template." + } + } + }, + "content_type": { + "type": "object", + "description": "MQTT content-type.", + "properties": { + "value": { + "type": "string", + "description": "MQTT content-type value template." + } + } + }, + "user_properties": { + "type": "array", + "description": "MQTT user-properties.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "MQTT user-property name." + }, + "value": { + "type": "string", + "description": "MQTT user-property value." + } + } } } } } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "KAFKA/0.11" + }, + "required": [ + "binding" ] }, - "metadata": { - "type": "object", - "description": "The Apache Kafka message metadata constraints.", + { "properties": { - "topic": { - "type": "string", - "description": "The Apache Kafka topic." - }, - "partition": { - "type": "integer", - "description": "The Apache Kafka partition." - }, - "key": { + "binding": { "type": "string", - "format": "base64", - "description": "The Apache Kafka key." + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "KAFKA" + ] }, - "headers": { + "message": { "type": "object", - "description": "The Apache Kafka headers.", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The Apache Kafka header name." - }, - "value": { - "type": "string", - "description": "The Apache Kafka header value." + "description": "The Apache Kafka message metadata constraints.", + "properties": { + "topic": { + "type": "string", + "description": "The Apache Kafka topic." + }, + "partition": { + "type": "integer", + "description": "The Apache Kafka partition." + }, + "key": { + "type": "string", + "format": "base64", + "description": "The Apache Kafka key." + }, + "headers": { + "type": "object", + "description": "The Apache Kafka headers.", + "additionalProperties": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The Apache Kafka header name." + }, + "value": { + "type": "string", + "description": "The Apache Kafka header value." + } + } } + }, + "timestamp": { + "type": "integer", + "description": "The Apache Kafka timestamp." } } - }, - "timestamp": { - "type": "integer", - "description": "The Apache Kafka timestamp." } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "CloudEvents/1.0" + }, + "required": [ + "binding" ] }, - "metadata": { - "type": "object", - "description": "CloudEvents metadata constraints.", + { "properties": { - "type": { - "type": "object", - "description": "CloudEvents type.", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents type value template." - } - } - }, - "source": { - "type": "object", - "description": "CloudEvents source", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents source value template." - } - } + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "HTTP" + ] }, - "subject": { + "message": { "type": "object", - "description": "CloudEvents subject", + "description": "The HTTP message metadata constraints.", "properties": { - "value": { - "type": "string", - "description": "CloudEvents subject value template." + "headers": { + "type": "array", + "description": "The HTTP headers.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The HTTP header name." + }, + "value": { + "type": "string", + "description": "The HTTP header value." + } + } + } }, - "required": { - "type": "boolean", - "description": "CloudEvents subject required." - } - } - }, - "id": { - "type": "object", - "description": "CloudEvents id", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents id value template." - } - } - }, - "time": { - "type": "object", - "description": "The timestamp of when the event happened.", - "properties": { - "value": { + "query": { + "type": "object", + "description": "The HTTP query parameters." + }, + "path": { "type": "string", - "description": "The timestamp value template." + "description": "The HTTP path as a uri template." }, - "required": { - "type": "boolean", - "description": "The timestamp required." + "method": { + "type": "string", + "description": "The HTTP method." } } - }, - "dataschema": { - "type": "string", - "format": "uri-template", - "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." } }, - "additionalProperties": { - "type": "object", - "description": "CloudEvent extension property", - "properties": { - "value": { - "type": "string", - "description": "The value template." - }, - "required": { - "type": "boolean", - "description": "Whether the extension is required" - } - } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "HTTP/1.1" + "required": [ + "binding" ] - }, - "metadata": { - "type": "object", - "description": "The HTTP message metadata constraints.", - "properties": { - "headers": { - "type": "array", - "description": "The HTTP headers.", - "items": { - "properties": { - "name": { - "type": "string", - "description": "The HTTP header name." - }, - "value": { - "type": "string", - "description": "The HTTP header value." - } - } - } - }, - "query": { - "type": "object", - "description": "The HTTP query parameters." - }, - "path": { - "type": "string", - "description": "The HTTP path as a uri template." - }, - "method": { - "type": "string", - "description": "The HTTP method." - } - } } - }, - "required": [ - "format" ] } ] @@ -760,22 +783,26 @@ }, "format": { "type": "string", - "description": "Endpoint message format identifier. If set, all definitions MUST use this format value." + "description": "Endpoint metadata format identifier. If set, all definitions MUST use this format value." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, + "binding": { + "type": "string", + "description": "Endpoint message binding identifier. If set, all definitions MUST use this binding value." + }, "config": { "type": "object", "description": "Configuration information for this endpoint", @@ -784,6 +811,10 @@ "type": "array", "description": "Authorization options. These are hints for the adapter for interacting with the authorization endpoint. This is not a credentials configuration.", "items": { + "type": "object", + "required": [ + "type" + ], "properties": { "type": { "type": "string", @@ -804,10 +835,7 @@ "type": "string" } } - }, - "required": [ - "type" - ] + } } }, "endpoints": { @@ -848,52 +876,25 @@ "type": "boolean", "description": "The AMQP durable flag. Whether the node is durable or transient." }, - "link-properties": { + "link_properties": { "type": "object", "description": "An optional map of AMQP link properties to use with the endpoint", "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "Link property name" - }, - "value": { - "type": "string", - "description": "Link property value" - } - }, - "required": [ - "name", - "value" - ] + "type": "string" } }, - "connection-properties": { + "connection_properties": { "type": "object", "description": "An optional map of AMQP connection properties to use with the endpoint", - "properties": { - "name": { - "type": "string", - "description": "Connection property name" - }, - "value": { - "type": "string", - "description": "Connection property value" - } - }, - "required": [ - "name", - "value" - ] + "additionalProperties": { + "type": "string" + } }, - "distribution-mode": { + "distribution_mode": { "type": "string", "description": "The AMQP distribution mode for receivers. Can be 'move' or 'copy'. A value of 'move' indicates an exclusive lock on the message. A value of 'copy' indicates a non-exclusive lock on the message." } }, - "required": [ - "node" - ], "additionalProperties": { "type": "string", "description": "Further options to configure the AMQP 1.0 client" @@ -929,15 +930,15 @@ "type": "boolean", "description": "The MQTT retain flag to use for publishers on ths endpoint" }, - "clean-session": { + "clean_session": { "type": "boolean", "description": "The MQTT clean session flag to use for publishers on this endpoint" }, - "will-topic": { + "will_topic": { "type": "string", "description": "The MQTT will topic to configure for publishers on this endpoint" }, - "will-message": { + "will_message": { "type": "string", "format": "uri", "description": "The MQTT will message definition to configure for publishers on this endpoint" @@ -974,15 +975,15 @@ "type": "boolean", "description": "The MQTT retain flag to use for publishers on ths endpoint" }, - "clean-session": { + "clean_session": { "type": "boolean", "description": "The MQTT clean session flag to use for publishers on this endpoint" }, - "will-topic": { + "will_topic": { "type": "string", "description": "The MQTT will topic to configure for publishers on this endpoint" }, - "will-message": { + "will_message": { "type": "string", "format": "uri", "description": "The MQTT will message definition to configure for publishers on this endpoint" @@ -1015,6 +1016,11 @@ "type": "array", "description": "HTTP headers to use with the endpoint. The same header may be specified multiple times with different values. The HTTP header names are case insensitive.", "items": { + "type": "object", + "required": [ + "name", + "value" + ], "properties": { "name": { "type": "string", @@ -1024,17 +1030,18 @@ "type": "string", "description": "HTTP header value" } - }, - "required": [ - "name", - "value" - ] + } } }, "query": { - "type": "object", + "type": "array", "description": "HTTP query parameters", - "additionalProperties": { + "items": { + "type": "object", + "required": [ + "name", + "value" + ], "properties": { "name": { "type": "string", @@ -1044,17 +1051,10 @@ "type": "string", "description": "The HTTP query parameter value" } - }, - "required": [ - "name", - "value" - ] + } } } - }, - "required": [ - "method" - ] + } } }, "required": [ @@ -1073,6 +1073,9 @@ "options": { "type": "object", "description": "Apache Kafka options", + "required": [ + "topic" + ], "properties": { "topic": { "type": "string", @@ -1087,7 +1090,7 @@ "format": "base64", "description": "The Apache Kafka record key" }, - "consumer-group": { + "consumergroup": { "type": "string", "description": "The Apache Kafka consumer group name to use for consumers" }, @@ -1099,6 +1102,11 @@ "type": "object", "description": "The Apache Kafka headers for publishers on this endpoint", "additionalProperties": { + "type": "object", + "required": [ + "name", + "value" + ], "properties": { "name": { "type": "string", @@ -1108,17 +1116,10 @@ "type": "string", "description": "The Apache Kafka header value" } - }, - "required": [ - "name", - "value" - ] + } } } - }, - "required": [ - "topic" - ] + } } }, "required": [ @@ -1137,15 +1138,15 @@ "options": { "type": "object", "description": "NATS options", + "required": [ + "subject" + ], "properties": { "subject": { "type": "string", "description": "The NATS subject" } - }, - "required": [ - "subject" - ] + } } }, "required": [ @@ -1162,8 +1163,7 @@ } }, "required": [ - "id", - "format" + "id" ] } } diff --git a/endpoint/spec.md b/endpoint/spec.md index 6728541..91b65c1 100644 --- a/endpoint/spec.md +++ b/endpoint/spec.md @@ -530,10 +530,10 @@ The following options are defined for MQTT endpoints. - `qos`: The MQTT Quality of Service (QoS) level to use for the endpoint. The value MUST be an integer between 0 and 2. The default value is 0. The value is overidden by the `qos` property of the - [MQTT message format](../message/spec.md#mqtt311-and-mqtt50). + [MQTT message format](../message/spec.md#mqtt311-and-mqtt50-bindings). - `retain`: If `true`, the MQTT `retain` flag is set on transfers. The default value is `false`. The value is overidden by the `retain` property of the [MQTT - message format](../message/spec.md#mqtt311-and-mqtt50). This option only + message format](../message/spec.md#mqtt311-and-mqtt50-bindings). This option only applies to `usage:producer` endpoints. - `clean-session`: If `true`, the MQTT `clean-session` flag is set on connections. The default value is `true`. @@ -545,8 +545,8 @@ The following options are defined for MQTT endpoints. It MUST point to a valid [´definition´](../message/spec.md#message-definitions) that MUST either use the ["CloudEvents/1.0"](../message/spec.md#cloudevents10) or - ["MQTT/3.1.1." or "MQTT/5.0"](../message/spec.md#mqtt311-and-mqtt50) - [`format`](../message/spec.md#format-message-format). + ["MQTT/3.1.1." or "MQTT/5.0"](../message/spec.md#mqtt311-and-mqtt50-bindings) + [`format`](../message/spec.md#format-metadata-format). Example: diff --git a/message/model.json b/message/model.json index 37d9823..6e21b2c 100644 --- a/message/model.json +++ b/message/model.json @@ -3,14 +3,19 @@ "json-schema/draft-07" ], "groups": { - "definitionGroups": { - "singular": "definitionGroup", - "plural": "definitionGroups", + "definitiongroups": { + "singular": "definitiongroup", + "plural": "definitiongroups", "attributes": { "format": { - "description": "Message format identifier. All definitions in this group share this format. Mixed-format groups are not permitted.", + "description": "Format identifier that defines the common metadata information for the message. All definitions in this group share this format. Mixed-format groups are not permitted.", "type": "string", - "required": true + "required": false + }, + "binding": { + "description": "Binding identifier that defines the transport message binding. All definitions in this group share this binding type. Mixed-binding groups are not permitted.", + "type": "string", + "required": false } }, "resources": { @@ -19,365 +24,530 @@ "plural": "definitions", "versions": 1, "attributes": { + "baseDefinitionUrl": { + "description": "Reference to a base definition for this definition, either via a (relative) URL or a fragment identifier. The base definition is overridden by this definition. If not present, this definition does not override any base definition.", + "type": "uri", + "required": false + }, "format": { "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "type": "string", - "required": true, - "ifValue": { - "AMQP/1.0": { - "siblingAttributes": { + "required": false, + "ifvalue": { + "None" : { + }, + "CloudEvents/1.0": { + "siblingattributes": { "metadata": { - "description": "AMQP message metadata constraints.", + "description": "CloudEvents metadata constraints.", "type": "object", "required": false, - "attributes": { - "properties": { - "type": "object", - "required": false, - "attributes": { - "message-id": { - "description": "AMQP message-id.", - "type": "object", - "required": false, + "item": { + "attributes": { + "type": { + "description": "CloudEvents type.", + "type": "object", + "required": false, + "item": { "attributes": { "value": { - "description": "AMQP message-id value template.", + "description": "CloudEvents type value template.", "type": "string", "required": false - }, - "required": { - "description": "AMQP message-id required.", - "type": "boolean", - "required": false } } - }, - "user-id": { - "description": "AMQP user-id.", - "type": "object", - "required": false, + } + }, + "source": { + "description": "CloudEvents source", + "type": "object", + "required": false, + "item": { "attributes": { "value": { - "description": "AMQP user-id value template.", + "description": "CloudEvents source value template.", "type": "string", "required": false - }, - "required": { - "description": "AMQP user-id required.", - "type": "boolean", - "required": false } } - }, - "to": { - "description": "AMQP to.", - "type": "object", - "required": false, + } + }, + "subject": { + "description": "CloudEvents subject", + "type": "object", + "required": false, + "item": { "attributes": { "value": { - "description": "AMQP to value template.", + "description": "CloudEvents subject value template.", "type": "string", "required": false }, "required": { - "description": "AMQP to required.", + "description": "CloudEvents subject required.", "type": "boolean", "required": false } } - }, - "subject": { - "description": "AMQP subject.", - "type": "object", - "required": false, + } + }, + "id": { + "description": "CloudEvents id", + "type": "object", + "required": false, + "item": { "attributes": { "value": { - "description": "AMQP subject value template.", + "description": "CloudEvents id value template.", "type": "string", "required": false - }, - "required": { - "description": "AMQP subject required.", - "type": "boolean", - "required": false } } - }, - "reply-to": { - "description": "AMQP reply-to.", - "type": "object", - "required": false, + } + }, + "time": { + "description": "The timestamp of when the event happened.", + "type": "object", + "required": false, + "item": { "attributes": { "value": { - "description": "AMQP reply-to value template.", + "description": "The timestamp value template.", "type": "string", "required": false }, "required": { - "description": "AMQP reply-to required.", + "description": "The timestamp required.", "type": "boolean", "required": false } } - }, - "correlation-id": { - "description": "AMQP correlation-id.", - "type": "object", - "required": false, + } + }, + "dataschema": { + "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default.", + "type": "object", + "required": false, + "item": { "attributes": { "value": { - "description": "AMQP correlation-id value template.", - "type": "string", + "description": "The uri value template.", + "type": "uritemplate", "required": false }, "required": { - "description": "AMQP correlation-id required.", + "description": "The uri required.", "type": "boolean", "required": false } } - }, - "content-type": { - "description": "AMQP content-type.", - "type": "object", - "required": false, + } + }, + "*": { + "description": "CloudEvent extension property", + "type": "object", + "required": false, + "item": { "attributes": { "value": { - "description": "AMQP content-type value template.", + "description": "The value template.", "type": "string", "required": false }, "required": { - "description": "AMQP content-type required.", + "description": "Whether the extension is required", "type": "boolean", "required": false } } - }, - "content-encoding": { - "description": "AMQP content-encoding.", - "type": "object", - "required": false, + } + } + } + } + } + } + } + } + }, + "binding": { + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "type": "string", + "required": false, + "ifvalue": { + "None" : { + }, + "AMQP/1.0": { + "siblingattributes": { + "message": { + "description": "AMQP message metadata constraints.", + "type": "object", + "required": false, + "item": { + "attributes": { + "properties": { + "type": "object", + "required": false, + "item": { "attributes": { - "value": { - "description": "AMQP content-encoding value template.", - "type": "string", - "required": false + "message_id": { + "description": "AMQP message-id.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP message-id value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP message-id required.", + "type": "boolean", + "required": false + } + } + } }, - "required": { - "description": "AMQP content-encoding required.", - "type": "boolean", - "required": false + "user_id": { + "description": "AMQP user-id.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP user-id value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP user-id required.", + "type": "boolean", + "required": false + } + } + } + }, + "to": { + "description": "AMQP to.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP to value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP to required.", + "type": "boolean", + "required": false + } + } + } + }, + "subject": { + "description": "AMQP subject.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP subject value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP subject required.", + "type": "boolean", + "required": false + } + } + } + }, + "reply_to": { + "description": "AMQP reply-to.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP reply-to value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP reply-to required.", + "type": "boolean", + "required": false + } + } + } + }, + "correlation_id": { + "description": "AMQP correlation-id.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP correlation-id value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP correlation-id required.", + "type": "boolean", + "required": false + } + } + } + }, + "content_type": { + "description": "AMQP content-type.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP content-type value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP content-type required.", + "type": "boolean", + "required": false + } + } + } + }, + "content_encoding": { + "description": "AMQP content-encoding.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP content-encoding value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP content-encoding required.", + "type": "boolean", + "required": false + } + } + } + }, + "absolute_expiry_time": { + "description": "AMQP absolute-expiry-time.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP absolute-expiry-time value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP absolute-expiry-time required.", + "type": "boolean", + "required": false + } + } + } + }, + "group_id": { + "description": "AMQP group-id.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP group-id value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP group-id required.", + "type": "boolean", + "required": false + } + } + } + }, + "group_sequence": { + "description": "AMQP group-sequence.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP group-sequence value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP group-sequence required.", + "type": "boolean", + "required": false + } + } + } + }, + "reply_to_group_id": { + "description": "AMQP reply-to-group-id.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "AMQP reply-to-group-id value template.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP reply-to-group-id required.", + "type": "boolean", + "required": false + } + } + } } } - }, - "absolute-expiry-time": { - "description": "AMQP absolute-expiry-time.", + } + }, + "application_properties": { + "type": "map", + "required": false, + "item": { "type": "object", - "required": false, - "attributes": { - "value": { - "description": "AMQP absolute-expiry-time value template.", - "type": "string", - "required": false - }, - "required": { - "description": "AMQP absolute-expiry-time required.", - "type": "boolean", - "required": false + "item": { + "attributes": { + "value": { + "description": "The application property value template.", + "type": "string", + "required": false + }, + "required": { + "description": "The application property required.", + "type": "boolean", + "required": false + }, + "type": { + "description": "The application property type.", + "type": "string", + "required": false + } } } - }, - "group-id": { - "description": "AMQP group-id.", + } + }, + "message_annotations": { + "type": "map", + "required": false, + "item": { "type": "object", - "required": false, - "attributes": { - "value": { - "description": "AMQP group-id value template.", - "type": "string", - "required": false - }, - "required": { - "description": "AMQP group-id required.", - "type": "boolean", - "required": false + "item": { + "attributes": { + "value": { + "description": "The message annotation value", + "type": "string", + "required": false + }, + "required": { + "description": "Whether the message annotation is required", + "type": "boolean", + "required": false + }, + "type": { + "description": "The message annotation type.", + "type": "string", + "required": false + } } } - }, - "group-sequence": { - "description": "AMQP group-sequence.", + } + }, + "delivery_annotations": { + "type": "map", + "required": false, + "item": { "type": "object", - "required": false, - "attributes": { - "value": { - "description": "AMQP group-sequence value template.", - "type": "string", - "required": false - }, - "required": { - "description": "AMQP group-sequence required.", - "type": "boolean", - "required": false + "item": { + "attributes": { + "value": { + "description": "The delivery annotation value", + "type": "string", + "required": false + }, + "required": { + "description": "Whether the annotation is required", + "type": "boolean", + "required": false + }, + "type": { + "description": "The annotation type.", + "type": "string", + "required": false + } } } - }, - "reply-to-group-id": { - "description": "AMQP reply-to-group-id.", + } + }, + "header": { + "type": "map", + "required": false, + "item": { "type": "object", - "required": false, - "attributes": { - "value": { - "description": "AMQP reply-to-group-id value template.", - "type": "string", - "required": false - }, - "required": { - "description": "AMQP reply-to-group-id required.", - "type": "boolean", - "required": false + "item": { + "attributes": { + "value": { + "description": "AMQP header value.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP header required.", + "type": "boolean", + "required": false + }, + "type": { + "description": "AMQP header type.", + "type": "string", + "required": false + } } } } - } - }, - "application-properties": { - "type": "map", - "required": false, - "itemType": "object", - "keyType": "string", - "attributes": { - "name": { - "description": "The application property name.", - "type": "string", - "required": false - }, - "value": { - "description": "The application property value template.", - "type": "string", - "required": false - }, - "required": { - "description": "The application property required.", - "type": "boolean", - "required": false - }, - "type": { - "description": "The application property type.", - "type": "string", - "required": false - } - } - }, - "message-annotations": { - "type": "map", - "required": false, - "itemType": "object", - "keyType": "string", - "attributes": { - "name": { - "description": "The message annotation name.", - "type": "string", - "required": true - }, - "value": { - "description": "The message annotation value", - "type": "string", - "required": false - }, - "required": { - "description": "Whether the message annotation is required", - "type": "boolean", - "required": false - }, - "type": { - "description": "The message annotation type.", - "type": "string", - "required": false - } - } - }, - "delivery-annotations": { - "type": "map", - "required": false, - "itemType": "object", - "keyType": "string", - "attributes": { - "name": { - "description": "The delivery annotation name.", - "type": "string", - "required": true - }, - "value": { - "description": "The delivery annotation value", - "type": "string", - "required": false - }, - "required": { - "description": "Whether the annotation is required", - "type": "boolean", - "required": false - }, - "type": { - "description": "The annotation type.", - "type": "string", - "required": false - } - } - }, - "header": { - "type": "map", - "required": false, - "itemType": "object", - "keyType": "string", - "attributes": { - "name": { - "description": "AMQP header name.", - "type": "string", - "required": true - }, - "value": { - "description": "AMQP header value.", - "type": "string", - "required": false - }, - "required": { - "description": "AMQP header required.", - "type": "boolean", - "required": false - }, - "type": { - "description": "AMQP header type.", - "type": "string", - "required": false - } - } - }, - "footer": { - "type": "map", - "required": false, - "itemType": "object", - "keyType": "string", - "attributes": { - "name": { - "description": "AMQP footer name.", - "type": "string", - "required": true - }, - "value": { - "description": "AMQP footer value.", - "type": "string", - "required": false - }, - "required": { - "description": "AMQP footer required.", - "type": "boolean", - "required": false - }, - "type": { - "description": "AMQP footer type.", - "type": "string", - "required": false + }, + "footer": { + "type": "map", + "required": false, + "item": { + "type": "object", + "item": { + "attributes": { + "value": { + "description": "AMQP footer value.", + "type": "string", + "required": false + }, + "required": { + "description": "AMQP footer required.", + "type": "boolean", + "required": false + }, + "type": { + "description": "AMQP footer type.", + "type": "string", + "required": false + } + } + } } } } @@ -386,45 +556,53 @@ } }, "MQTT/3.1.1": { - "siblingAttributes": { - "metadata": { + "siblingattributes": { + "message": { "description": "MQTT message metadata constraints.", "type": "object", "required": false, - "attributes": { - "qos": { - "description": "MQTT qos.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT qos value template.", - "type": "string", - "required": false + "item": { + "attributes": { + "qos": { + "description": "MQTT qos.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT qos value template.", + "type": "string", + "required": false + } + } } - } - }, - "retain": { - "description": "MQTT retain.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT retain value template.", - "type": "boolean", - "required": false + }, + "retain": { + "description": "MQTT retain.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT retain value template.", + "type": "boolean", + "required": false + } + } } - } - }, - "topic-name": { - "description": "MQTT topic-name.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT topic-name value template.", - "type": "string", - "required": false + }, + "topic_name": { + "description": "MQTT topic-name.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT topic-name value template.", + "type": "string", + "required": false + } + } } } } @@ -433,111 +611,131 @@ } }, "MQTT/5.0": { - "siblingAttributes": { - "metadata": { + "siblingattributes": { + "message": { "description": "MQTT message metadata constraints.", "type": "object", "required": false, - "attributes": { - "qos": { - "description": "MQTT qos.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT qos value template.", - "type": "integer", - "required": false + "item": { + "attributes": { + "qos": { + "description": "MQTT qos.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT qos value template.", + "type": "integer", + "required": false + } + } } - } - }, - "retain": { - "description": "MQTT retain.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT retain value template.", - "type": "boolean", - "required": false + }, + "retain": { + "description": "MQTT retain.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT retain value template.", + "type": "boolean", + "required": false + } + } } - } - }, - "topic-name": { - "description": "MQTT topic-name.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT topic-name value template.", - "type": "string", - "required": false + }, + "topic_name": { + "description": "MQTT topic-name.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT topic-name value template.", + "type": "string", + "required": false + } + } } - } - }, - "message-expiry-interval": { - "description": "MQTT message-expiry-interval.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT message-expiry-interval value template.", - "type": "integer", - "required": false + }, + "message_expiry_interval": { + "description": "MQTT message-expiry-interval.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT message-expiry-interval value template.", + "type": "integer", + "required": false + } + } } - } - }, - "response-topic": { - "description": "MQTT response-topic.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT response-topic value template.", - "type": "string", - "required": false + }, + "response_topic": { + "description": "MQTT response-topic.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT response-topic value template.", + "type": "string", + "required": false + } + } } - } - }, - "correlation-data": { - "description": "MQTT correlation-data.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT correlation-data value template.", - "type": "binary", - "required": false + }, + "correlation_data": { + "description": "MQTT correlation-data.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT correlation-data value template.", + "type": "binary", + "required": false + } + } } - } - }, - "content-type": { - "description": "MQTT content-type.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "MQTT content-type value template.", - "type": "string", - "required": false + }, + "content_type": { + "description": "MQTT content-type.", + "type": "object", + "required": false, + "item": { + "attributes": { + "value": { + "description": "MQTT content-type value template.", + "type": "string", + "required": false + } + } } - } - }, - "user-properties": { - "description": "MQTT user-properties.", - "type": "array", - "required": false, - "itemType": "object", - "attributes": { - "name": { - "description": "MQTT user-property name.", - "type": "string", - "required": false - }, - "value": { - "description": "MQTT user-property value.", - "type": "string", - "required": false + }, + "user_properties": { + "description": "MQTT user-properties.", + "type": "array", + "required": false, + "item": { + "type": "object", + "item": { + "attributes": { + "name": { + "description": "MQTT user-property name.", + "type": "string", + "required": false + }, + "value": { + "description": "MQTT user-property value.", + "type": "string", + "required": false + } + } + } } } } @@ -545,210 +743,106 @@ } } }, - "KAFKA/0.11": { - "siblingAttributes": { - "metadata": { + "KAFKA": { + "siblingattributes": { + "message": { "description": "The Apache Kafka message metadata constraints.", "type": "object", "required": false, - "attributes": { - "topic": { - "description": "The Apache Kafka topic.", - "type": "string", - "required": false - }, - "partition": { - "description": "The Apache Kafka partition.", - "type": "integer", - "required": false - }, - "key": { - "description": "The Apache Kafka key.", - "type": "binary", - "required": false - }, - "headers": { - "description": "The Apache Kafka headers.", - "type": "map", - "required": false, - "itemType": "object", - "keyType": "string", - "attributes": { - "name": { - "description": "The Apache Kafka header name.", - "type": "string", - "required": false - }, - "value": { - "description": "The Apache Kafka header value.", - "type": "string", - "required": false - } - } - }, - "timestamp": { - "description": "The Apache Kafka timestamp.", - "type": "integer", - "required": false - } - } - } - } - }, - "CloudEvents/1.0": { - "siblingAttributes": { - "metadata": { - "description": "CloudEvents metadata constraints.", - "type": "object", - "required": false, - "attributes": { - "type": { - "description": "CloudEvents type.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "CloudEvents type value template.", - "type": "string", - "required": false - } - } - }, - "source": { - "description": "CloudEvents source", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "CloudEvents source value template.", - "type": "string", - "required": false - } - } - }, - "subject": { - "description": "CloudEvents subject", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "CloudEvents subject value template.", - "type": "string", - "required": false - }, - "required": { - "description": "CloudEvents subject required.", - "type": "boolean", - "required": false - } - } - }, - "id": { - "description": "CloudEvents id", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "CloudEvents id value template.", - "type": "string", - "required": false - } - } - }, - "time": { - "description": "The timestamp of when the event happened.", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "The timestamp value template.", - "type": "string", - "required": false - }, - "required": { - "description": "The timestamp required.", - "type": "boolean", - "required": false - } - } - }, - "dataschema": { - "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default.", - "type": "uritemplate", - "required": false, - "attributes": { - "value": { - "description": "The uri value template.", - "type": "string", - "required": false - }, - "required": { - "description": "The uri required.", - "type": "boolean", - "required": false - } - } - }, - "*": { - "description": "CloudEvent extension property", - "type": "object", - "required": false, - "attributes": { - "value": { - "description": "The value template.", - "type": "string", - "required": false - }, - "required": { - "description": "Whether the extension is required", - "type": "boolean", - "required": false + "item": { + "attributes": { + "topic": { + "description": "The Apache Kafka topic.", + "type": "string", + "required": false + }, + "partition": { + "description": "The Apache Kafka partition.", + "type": "integer", + "required": false + }, + "key": { + "description": "The Apache Kafka key.", + "type": "binary", + "required": false + }, + "headers": { + "description": "The Apache Kafka headers.", + "type": "map", + "required": false, + "item": { + "type": "object", + "item": { + "attributes": { + "name": { + "description": "The Apache Kafka header name.", + "type": "string", + "required": false + }, + "value": { + "description": "The Apache Kafka header value.", + "type": "string", + "required": false + } + } + } } + }, + "timestamp": { + "description": "The Apache Kafka timestamp.", + "type": "integer", + "required": false } } } } } }, - "HTTP/1.1": { - "siblingAttributes": { - "metadata": { + "HTTP": { + "siblingattributes": { + "message": { "description": "The HTTP message metadata constraints.", "type": "object", "required": false, - "attributes": { - "headers": { - "description": "The HTTP headers.", - "type": "array", - "required": false, - "itemType": "object", - "attributes": { - "name": { - "description": "The HTTP header name.", - "type": "string", - "required": false - }, - "value": { - "description": "The HTTP header value.", - "type": "string", - "required": false + "item": { + "attributes": { + "headers": { + "description": "The HTTP headers.", + "type": "array", + "required": false, + "item": { + "type": "object", + "item": { + "attributes": { + "name": { + "description": "The HTTP header name.", + "type": "string", + "required": false + }, + "value": { + "description": "The HTTP header value.", + "type": "string", + "required": false + } + } + } } + }, + "query": { + "description": "The HTTP query parameters.", + "type": "object", + "required": false + }, + "path": { + "description": "The HTTP path as a uri template.", + "type": "string", + "required": false + }, + "method": { + "description": "The HTTP method.", + "type": "string", + "required": false } - }, - "query": { - "description": "The HTTP query parameters.", - "type": "object", - "required": false - }, - "path": { - "description": "The HTTP path as a uri template.", - "type": "string", - "required": false - }, - "method": { - "description": "The HTTP method.", - "type": "string", - "required": false } } } diff --git a/message/schemas/document-schema.avsc b/message/schemas/document-schema.avsc index 71a3fe5..80a1f7f 100644 --- a/message/schemas/document-schema.avsc +++ b/message/schemas/document-schema.avsc @@ -4,51 +4,51 @@ "namespace": "io.xregistry", "fields": [ { - "name": "definitionGroups", + "name": "definitiongroups", "type": { "type": "map", "values": { "type": "record", - "name": "DefinitionGroupType", + "name": "DefinitiongroupType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -58,14 +58,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -75,14 +75,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -93,8 +93,13 @@ }, { "type": "string", - "name": "Format", - "doc": "Message format identifier. All definitions in this group share this format. Mixed-format groups are not permitted." + "name": "format", + "doc": "Format identifier that defines the common metadata information for the message. All definitions in this group share this format. Mixed-format groups are not permitted." + }, + { + "type": "string", + "name": "binding", + "doc": "Binding identifier that defines the transport message binding. All definitions in this group share this binding type. Mixed-binding groups are not permitted." }, { "name": "definitions", @@ -105,43 +110,43 @@ "name": "DefinitionType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -151,14 +156,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -168,14 +173,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -185,864 +190,877 @@ ] }, { - "name": "Format", + "type": "string", + "name": "baseDefinitionUrl", + "doc": "Reference to a base definition for this definition, either via a (relative) URL or a fragment identifier. The base definition is overridden by this definition. If not present, this definition does not override any base definition." + }, + { + "name": "format", + "type": [ + { + "type": "record", + "name": "FormatNoneType", + "fields": [] + }, + { + "type": "record", + "name": "FormatCloudevents10Type", + "fields": [ + { + "type": { + "type": "record", + "name": "FormatCloudevents10MetadataType", + "fields": [ + { + "type": { + "type": "record", + "name": "FormatCloudevents10TypeType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents type value template." + } + ] + }, + "name": "type", + "doc": "CloudEvents type." + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10SourceType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents source value template." + } + ] + }, + "name": "source", + "doc": "CloudEvents source" + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10SubjectType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents subject value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "CloudEvents subject required." + } + ] + }, + "name": "subject", + "doc": "CloudEvents subject" + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10IdType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "CloudEvents id value template." + } + ] + }, + "name": "id", + "doc": "CloudEvents id" + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10TimeType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "The timestamp value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "The timestamp required." + } + ] + }, + "name": "time", + "doc": "The timestamp of when the event happened." + }, + { + "type": { + "type": "record", + "name": "FormatCloudevents10DataschemaType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "The uri value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "The uri required." + } + ] + }, + "name": "dataschema", + "doc": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." + }, + { + "name": "Extensions", + "type": { + "type": "map", + "name": "FormatCloudevents10ExtensionsType", + "default": {}, + "values": { + "type": "record", + "name": "FormatCloudevents10ExtensionItemType", + "fields": [ + { + "type": "string", + "name": "value", + "doc": "The value template." + }, + { + "type": "boolean", + "name": "required", + "doc": "Whether the extension is required" + } + ] + } + }, + "doc": "CloudEvent extension property" + } + ] + }, + "name": "metadata", + "doc": "CloudEvents metadata constraints." + } + ] + } + ], + "doc": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups." + }, + { + "name": "binding", "type": [ { "type": "record", - "name": "FormatAmqp10Type", + "name": "BindingNoneType", + "fields": [] + }, + { + "type": "record", + "name": "BindingAmqp10Type", "fields": [ { "type": { "type": "record", - "name": "FormatAmqp10MetadataType", + "name": "BindingAmqp10MessageType", "fields": [ { "type": { "type": "record", - "name": "FormatAmqp10PropertiesType", + "name": "BindingAmqp10PropertiesType", "fields": [ { "type": { "type": "record", - "name": "FormatAmqp10MessageIdType", + "name": "BindingAmqp10MessageIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP message-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP message-id required." } ] }, - "name": "MessageId", + "name": "messageId", "doc": "AMQP message-id." }, { "type": { "type": "record", - "name": "FormatAmqp10UserIdType", + "name": "BindingAmqp10UserIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP user-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP user-id required." } ] }, - "name": "UserId", + "name": "userId", "doc": "AMQP user-id." }, { "type": { "type": "record", - "name": "FormatAmqp10ToType", + "name": "BindingAmqp10ToType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP to value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP to required." } ] }, - "name": "To", + "name": "to", "doc": "AMQP to." }, { "type": { "type": "record", - "name": "FormatAmqp10SubjectType", + "name": "BindingAmqp10SubjectType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP subject value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP subject required." } ] }, - "name": "Subject", + "name": "subject", "doc": "AMQP subject." }, { "type": { "type": "record", - "name": "FormatAmqp10ReplyToType", + "name": "BindingAmqp10ReplyToType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP reply-to value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP reply-to required." } ] }, - "name": "ReplyTo", + "name": "replyTo", "doc": "AMQP reply-to." }, { "type": { "type": "record", - "name": "FormatAmqp10CorrelationIdType", + "name": "BindingAmqp10CorrelationIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP correlation-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP correlation-id required." } ] }, - "name": "CorrelationId", + "name": "correlationId", "doc": "AMQP correlation-id." }, { "type": { "type": "record", - "name": "FormatAmqp10ContentTypeType", + "name": "BindingAmqp10ContentTypeType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP content-type value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP content-type required." } ] }, - "name": "ContentType", + "name": "contentType", "doc": "AMQP content-type." }, { "type": { "type": "record", - "name": "FormatAmqp10ContentEncodingType", + "name": "BindingAmqp10ContentEncodingType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP content-encoding value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP content-encoding required." } ] }, - "name": "ContentEncoding", + "name": "contentEncoding", "doc": "AMQP content-encoding." }, { "type": { "type": "record", - "name": "FormatAmqp10AbsoluteExpiryTimeType", + "name": "BindingAmqp10AbsoluteExpiryTimeType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP absolute-expiry-time value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP absolute-expiry-time required." } ] }, - "name": "AbsoluteExpiryTime", + "name": "absoluteExpiryTime", "doc": "AMQP absolute-expiry-time." }, { "type": { "type": "record", - "name": "FormatAmqp10GroupIdType", + "name": "BindingAmqp10GroupIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP group-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP group-id required." } ] }, - "name": "GroupId", + "name": "groupId", "doc": "AMQP group-id." }, { "type": { "type": "record", - "name": "FormatAmqp10GroupSequenceType", + "name": "BindingAmqp10GroupSequenceType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP group-sequence value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP group-sequence required." } ] }, - "name": "GroupSequence", + "name": "groupSequence", "doc": "AMQP group-sequence." }, { "type": { "type": "record", - "name": "FormatAmqp10ReplyToGroupIdType", + "name": "BindingAmqp10ReplyToGroupIdType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP reply-to-group-id value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP reply-to-group-id required." } ] }, - "name": "ReplyToGroupId", + "name": "replyToGroupId", "doc": "AMQP reply-to-group-id." } ] }, - "name": "Properties" + "name": "properties" }, { "type": { "type": "map", - "name": "FormatAmqp10ApplicationPropertiesType", + "name": "BindingAmqp10ApplicationPropertiesType", "values": { "type": "record", - "name": "FormatAmqp10ApplicationPropertiesItemType", + "name": "BindingAmqp10ApplicationPropertiesItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "The application property name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "The application property value template." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "The application property required." }, { "type": "string", - "name": "Type", + "name": "type", "doc": "The application property type." } ] } }, - "name": "ApplicationProperties" + "name": "applicationProperties" }, { "type": { "type": "map", - "name": "FormatAmqp10MessageAnnotationsType", + "name": "BindingAmqp10MessageAnnotationsType", "values": { "type": "record", - "name": "FormatAmqp10MessageAnnotationsItemType", + "name": "BindingAmqp10MessageAnnotationsItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "The message annotation name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "The message annotation value" }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "Whether the message annotation is required" }, { "type": "string", - "name": "Type", + "name": "type", "doc": "The message annotation type." } ] } }, - "name": "MessageAnnotations" + "name": "messageAnnotations" }, { "type": { "type": "map", - "name": "FormatAmqp10DeliveryAnnotationsType", + "name": "BindingAmqp10DeliveryAnnotationsType", "values": { "type": "record", - "name": "FormatAmqp10DeliveryAnnotationsItemType", + "name": "BindingAmqp10DeliveryAnnotationsItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "The delivery annotation name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "The delivery annotation value" }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "Whether the annotation is required" }, { "type": "string", - "name": "Type", + "name": "type", "doc": "The annotation type." } ] } }, - "name": "DeliveryAnnotations" + "name": "deliveryAnnotations" }, { "type": { "type": "map", - "name": "FormatAmqp10HeaderType", + "name": "BindingAmqp10HeaderType", "values": { "type": "record", - "name": "FormatAmqp10HeaderItemType", + "name": "BindingAmqp10HeaderItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "AMQP header name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP header value." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP header required." }, { "type": "string", - "name": "Type", + "name": "type", "doc": "AMQP header type." } ] } }, - "name": "Header" + "name": "header" }, { "type": { "type": "map", - "name": "FormatAmqp10FooterType", + "name": "BindingAmqp10FooterType", "values": { "type": "record", - "name": "FormatAmqp10FooterItemType", + "name": "BindingAmqp10FooterItemType", "fields": [ { "type": "string", - "name": "Name", - "doc": "AMQP footer name." - }, - { - "type": "string", - "name": "Value", + "name": "value", "doc": "AMQP footer value." }, { "type": "boolean", - "name": "Required", + "name": "required", "doc": "AMQP footer required." }, { "type": "string", - "name": "Type", + "name": "type", "doc": "AMQP footer type." } ] } }, - "name": "Footer" + "name": "footer" } ] }, - "name": "Metadata", + "name": "message", "doc": "AMQP message metadata constraints." } ] }, { "type": "record", - "name": "FormatMqtt311Type", + "name": "BindingMqtt311Type", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt311MetadataType", + "name": "BindingMqtt311MessageType", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt311QosType", + "name": "BindingMqtt311QosType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT qos value template." } ] }, - "name": "Qos", + "name": "qos", "doc": "MQTT qos." }, { "type": { "type": "record", - "name": "FormatMqtt311RetainType", + "name": "BindingMqtt311RetainType", "fields": [ { "type": "boolean", - "name": "Value", + "name": "value", "doc": "MQTT retain value template." } ] }, - "name": "Retain", + "name": "retain", "doc": "MQTT retain." }, { "type": { "type": "record", - "name": "FormatMqtt311TopicNameType", + "name": "BindingMqtt311TopicNameType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT topic-name value template." } ] }, - "name": "TopicName", + "name": "topicName", "doc": "MQTT topic-name." } ] }, - "name": "Metadata", + "name": "message", "doc": "MQTT message metadata constraints." } ] }, { "type": "record", - "name": "FormatMqtt50Type", + "name": "BindingMqtt50Type", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt50MetadataType", + "name": "BindingMqtt50MessageType", "fields": [ { "type": { "type": "record", - "name": "FormatMqtt50QosType", + "name": "BindingMqtt50QosType", "fields": [ { "type": "int", - "name": "Value", + "name": "value", "doc": "MQTT qos value template." } ] }, - "name": "Qos", + "name": "qos", "doc": "MQTT qos." }, { "type": { "type": "record", - "name": "FormatMqtt50RetainType", + "name": "BindingMqtt50RetainType", "fields": [ { "type": "boolean", - "name": "Value", + "name": "value", "doc": "MQTT retain value template." } ] }, - "name": "Retain", + "name": "retain", "doc": "MQTT retain." }, { "type": { "type": "record", - "name": "FormatMqtt50TopicNameType", + "name": "BindingMqtt50TopicNameType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT topic-name value template." } ] }, - "name": "TopicName", + "name": "topicName", "doc": "MQTT topic-name." }, { "type": { "type": "record", - "name": "FormatMqtt50MessageExpiryIntervalType", + "name": "BindingMqtt50MessageExpiryIntervalType", "fields": [ { "type": "int", - "name": "Value", + "name": "value", "doc": "MQTT message-expiry-interval value template." } ] }, - "name": "MessageExpiryInterval", + "name": "messageExpiryInterval", "doc": "MQTT message-expiry-interval." }, { "type": { "type": "record", - "name": "FormatMqtt50ResponseTopicType", + "name": "BindingMqtt50ResponseTopicType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT response-topic value template." } ] }, - "name": "ResponseTopic", + "name": "responseTopic", "doc": "MQTT response-topic." }, { "type": { "type": "record", - "name": "FormatMqtt50CorrelationDataType", + "name": "BindingMqtt50CorrelationDataType", "fields": [ { "type": "bytes", - "name": "Value", + "name": "value", "doc": "MQTT correlation-data value template." } ] }, - "name": "CorrelationData", + "name": "correlationData", "doc": "MQTT correlation-data." }, { "type": { "type": "record", - "name": "FormatMqtt50ContentTypeType", + "name": "BindingMqtt50ContentTypeType", "fields": [ { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT content-type value template." } ] }, - "name": "ContentType", + "name": "contentType", "doc": "MQTT content-type." }, { "type": { "type": "array", + "name": "BindingMqtt50UserPropertiesArrayType", "items": { "type": "record", - "name": "FormatMqtt50UserPropertiesType", + "name": "BindingMqtt50UserPropertiesType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "MQTT user-property name." }, { "type": "string", - "name": "Value", + "name": "value", "doc": "MQTT user-property value." } ] } }, - "name": "UserProperties", + "name": "userProperties", "doc": "MQTT user-properties." } ] }, - "name": "Metadata", + "name": "message", "doc": "MQTT message metadata constraints." } ] }, { "type": "record", - "name": "FormatKafka011Type", + "name": "BindingKAFKAType", "fields": [ { "type": { "type": "record", - "name": "FormatKafka011MetadataType", + "name": "BindingKAFKAMessageType", "fields": [ { "type": "string", - "name": "Topic", + "name": "topic", "doc": "The Apache Kafka topic." }, { "type": "int", - "name": "Partition", + "name": "partition", "doc": "The Apache Kafka partition." }, { "type": "bytes", - "name": "Key", + "name": "key", "doc": "The Apache Kafka key." }, { "type": { "type": "map", - "name": "FormatKafka011HeadersType", + "name": "BindingKAFKAHeadersType", "values": { "type": "record", - "name": "FormatKafka011HeadersItemType", + "name": "BindingKAFKAHeadersItemType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The Apache Kafka header name." }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The Apache Kafka header value." } ] } }, - "name": "Headers", + "name": "headers", "doc": "The Apache Kafka headers." }, { "type": "int", - "name": "Timestamp", + "name": "timestamp", "doc": "The Apache Kafka timestamp." } ] }, - "name": "Metadata", + "name": "message", "doc": "The Apache Kafka message metadata constraints." } ] }, { "type": "record", - "name": "FormatCloudevents10Type", - "fields": [ - { - "type": { - "type": "record", - "name": "FormatCloudevents10MetadataType", - "fields": [ - { - "type": { - "type": "record", - "name": "FormatCloudevents10TypeType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents type value template." - } - ] - }, - "name": "Type", - "doc": "CloudEvents type." - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10SourceType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents source value template." - } - ] - }, - "name": "Source", - "doc": "CloudEvents source" - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10SubjectType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents subject value template." - }, - { - "type": "boolean", - "name": "Required", - "doc": "CloudEvents subject required." - } - ] - }, - "name": "Subject", - "doc": "CloudEvents subject" - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10IdType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "CloudEvents id value template." - } - ] - }, - "name": "Id", - "doc": "CloudEvents id" - }, - { - "type": { - "type": "record", - "name": "FormatCloudevents10TimeType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "The timestamp value template." - }, - { - "type": "boolean", - "name": "Required", - "doc": "The timestamp required." - } - ] - }, - "name": "Time", - "doc": "The timestamp of when the event happened." - }, - { - "type": "string", - "name": "Dataschema", - "doc": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." - }, - { - "name": "Extensions", - "type": { - "type": "map", - "name": "FormatCloudevents10ExtensionsType", - "default": {}, - "values": { - "type": "record", - "name": "FormatCloudevents10ExtensionItemType", - "fields": [ - { - "type": "string", - "name": "Value", - "doc": "The value template." - }, - { - "type": "boolean", - "name": "Required", - "doc": "Whether the extension is required" - } - ] - } - }, - "doc": "CloudEvent extension property" - } - ] - }, - "name": "Metadata", - "doc": "CloudEvents metadata constraints." - } - ] - }, - { - "type": "record", - "name": "FormatHttp11Type", + "name": "BindingHTTPType", "fields": [ { "type": { "type": "record", - "name": "FormatHttp11MetadataType", + "name": "BindingHTTPMessageType", "fields": [ { "type": { "type": "array", + "name": "BindingHTTPHeadersArrayType", "items": { "type": "record", - "name": "FormatHttp11HeadersType", + "name": "BindingHTTPHeadersType", "fields": [ { "type": "string", - "name": "Name", + "name": "name", "doc": "The HTTP header name." }, { "type": "string", - "name": "Value", + "name": "value", "doc": "The HTTP header value." } ] } }, - "name": "Headers", + "name": "headers", "doc": "The HTTP headers." }, { @@ -1083,28 +1101,28 @@ } ] }, - "name": "Query", + "name": "query", "doc": "The HTTP query parameters." }, { "type": "string", - "name": "Path", + "name": "path", "doc": "The HTTP path as a uri template." }, { "type": "string", - "name": "Method", + "name": "method", "doc": "The HTTP method." } ] }, - "name": "Metadata", + "name": "message", "doc": "The HTTP message metadata constraints." } ] } ], - "doc": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups." + "doc": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups." } ] } diff --git a/message/schemas/document-schema.json b/message/schemas/document-schema.json index 93b7744..e7979df 100644 --- a/message/schemas/document-schema.json +++ b/message/schemas/document-schema.json @@ -2,10 +2,10 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://xregistry.io/schema/definitiongroups", "properties": { - "definitionGroups": { + "definitiongroups": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/definitionGroup" + "$ref": "#/definitions/definitiongroup" } } }, @@ -36,703 +36,726 @@ "labels": { "type": "object" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" + }, + "baseDefinitionUrl": { + "type": "string", + "format": "uri", + "description": "Reference to a base definition for this definition, either via a (relative) URL or a fragment identifier. The base definition is overridden by this definition. If not present, this definition does not override any base definition." } }, "required": [ "id" ], - "oneOf": [ + "allOf": [ { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "AMQP/1.0" - ] + "oneOf": [ + { + "properties": { + "format": { + "type": "string", + "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "None" + ], + "default": "None" + } + } }, - "metadata": { - "type": "object", - "description": "AMQP message metadata constraints.", + { "properties": { - "properties": { + "format": { + "type": "string", + "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "CloudEvents/1.0" + ] + }, + "metadata": { "type": "object", + "description": "CloudEvents metadata constraints.", "properties": { - "message-id": { + "type": { "type": "object", - "description": "AMQP message-id.", + "description": "CloudEvents type.", "properties": { "value": { "type": "string", - "description": "AMQP message-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP message-id required." + "description": "CloudEvents type value template." } } }, - "user-id": { + "source": { "type": "object", - "description": "AMQP user-id.", + "description": "CloudEvents source", "properties": { "value": { "type": "string", - "description": "AMQP user-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP user-id required." + "description": "CloudEvents source value template." } } }, - "to": { + "subject": { "type": "object", - "description": "AMQP to.", + "description": "CloudEvents subject", "properties": { "value": { "type": "string", - "description": "AMQP to value template." + "description": "CloudEvents subject value template." }, "required": { "type": "boolean", - "description": "AMQP to required." + "description": "CloudEvents subject required." } } }, - "subject": { + "id": { "type": "object", - "description": "AMQP subject.", + "description": "CloudEvents id", "properties": { "value": { "type": "string", - "description": "AMQP subject value template." - }, - "required": { - "type": "boolean", - "description": "AMQP subject required." + "description": "CloudEvents id value template." } } }, - "reply-to": { + "time": { "type": "object", - "description": "AMQP reply-to.", + "description": "The timestamp of when the event happened.", "properties": { "value": { "type": "string", - "description": "AMQP reply-to value template." + "description": "The timestamp value template." }, "required": { "type": "boolean", - "description": "AMQP reply-to required." + "description": "The timestamp required." } } }, - "correlation-id": { + "dataschema": { "type": "object", - "description": "AMQP correlation-id.", + "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default.", "properties": { "value": { "type": "string", - "description": "AMQP correlation-id value template." + "format": "uri-template", + "description": "The uri value template." }, "required": { "type": "boolean", - "description": "AMQP correlation-id required." + "description": "The uri required." } } - }, - "content-type": { + } + }, + "additionalProperties": { + "type": "object", + "description": "CloudEvent extension property", + "properties": { + "value": { + "type": "string", + "description": "The value template." + }, + "required": { + "type": "boolean", + "description": "Whether the extension is required" + } + } + } + } + }, + "required": [ + "format" + ] + } + ] + }, + { + "oneOf": [ + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "None" + ], + "default": "None" + } + } + }, + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "AMQP/1.0" + ] + }, + "message": { + "type": "object", + "description": "AMQP message metadata constraints.", + "properties": { + "properties": { "type": "object", - "description": "AMQP content-type.", "properties": { - "value": { - "type": "string", - "description": "AMQP content-type value template." + "message_id": { + "type": "object", + "description": "AMQP message-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP message-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP message-id required." + } + } }, - "required": { - "type": "boolean", - "description": "AMQP content-type required." + "user_id": { + "type": "object", + "description": "AMQP user-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP user-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP user-id required." + } + } + }, + "to": { + "type": "object", + "description": "AMQP to.", + "properties": { + "value": { + "type": "string", + "description": "AMQP to value template." + }, + "required": { + "type": "boolean", + "description": "AMQP to required." + } + } + }, + "subject": { + "type": "object", + "description": "AMQP subject.", + "properties": { + "value": { + "type": "string", + "description": "AMQP subject value template." + }, + "required": { + "type": "boolean", + "description": "AMQP subject required." + } + } + }, + "reply_to": { + "type": "object", + "description": "AMQP reply-to.", + "properties": { + "value": { + "type": "string", + "description": "AMQP reply-to value template." + }, + "required": { + "type": "boolean", + "description": "AMQP reply-to required." + } + } + }, + "correlation_id": { + "type": "object", + "description": "AMQP correlation-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP correlation-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP correlation-id required." + } + } + }, + "content_type": { + "type": "object", + "description": "AMQP content-type.", + "properties": { + "value": { + "type": "string", + "description": "AMQP content-type value template." + }, + "required": { + "type": "boolean", + "description": "AMQP content-type required." + } + } + }, + "content_encoding": { + "type": "object", + "description": "AMQP content-encoding.", + "properties": { + "value": { + "type": "string", + "description": "AMQP content-encoding value template." + }, + "required": { + "type": "boolean", + "description": "AMQP content-encoding required." + } + } + }, + "absolute_expiry_time": { + "type": "object", + "description": "AMQP absolute-expiry-time.", + "properties": { + "value": { + "type": "string", + "description": "AMQP absolute-expiry-time value template." + }, + "required": { + "type": "boolean", + "description": "AMQP absolute-expiry-time required." + } + } + }, + "group_id": { + "type": "object", + "description": "AMQP group-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP group-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP group-id required." + } + } + }, + "group_sequence": { + "type": "object", + "description": "AMQP group-sequence.", + "properties": { + "value": { + "type": "string", + "description": "AMQP group-sequence value template." + }, + "required": { + "type": "boolean", + "description": "AMQP group-sequence required." + } + } + }, + "reply_to_group_id": { + "type": "object", + "description": "AMQP reply-to-group-id.", + "properties": { + "value": { + "type": "string", + "description": "AMQP reply-to-group-id value template." + }, + "required": { + "type": "boolean", + "description": "AMQP reply-to-group-id required." + } + } + } + } + }, + "application_properties": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The application property value template." + }, + "required": { + "type": "boolean", + "description": "The application property required." + }, + "type": { + "type": "string", + "description": "The application property type." + } + } + } + }, + "message_annotations": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The message annotation value" + }, + "required": { + "type": "boolean", + "description": "Whether the message annotation is required" + }, + "type": { + "type": "string", + "description": "The message annotation type." + } } } }, - "content-encoding": { + "delivery_annotations": { "type": "object", - "description": "AMQP content-encoding.", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The delivery annotation value" + }, + "required": { + "type": "boolean", + "description": "Whether the annotation is required" + }, + "type": { + "type": "string", + "description": "The annotation type." + } + } + } + }, + "header": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "AMQP header value." + }, + "required": { + "type": "boolean", + "description": "AMQP header required." + }, + "type": { + "type": "string", + "description": "AMQP header type." + } + } + } + }, + "footer": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "AMQP footer value." + }, + "required": { + "type": "boolean", + "description": "AMQP footer required." + }, + "type": { + "type": "string", + "description": "AMQP footer type." + } + } + } + } + } + } + }, + "required": [ + "binding" + ] + }, + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "MQTT/3.1.1" + ] + }, + "message": { + "type": "object", + "description": "MQTT message metadata constraints.", + "properties": { + "qos": { + "type": "object", + "description": "MQTT qos.", "properties": { "value": { "type": "string", - "description": "AMQP content-encoding value template." - }, - "required": { - "type": "boolean", - "description": "AMQP content-encoding required." + "description": "MQTT qos value template." } } }, - "absolute-expiry-time": { + "retain": { "type": "object", - "description": "AMQP absolute-expiry-time.", + "description": "MQTT retain.", "properties": { "value": { - "type": "string", - "description": "AMQP absolute-expiry-time value template." - }, - "required": { "type": "boolean", - "description": "AMQP absolute-expiry-time required." + "description": "MQTT retain value template." } } }, - "group-id": { + "topic_name": { "type": "object", - "description": "AMQP group-id.", + "description": "MQTT topic-name.", "properties": { "value": { "type": "string", - "description": "AMQP group-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP group-id required." + "description": "MQTT topic-name value template." + } + } + } + } + } + }, + "required": [ + "binding" + ] + }, + { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "MQTT/5.0" + ] + }, + "message": { + "type": "object", + "description": "MQTT message metadata constraints.", + "properties": { + "qos": { + "type": "object", + "description": "MQTT qos.", + "properties": { + "value": { + "type": "integer", + "description": "MQTT qos value template." } } }, - "group-sequence": { + "retain": { "type": "object", - "description": "AMQP group-sequence.", + "description": "MQTT retain.", "properties": { "value": { - "type": "string", - "description": "AMQP group-sequence value template." - }, - "required": { "type": "boolean", - "description": "AMQP group-sequence required." + "description": "MQTT retain value template." } } }, - "reply-to-group-id": { + "topic_name": { "type": "object", - "description": "AMQP reply-to-group-id.", + "description": "MQTT topic-name.", "properties": { "value": { "type": "string", - "description": "AMQP reply-to-group-id value template." - }, - "required": { - "type": "boolean", - "description": "AMQP reply-to-group-id required." + "description": "MQTT topic-name value template." } } - } - } - }, - "application-properties": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The application property name." - }, - "value": { - "type": "string", - "description": "The application property value template." - }, - "required": { - "type": "boolean", - "description": "The application property required." - }, - "type": { - "type": "string", - "description": "The application property type." - } - } - } - }, - "message-annotations": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The message annotation name." - }, - "value": { - "type": "string", - "description": "The message annotation value" - }, - "required": { - "type": "boolean", - "description": "Whether the message annotation is required" - }, - "type": { - "type": "string", - "description": "The message annotation type." + }, + "message_expiry_interval": { + "type": "object", + "description": "MQTT message-expiry-interval.", + "properties": { + "value": { + "type": "integer", + "description": "MQTT message-expiry-interval value template." + } } }, - "required": [ - "name" - ] - } - }, - "delivery-annotations": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The delivery annotation name." - }, - "value": { - "type": "string", - "description": "The delivery annotation value" - }, - "required": { - "type": "boolean", - "description": "Whether the annotation is required" - }, - "type": { - "type": "string", - "description": "The annotation type." + "response_topic": { + "type": "object", + "description": "MQTT response-topic.", + "properties": { + "value": { + "type": "string", + "description": "MQTT response-topic value template." + } } }, - "required": [ - "name" - ] - } - }, - "header": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "AMQP header name." - }, - "value": { - "type": "string", - "description": "AMQP header value." - }, - "required": { - "type": "boolean", - "description": "AMQP header required." - }, - "type": { - "type": "string", - "description": "AMQP header type." + "correlation_data": { + "type": "object", + "description": "MQTT correlation-data.", + "properties": { + "value": { + "type": "string", + "format": "base64", + "description": "MQTT correlation-data value template." + } } }, - "required": [ - "name" - ] - } - }, - "footer": { - "type": "object", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "AMQP footer name." - }, - "value": { - "type": "string", - "description": "AMQP footer value." - }, - "required": { - "type": "boolean", - "description": "AMQP footer required." - }, - "type": { - "type": "string", - "description": "AMQP footer type." + "content_type": { + "type": "object", + "description": "MQTT content-type.", + "properties": { + "value": { + "type": "string", + "description": "MQTT content-type value template." + } } }, - "required": [ - "name" - ] - } - } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "MQTT/3.1.1" - ] - }, - "metadata": { - "type": "object", - "description": "MQTT message metadata constraints.", - "properties": { - "qos": { - "type": "object", - "description": "MQTT qos.", - "properties": { - "value": { - "type": "string", - "description": "MQTT qos value template." - } - } - }, - "retain": { - "type": "object", - "description": "MQTT retain.", - "properties": { - "value": { - "type": "boolean", - "description": "MQTT retain value template." - } - } - }, - "topic-name": { - "type": "object", - "description": "MQTT topic-name.", - "properties": { - "value": { - "type": "string", - "description": "MQTT topic-name value template." + "user_properties": { + "type": "array", + "description": "MQTT user-properties.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "MQTT user-property name." + }, + "value": { + "type": "string", + "description": "MQTT user-property value." + } + } + } } } } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "MQTT/5.0" + }, + "required": [ + "binding" ] }, - "metadata": { - "type": "object", - "description": "MQTT message metadata constraints.", + { "properties": { - "qos": { - "type": "object", - "description": "MQTT qos.", - "properties": { - "value": { - "type": "integer", - "description": "MQTT qos value template." - } - } - }, - "retain": { - "type": "object", - "description": "MQTT retain.", - "properties": { - "value": { - "type": "boolean", - "description": "MQTT retain value template." - } - } + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "KAFKA" + ] }, - "topic-name": { + "message": { "type": "object", - "description": "MQTT topic-name.", + "description": "The Apache Kafka message metadata constraints.", "properties": { - "value": { + "topic": { "type": "string", - "description": "MQTT topic-name value template." - } - } - }, - "message-expiry-interval": { - "type": "object", - "description": "MQTT message-expiry-interval.", - "properties": { - "value": { + "description": "The Apache Kafka topic." + }, + "partition": { "type": "integer", - "description": "MQTT message-expiry-interval value template." - } - } - }, - "response-topic": { - "type": "object", - "description": "MQTT response-topic.", - "properties": { - "value": { - "type": "string", - "description": "MQTT response-topic value template." - } - } - }, - "correlation-data": { - "type": "object", - "description": "MQTT correlation-data.", - "properties": { - "value": { + "description": "The Apache Kafka partition." + }, + "key": { "type": "string", "format": "base64", - "description": "MQTT correlation-data value template." - } - } - }, - "content-type": { - "type": "object", - "description": "MQTT content-type.", - "properties": { - "value": { - "type": "string", - "description": "MQTT content-type value template." - } - } - }, - "user-properties": { - "type": "array", - "description": "MQTT user-properties.", - "items": { - "properties": { - "name": { - "type": "string", - "description": "MQTT user-property name." - }, - "value": { - "type": "string", - "description": "MQTT user-property value." + "description": "The Apache Kafka key." + }, + "headers": { + "type": "object", + "description": "The Apache Kafka headers.", + "additionalProperties": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The Apache Kafka header name." + }, + "value": { + "type": "string", + "description": "The Apache Kafka header value." + } + } } + }, + "timestamp": { + "type": "integer", + "description": "The Apache Kafka timestamp." } } } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "KAFKA/0.11" + }, + "required": [ + "binding" ] }, - "metadata": { - "type": "object", - "description": "The Apache Kafka message metadata constraints.", + { "properties": { - "topic": { - "type": "string", - "description": "The Apache Kafka topic." - }, - "partition": { - "type": "integer", - "description": "The Apache Kafka partition." - }, - "key": { + "binding": { "type": "string", - "format": "base64", - "description": "The Apache Kafka key." - }, - "headers": { - "type": "object", - "description": "The Apache Kafka headers.", - "additionalProperties": { - "properties": { - "name": { - "type": "string", - "description": "The Apache Kafka header name." - }, - "value": { - "type": "string", - "description": "The Apache Kafka header value." - } - } - } - }, - "timestamp": { - "type": "integer", - "description": "The Apache Kafka timestamp." - } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "CloudEvents/1.0" - ] - }, - "metadata": { - "type": "object", - "description": "CloudEvents metadata constraints.", - "properties": { - "type": { - "type": "object", - "description": "CloudEvents type.", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents type value template." - } - } - }, - "source": { - "type": "object", - "description": "CloudEvents source", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents source value template." - } - } + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "HTTP" + ] }, - "subject": { + "message": { "type": "object", - "description": "CloudEvents subject", + "description": "The HTTP message metadata constraints.", "properties": { - "value": { - "type": "string", - "description": "CloudEvents subject value template." + "headers": { + "type": "array", + "description": "The HTTP headers.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The HTTP header name." + }, + "value": { + "type": "string", + "description": "The HTTP header value." + } + } + } }, - "required": { - "type": "boolean", - "description": "CloudEvents subject required." - } - } - }, - "id": { - "type": "object", - "description": "CloudEvents id", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents id value template." - } - } - }, - "time": { - "type": "object", - "description": "The timestamp of when the event happened.", - "properties": { - "value": { + "query": { + "type": "object", + "description": "The HTTP query parameters." + }, + "path": { "type": "string", - "description": "The timestamp value template." + "description": "The HTTP path as a uri template." }, - "required": { - "type": "boolean", - "description": "The timestamp required." + "method": { + "type": "string", + "description": "The HTTP method." } } - }, - "dataschema": { - "type": "string", - "format": "uri-template", - "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." } }, - "additionalProperties": { - "type": "object", - "description": "CloudEvent extension property", - "properties": { - "value": { - "type": "string", - "description": "The value template." - }, - "required": { - "type": "boolean", - "description": "Whether the extension is required" - } - } - } - } - }, - "required": [ - "format" - ] - }, - { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "HTTP/1.1" + "required": [ + "binding" ] - }, - "metadata": { - "type": "object", - "description": "The HTTP message metadata constraints.", - "properties": { - "headers": { - "type": "array", - "description": "The HTTP headers.", - "items": { - "properties": { - "name": { - "type": "string", - "description": "The HTTP header name." - }, - "value": { - "type": "string", - "description": "The HTTP header value." - } - } - } - }, - "query": { - "type": "object", - "description": "The HTTP query parameters." - }, - "path": { - "type": "string", - "description": "The HTTP path as a uri template." - }, - "method": { - "type": "string", - "description": "The HTTP method." - } - } } - }, - "required": [ - "format" ] } ] }, - "definitionGroup": { + "definitiongroup": { "type": "object", "properties": { "id": { @@ -760,22 +783,26 @@ }, "format": { "type": "string", - "description": "Message format identifier. All definitions in this group share this format. Mixed-format groups are not permitted." + "description": "Format identifier that defines the common metadata information for the message. All definitions in this group share this format. Mixed-format groups are not permitted." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, + "binding": { + "type": "string", + "description": "Binding identifier that defines the transport message binding. All definitions in this group share this binding type. Mixed-binding groups are not permitted." + }, "definitions": { "type": "object", "additionalProperties": { @@ -784,8 +811,7 @@ } }, "required": [ - "id", - "format" + "id" ] } } diff --git a/message/schemas/openapi.json b/message/schemas/openapi.json index 7c27874..13e78eb 100644 --- a/message/schemas/openapi.json +++ b/message/schemas/openapi.json @@ -81,21 +81,21 @@ } } }, - "/definitionGroups/{groupId}": { + "/definitiongroups/{groupid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { - "operationId": "getDefinitionGroup", + "operationId": "getDefinitiongroup", "responses": { "200": { "description": "The resource group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/definitionGroup" + "$ref": "#/components/schemas/definitiongroup" } } } @@ -122,14 +122,14 @@ } } ], - "operationId": "putDefinitionGroup", + "operationId": "putDefinitiongroup", "description": "creates or updates the resource group", "requestBody": { "description": "A request to create or update the discovery group's collection of groups with the given group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/definitionGroup" + "$ref": "#/components/schemas/definitiongroup" } } } @@ -140,7 +140,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/definitionGroup" + "$ref": "#/components/schemas/definitiongroup" } } } @@ -157,7 +157,7 @@ } }, "delete": { - "operationId": "deleteDefinitionGroup", + "operationId": "deleteDefinitiongroup", "parameters": [ { "in": "query", @@ -184,14 +184,14 @@ } } }, - "/definitionGroups/{groupId}/definitions": { + "/definitiongroups/{groupid}/definitions": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { - "operationId": "getDefinitionGroupDefinitionsAll", + "operationId": "getDefinitiongroupDefinitionsAll", "description": "Get an optionally filtered collection of resources", "parameters": [ { @@ -259,13 +259,13 @@ } } }, - "/definitionGroups/{groupId}/definitions/{resourceId}": { + "/definitiongroups/{groupid}/definitions/{resourceid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { "in": "query", @@ -278,7 +278,7 @@ } ], "get": { - "operationId": "getDefinitionGroupDefinition", + "operationId": "getDefinitiongroupDefinition", "responses": { "200": { "description": "The corresponding resource", @@ -377,7 +377,7 @@ ], "summary": "Create or update a resource", "description": "Create a resource. ", - "operationId": "putDefinitionGroupDefinition", + "operationId": "putDefinitiongroupDefinition", "requestBody": { "description": "The resource to be created/updated", "content": { @@ -417,7 +417,7 @@ "post": { "summary": "Post new resource version", "description": "Register resource version If resource of specified name does not exist in specified group, resource and resource version is created at version 1. If resource of specified name exists already in specified group, resource is created at latest version + 1. If resource with identical content already exists, existing resource's ID is returned. \n", - "operationId": "postDefinitionGroupDefinition", + "operationId": "postDefinitiongroupDefinition", "parameters": [ { "$ref": "#/components/parameters/resource-description" @@ -525,7 +525,7 @@ "delete": { "summary": "Delete resource", "description": "Delete resource", - "operationId": "deleteDefinitionGroupDefinition", + "operationId": "deleteDefinitiongroupDefinition", "parameters": [ { "in": "query", @@ -552,17 +552,17 @@ } } }, - "/definitionGroups/{groupId}/definitions/{resourceId}/versions": { + "/definitiongroups/{groupid}/definitions/{resourceid}/versions": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" } ], "get": { - "operationId": "getDefinitionGroupDefinitionVersionsAll", + "operationId": "getDefinitiongroupDefinitionVersionsAll", "description": "Get an optionally filtered collection of versions", "parameters": [ { @@ -620,16 +620,16 @@ } } }, - "/definitionGroups/{groupId}/definitions/{resourceId}/versions/{versionId}": { + "/definitiongroups/{groupid}/definitions/{resourceid}/versions/{versionid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { - "$ref": "#/components/parameters/versionId" + "$ref": "#/components/parameters/versionid" }, { "in": "query", @@ -643,7 +643,7 @@ } ], "get": { - "operationId": "getDefinitionGroupDefinitionVersion", + "operationId": "getDefinitiongroupDefinitionVersion", "description": "Gets the document stored for the schema version", "responses": { "200": { @@ -722,7 +722,7 @@ } } ], - "operationId": "updateDefinitionGroupDefinitionVersion", + "operationId": "updateDefinitiongroupDefinitionVersion", "description": "Updates the metadata for the schema version", "requestBody": { "description": "The schema version document", @@ -770,7 +770,7 @@ } } ], - "operationId": "deleteDefinitionGroupDefinitionVersion", + "operationId": "deleteDefinitiongroupDefinitionVersion", "responses": { "204": { "description": "Ok" @@ -823,9 +823,9 @@ "format": "uri-reference" } }, - "groupId": { + "groupid": { "in": "path", - "name": "groupId", + "name": "groupid", "description": "The id of the group", "required": true, "schema": { @@ -834,9 +834,9 @@ "format": "uri-reference" } }, - "resourceId": { + "resourceid": { "in": "path", - "name": "resourceId", + "name": "resourceid", "description": "The id of the schema", "required": true, "schema": { @@ -845,9 +845,9 @@ "format": "uri-reference" } }, - "versionId": { + "versionid": { "in": "path", - "name": "versionId", + "name": "versionid", "description": "The id of the schema", "required": true, "schema": { @@ -1096,31 +1096,162 @@ "document": { "type": "object", "properties": { - "definitionGroups": { + "definitiongroups": { "type": "object", "additionalProperties": { - "$ref": "#/components/schemas/definitionGroup" + "$ref": "#/components/schemas/definitiongroup" } } } }, - "format_AMQP_1_0": { + "format_None": { "properties": { "format": { "type": "string", "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ - "AMQP/1.0" + "None" + ], + "default": "None" + } + } + }, + "format_CloudEvents_1_0": { + "properties": { + "format": { + "type": "string", + "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "CloudEvents/1.0" ] }, "metadata": { + "type": "object", + "description": "CloudEvents metadata constraints.", + "properties": { + "type": { + "type": "object", + "description": "CloudEvents type.", + "properties": { + "value": { + "type": "string", + "description": "CloudEvents type value template." + } + } + }, + "source": { + "type": "object", + "description": "CloudEvents source", + "properties": { + "value": { + "type": "string", + "description": "CloudEvents source value template." + } + } + }, + "subject": { + "type": "object", + "description": "CloudEvents subject", + "properties": { + "value": { + "type": "string", + "description": "CloudEvents subject value template." + }, + "required": { + "type": "boolean", + "description": "CloudEvents subject required." + } + } + }, + "id": { + "type": "object", + "description": "CloudEvents id", + "properties": { + "value": { + "type": "string", + "description": "CloudEvents id value template." + } + } + }, + "time": { + "type": "object", + "description": "The timestamp of when the event happened.", + "properties": { + "value": { + "type": "string", + "description": "The timestamp value template." + }, + "required": { + "type": "boolean", + "description": "The timestamp required." + } + } + }, + "dataschema": { + "type": "object", + "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default.", + "properties": { + "value": { + "type": "string", + "format": "uri-template", + "description": "The uri value template." + }, + "required": { + "type": "boolean", + "description": "The uri required." + } + } + } + }, + "additionalProperties": { + "type": "object", + "description": "CloudEvent extension property", + "properties": { + "value": { + "type": "string", + "description": "The value template." + }, + "required": { + "type": "boolean", + "description": "Whether the extension is required" + } + } + } + } + }, + "required": [ + "format" + ] + }, + "binding_None": { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "None" + ], + "default": "None" + } + } + }, + "binding_AMQP_1_0": { + "properties": { + "binding": { + "type": "string", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "enum": [ + "AMQP/1.0" + ] + }, + "message": { "type": "object", "description": "AMQP message metadata constraints.", "properties": { "properties": { "type": "object", "properties": { - "message-id": { + "message_id": { "type": "object", "description": "AMQP message-id.", "properties": { @@ -1134,7 +1265,7 @@ } } }, - "user-id": { + "user_id": { "type": "object", "description": "AMQP user-id.", "properties": { @@ -1176,7 +1307,7 @@ } } }, - "reply-to": { + "reply_to": { "type": "object", "description": "AMQP reply-to.", "properties": { @@ -1190,7 +1321,7 @@ } } }, - "correlation-id": { + "correlation_id": { "type": "object", "description": "AMQP correlation-id.", "properties": { @@ -1204,7 +1335,7 @@ } } }, - "content-type": { + "content_type": { "type": "object", "description": "AMQP content-type.", "properties": { @@ -1218,7 +1349,7 @@ } } }, - "content-encoding": { + "content_encoding": { "type": "object", "description": "AMQP content-encoding.", "properties": { @@ -1232,7 +1363,7 @@ } } }, - "absolute-expiry-time": { + "absolute_expiry_time": { "type": "object", "description": "AMQP absolute-expiry-time.", "properties": { @@ -1246,7 +1377,7 @@ } } }, - "group-id": { + "group_id": { "type": "object", "description": "AMQP group-id.", "properties": { @@ -1260,7 +1391,7 @@ } } }, - "group-sequence": { + "group_sequence": { "type": "object", "description": "AMQP group-sequence.", "properties": { @@ -1274,7 +1405,7 @@ } } }, - "reply-to-group-id": { + "reply_to_group_id": { "type": "object", "description": "AMQP reply-to-group-id.", "properties": { @@ -1290,14 +1421,11 @@ } } }, - "application-properties": { + "application_properties": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "The application property name." - }, "value": { "type": "string", "description": "The application property value template." @@ -1313,14 +1441,11 @@ } } }, - "message-annotations": { + "message_annotations": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "The message annotation name." - }, "value": { "type": "string", "description": "The message annotation value" @@ -1333,20 +1458,14 @@ "type": "string", "description": "The message annotation type." } - }, - "required": [ - "name" - ] + } } }, - "delivery-annotations": { + "delivery_annotations": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "The delivery annotation name." - }, "value": { "type": "string", "description": "The delivery annotation value" @@ -1359,20 +1478,14 @@ "type": "string", "description": "The annotation type." } - }, - "required": [ - "name" - ] + } } }, "header": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "AMQP header name." - }, "value": { "type": "string", "description": "AMQP header value." @@ -1385,20 +1498,14 @@ "type": "string", "description": "AMQP header type." } - }, - "required": [ - "name" - ] + } } }, "footer": { "type": "object", "additionalProperties": { + "type": "object", "properties": { - "name": { - "type": "string", - "description": "AMQP footer name." - }, "value": { "type": "string", "description": "AMQP footer value." @@ -1411,29 +1518,26 @@ "type": "string", "description": "AMQP footer type." } - }, - "required": [ - "name" - ] + } } } } } }, "required": [ - "format" + "binding" ] }, - "format_MQTT_3_1_1": { + "binding_MQTT_3_1_1": { "properties": { - "format": { + "binding": { "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ "MQTT/3.1.1" ] }, - "metadata": { + "message": { "type": "object", "description": "MQTT message metadata constraints.", "properties": { @@ -1457,7 +1561,7 @@ } } }, - "topic-name": { + "topic_name": { "type": "object", "description": "MQTT topic-name.", "properties": { @@ -1471,19 +1575,19 @@ } }, "required": [ - "format" + "binding" ] }, - "format_MQTT_5_0": { + "binding_MQTT_5_0": { "properties": { - "format": { + "binding": { "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ "MQTT/5.0" ] }, - "metadata": { + "message": { "type": "object", "description": "MQTT message metadata constraints.", "properties": { @@ -1507,7 +1611,7 @@ } } }, - "topic-name": { + "topic_name": { "type": "object", "description": "MQTT topic-name.", "properties": { @@ -1517,7 +1621,7 @@ } } }, - "message-expiry-interval": { + "message_expiry_interval": { "type": "object", "description": "MQTT message-expiry-interval.", "properties": { @@ -1527,7 +1631,7 @@ } } }, - "response-topic": { + "response_topic": { "type": "object", "description": "MQTT response-topic.", "properties": { @@ -1537,7 +1641,7 @@ } } }, - "correlation-data": { + "correlation_data": { "type": "object", "description": "MQTT correlation-data.", "properties": { @@ -1548,7 +1652,7 @@ } } }, - "content-type": { + "content_type": { "type": "object", "description": "MQTT content-type.", "properties": { @@ -1558,10 +1662,11 @@ } } }, - "user-properties": { + "user_properties": { "type": "array", "description": "MQTT user-properties.", "items": { + "type": "object", "properties": { "name": { "type": "string", @@ -1578,19 +1683,19 @@ } }, "required": [ - "format" + "binding" ] }, - "format_KAFKA_0_11": { + "binding_KAFKA": { "properties": { - "format": { + "binding": { "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ - "KAFKA/0.11" + "KAFKA" ] }, - "metadata": { + "message": { "type": "object", "description": "The Apache Kafka message metadata constraints.", "properties": { @@ -1611,6 +1716,7 @@ "type": "object", "description": "The Apache Kafka headers.", "additionalProperties": { + "type": "object", "properties": { "name": { "type": "string", @@ -1631,116 +1737,19 @@ } }, "required": [ - "format" - ] - }, - "format_CloudEvents_1_0": { - "properties": { - "format": { - "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", - "enum": [ - "CloudEvents/1.0" - ] - }, - "metadata": { - "type": "object", - "description": "CloudEvents metadata constraints.", - "properties": { - "type": { - "type": "object", - "description": "CloudEvents type.", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents type value template." - } - } - }, - "source": { - "type": "object", - "description": "CloudEvents source", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents source value template." - } - } - }, - "subject": { - "type": "object", - "description": "CloudEvents subject", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents subject value template." - }, - "required": { - "type": "boolean", - "description": "CloudEvents subject required." - } - } - }, - "id": { - "type": "object", - "description": "CloudEvents id", - "properties": { - "value": { - "type": "string", - "description": "CloudEvents id value template." - } - } - }, - "time": { - "type": "object", - "description": "The timestamp of when the event happened.", - "properties": { - "value": { - "type": "string", - "description": "The timestamp value template." - }, - "required": { - "type": "boolean", - "description": "The timestamp required." - } - } - }, - "dataschema": { - "type": "string", - "format": "uri-template", - "description": "The uri of the schema that the event payload adheres to. If the dataschema attribute is not present, it MUST be interpreted as no schema. An application MAY assign a meaning to the dataschema attribute if it is not present by default." - } - }, - "additionalProperties": { - "type": "object", - "description": "CloudEvent extension property", - "properties": { - "value": { - "type": "string", - "description": "The value template." - }, - "required": { - "type": "boolean", - "description": "Whether the extension is required" - } - } - } - } - }, - "required": [ - "format" + "binding" ] }, - "format_HTTP_1_1": { + "binding_HTTP": { "properties": { - "format": { + "binding": { "type": "string", - "description": "Message format identifier. This attribute MUST be the same as the 'format' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", + "description": "Binding identifier. This attribute MUST be the same as the 'binding' attribute of the definition group, but is not automatically inherited because definitions may be cross-referenced across groups.", "enum": [ - "HTTP/1.1" + "HTTP" ] }, - "metadata": { + "message": { "type": "object", "description": "The HTTP message metadata constraints.", "properties": { @@ -1748,6 +1757,7 @@ "type": "array", "description": "The HTTP headers.", "items": { + "type": "object", "properties": { "name": { "type": "string", @@ -1776,7 +1786,7 @@ } }, "required": [ - "format" + "binding" ] }, "definition": { @@ -1805,37 +1815,42 @@ "labels": { "type": "object" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" + }, + "baseDefinitionUrl": { + "type": "string", + "format": "uri", + "description": "Reference to a base definition for this definition, either via a (relative) URL or a fragment identifier. The base definition is overridden by this definition. If not present, this definition does not override any base definition." } }, "required": [ "id" ], "discriminator": { - "propertyName": "format", + "propertyName": "binding", "mapping": { - "AMQP/1.0": "#/components/schemas/format_AMQP_1_0", - "MQTT/3.1.1": "#/components/schemas/format_MQTT_3_1_1", - "MQTT/5.0": "#/components/schemas/format_MQTT_5_0", - "KAFKA/0.11": "#/components/schemas/format_KAFKA_0_11", - "CloudEvents/1.0": "#/components/schemas/format_CloudEvents_1_0", - "HTTP/1.1": "#/components/schemas/format_HTTP_1_1" + "None": "#/components/schemas/binding_None", + "AMQP/1.0": "#/components/schemas/binding_AMQP_1_0", + "MQTT/3.1.1": "#/components/schemas/binding_MQTT_3_1_1", + "MQTT/5.0": "#/components/schemas/binding_MQTT_5_0", + "KAFKA": "#/components/schemas/binding_KAFKA", + "HTTP": "#/components/schemas/binding_HTTP" } } }, - "definitionGroup": { + "definitiongroup": { "type": "object", "properties": { "id": { @@ -1863,22 +1878,26 @@ }, "format": { "type": "string", - "description": "Message format identifier. All definitions in this group share this format. Mixed-format groups are not permitted." + "description": "Format identifier that defines the common metadata information for the message. All definitions in this group share this format. Mixed-format groups are not permitted." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, + "binding": { + "type": "string", + "description": "Binding identifier that defines the transport message binding. All definitions in this group share this binding type. Mixed-binding groups are not permitted." + }, "definitions": { "type": "object", "additionalProperties": { @@ -1887,8 +1906,7 @@ } }, "required": [ - "id", - "format" + "id" ] } } diff --git a/message/spec.md b/message/spec.md index cd8770a..6b70752 100644 --- a/message/spec.md +++ b/message/spec.md @@ -93,23 +93,39 @@ The Group (GROUP) name is `definitionGroups`. The type of a group is The following attributes are defined for the `definitionGroup` object in addition to the basic [attributes](../core/spec.md#attributes-and-extensions): -#### `format` (Message format) +#### `format` (Metadata format) - Type: String -- Description: Identifies the message metadata format. Message metadata formats - are referenced by name and version as `{NAME}/{VERSION}`. This specification - defines a set of common [message format names](#message-formats) that MUST be - used for the given formats, but applications MAY define extensions for other - formats on their own. All definitions inside a group MUST use this same - format. +- Description: Identifies the common, transport protocol independent message + metadata format. Message metadata formats are referenced by name and version + as `{NAME}/{VERSION}`. This specification defines a set of common + [metadata format names](#metadata-formats) that MUST be used for the given + formats, but applications MAY define extensions for other formats on their + own. All definitions inside a group MUST use this same format. - Constraints: - - REQUIRED - - MUST be a non-empty string - - MUST follow the naming convention `{NAME}/{VERSION}`, whereby `{NAME}` is - the name of the message format and `{VERSION}` is the version of the schema - format in the format defined by the schema format itself. + - At least one of `metadata` and `binding` MUST be specified. + - if present, MUST be a non-empty string + - if present, MUST follow the naming convention `{NAME}/{VERSION}`, whereby `{NAME}` is + the name of the metadata format and `{VERSION}` is the version of the + metadata format. - Examples: - `CloudEvents/1.0` + +#### `binding` (Message binding) + +- Type: String +- Description: Identifies a transport protocol message binding. Bindings are + referenced by name and version as `{NAME}/{VERSION}`. This specification + defines a set of common [message binding names](#message-bindings) that MUST + be used for the given protocols, but applications MAY define extensions for + other protocol bindings on their own. All definitions inside a group MUST use + this same binding. +- Constraints: + - At least one of `metadata` and `binding` MUST be specified. + - if present, MUST be a non-empty string + - if present, MUST follow the naming convention `{NAME}/{VERSION}`, whereby `{NAME}` is + the name of the protocol and `{VERSION}` is the version of protocol. +- Examples: - `MQTT/3.1.1` - `AMQP/1.0` - `Kafka/0.11` @@ -126,9 +142,24 @@ different definitions. The following extension is defined for the `definition` object in addition to the basic [attributes](../core/spec.md#attributes-and-extensions): -#### `format` (Message format, definition) +#### `baseDefinitionUrl` (Base definition URL, definition) -Same as the [`format`](#format-message-format) attribute of the +- Type: URI-reference +- Description: if present, the URL points to a message definition that is the + base for this message definition. By following the URL, the base definition + can be retrieved and extended with the properties of this definition. This is + useful for defining variants of messages that only differ in minor aspects to + avoid repetition, or definitions that only have a `format` with associated + `metadata` to be bound to various protocols. +- Constraints: + - OPTIONAL + - If present, MUST be a valid URI-reference + - If present, MUST point to a resource of type `definition` using JSON Pointer + [RFC6901][JSON Pointer] notation. + +#### `format` (Metadata format, definition) + +Same as the [`format`](#format-metadata-format) attribute of the `definitionGroup` object. Since definitions MAY be cross-referenced ("borrowed") across definition group @@ -185,10 +216,27 @@ Illustrating example: content of the metadata property is defined by the message format, but all formats use a common schema for the constraints defined for their metadata headers, properties or attributes. +- Constraints: + - REQUIRED if `format` is specified. +- Examples: + - See [Metadata Formats](#metadata-formats) + +#### `binding` (Protocol binding, definition) + +- Same as the [`binding`](#binding-message-binding) attribute of the + `definitionGroup` object. + +#### `message` (Protocol binding) + +- Type: Object +- Description: Describes the message constraints for the protocol message + binding. The content of the metadata property is defined by the protocol + message binding, but all bindings use a common schema model for the + constraints defined for their metadata headers, properties or attributes. - Constraints: - REQUIRED - Examples: - - See [Message Formats](#message-formats) + - See [Message Bindings](#message-bindings) #### `schemaformat` @@ -236,19 +284,31 @@ Illustrating example: - Mutually exclusive with the `schema` attribute. - If present, `schemaformat` MUST be present. -### Message Formats +### Metadata Formats and Message Bindings + +This section defines the metadata formats and message bindings that are directly +supported by this specification. + +Metadata formats lean on a protocol-neutral metadata definition like +CloudEvents. Message bindings lean on a message model definition of a specific +protocol like AMQP or MQTT or Kafka. + +A definition can use either a metadata `format`, a message `binding`, or both. + +If a definition only uses a metadata format, any implicit protocol bindings +defined by the format apply. For instance, a message definition that uses the +"CloudEvents/1.0" format but no explicit `binding` implicitly applies to all +protocols for which CloudEvents bindings exist, and using the respective +protocol binding rules. -This section defines the message formats that are directly supported by this -specification. Message formats lean on a protocol-neutral metadata definition -like CloudEvents or on the message model definition of a specific protocol like -AMQP or MQTT or Kafka. A message format defines constraints for the fixed and -variable headers/properties/attributes of the event format or protocol message -model. +If a definition uses both a metadata `format` and a message `binding`, the +message binding rules apply over the metadata format rules. For instance, if a +message definition uses the "CloudEvents/1.0" format and an "AMQP/1.0" binding, +then the implicit protocol bindings of the "CloudEvents/1.0" format are +overridden by the "AMQP/1.0" binding rules. -> Message format definitions might be specific to a particular client instance -> and used to configure that client. Therefore, the message format definitions -> allow for specifying very narrow constraints like the exact value of an Apache -> Kafka record `key`. +If a definition uses only a message `binding`, only the metadata constraints +defined by the message binding rules apply. #### Common properties @@ -332,6 +392,10 @@ current timestamp when creating a message. - Constraints: - OPTIONAL +#### Metadata Formats + +This specification only defines one metadata format: "CloudEvents/1.0". + ##### CloudEvents/1.0 For the "CloudEvents/1.0" format, the [`metadata`](#metadata-message-metadata) @@ -421,12 +485,16 @@ CloudEvents base specification. The implied `datacontenttype` is For clarity of the definition, you MAY always declare all implied attribute properties explicitly, but they MUST conform with the rules above. -### "HTTP/1.1", "HTTP/2", "HTTP/3" +#### Message Bindings -The "HTTP" format is used to define messages that are sent over an HTTP -connection. The format is based on the [HTTP Message Format][HTTP Message Format] and is common across all version of HTTP. +##### "HTTP/1.1", "HTTP/2", "HTTP/3" binding -The [`metadata`](#metadata-message-metadata) object MAY contain several +The "HTTP" binding is used to define messages that are sent over an HTTP +connection. The binding is based on the +[HTTP Message Format][HTTP Message Format] and is common across all versions of +HTTP. + +The [`message`](#message-protocol-binding) object MAY contain several properties: | Property | Type | Description | @@ -460,8 +528,8 @@ The following example defines a message that is sent over HTTP/1.1: ```JSON { - "format": "HTTP/1.1", - "metadata": { + "binding": "HTTP/1.1", + "message": { "headers": [ { "name": "Content-Type", @@ -479,13 +547,13 @@ The following example defines a message that is sent over HTTP/1.1: } ``` -### "AMQP/1.0" +##### "AMQP/1.0" binding -The "AMQP/1.0" format is used to define messages that are sent over an -[AMQP][AMQP 1.0] connection. The format is based on the default +The "AMQP/1.0" binding is used to define messages that are sent over an +[AMQP][AMQP 1.0] connection. It is based on the default [AMQP 1.0 Message Format][AMQP 1.0 Message Format]. -The [`metadata`](#metadata-message-metadata) object MAY contain several +The [`message`](#message-protocol-binding) object MAY contain several properties, each of which corresponds to a section of the AMQP 1.0 Message: | Property | Type | Description | @@ -511,8 +579,8 @@ definition: ```JSON { - "format": "AMQP/1.0", - "metadata": { + "binding": "AMQP/1.0", + "message": { "properties": { "message-id": { "required": true @@ -540,7 +608,7 @@ definition: } ``` -#### `properties` (AMQP 1.0 Message Properties) +##### `properties` (AMQP 1.0 Message Properties) The `properties` property is an object that contains the properties of the AMQP 1.0 [Message Properties][AMQP 1.0 Message Properties] section. The @@ -561,7 +629,7 @@ following properties are defined, with type constraints: | `group-sequence` | `integer` | position of this message within its group | | `reply-to-group-id` | `uritemplate` | group-id to which the receiver of this message ought to send replies to | -#### `application-properties` (AMQP 1.0 Application Properties) +##### `application-properties` (AMQP 1.0 Application Properties) The `application-properties` property is an object that contains the custom properties of the AMQP 1.0 [Application Properties][AMQP 1.0 Application Properties] section. @@ -569,7 +637,7 @@ properties of the AMQP 1.0 [Application Properties][AMQP 1.0 Application Propert The names of the properties MUST be of type `symbol` and MUST be unique. The values of the properties MAY be of any permitted type. -#### `message-annotations` (AMQP 1.0 Message Annotations) +##### `message-annotations` (AMQP 1.0 Message Annotations) The `message-annotations` property is an object that contains the custom properties of the AMQP 1.0 [Message Annotations][AMQP 1.0 Message Annotations] @@ -578,7 +646,7 @@ section. The names of the properties MUST be of type `symbol` and MUST be unique. The values of the properties MAY be of any permitted type. -#### `delivery-annotations` (AMQP 1.0 Delivery Annotations) +##### `delivery-annotations` (AMQP 1.0 Delivery Annotations) The `delivery-annotations` property is an object that contains the custom properties of the AMQP 1.0 @@ -587,7 +655,7 @@ properties of the AMQP 1.0 The names of the properties MUST be of type `symbol` and MUST be unique. The values of the properties MAY be of any permitted type. -##### `header` (AMQP 1.0 Message Header) +###### `header` (AMQP 1.0 Message Header) The `header` property is an object that contains the properties of the AMQP 1.0 [Message Header][AMQP 1.0 Message Header] section. The @@ -601,7 +669,7 @@ following properties are defined, with type constraints: | `first-acquirer` | `boolean` | indicates whether the message has not been acquired previously | | `delivery-count` | `integer` | number of prior unsuccessful delivery attempts | -#### `footer` (AMQP 1.0 Message Footer) +###### `footer` (AMQP 1.0 Message Footer) The `footer` property is an object that contains the custom properties of the AMQP 1.0 [Message Footer][AMQP 1.0 Message Footer] section. @@ -609,13 +677,13 @@ AMQP 1.0 [Message Footer][AMQP 1.0 Message Footer] section. The names of the properties MUST be of type `symbol` and MUST be unique. The values of the properties MAY be of any permitted type. -### "MQTT/3.1.1" and "MQTT/5.0" +##### "MQTT/3.1.1" and "MQTT/5.0" bindings -The "MQTT/3.1.1" and "MQTT/5.0" formats are used to define messages that are +The "MQTT/3.1.1" and "MQTT/5.0" bindings are used to define messages that are sent over [MQTT 3.1.1][MQTT 3.1.1] or [MQTT 5.0][MQTT 5.0] connections. The format describes the [MQTT PUBLISH packet][MQTT 5.0] content. -The [`metadata`](#metadata-message-metadata) object contains the elements of the +The [`message`](#message-protocol-binding) object contains the elements of the MQTT PUBLISH packet directly, with the `user-properties` element corresponding to the application properties collection of other protocols. @@ -643,14 +711,14 @@ user-properties MAY contain placeholders using the [RFC6570][RFC6570] Level 1 URI Template syntax. When the same placeholder is used in multiple properties, the value of the placeholder is assumed to be identical. -The following example shows a message with the "MQTT/5.0" format, asking for +The following example shows a message with the "MQTT/5.0" binding, asking for QoS 1 delivery, with a topic name of "mytopic", and a user property of "my-application-property" with a value of "my-application-property-value": ```JSON { - "format": "MQTT/5.0", - "metadata": { + "binding": "MQTT/5.0", + "message": { "qos": { "value": 1 }, @@ -670,17 +738,18 @@ QoS 1 delivery, with a topic name of "mytopic", and a user property of } ``` -### "Kafka/0.11" format +### "Kafka" binding -The "Kafka" format is used to define messages that are sent over [Apache +The "Kafka" binding is used to define messages that are sent over [Apache Kafka][Apache Kafka] connections. The version number reflects the last version in which the record structure was changed in the Apache Kafka project, not the current version. If the version number is omitted, the latest version is assumed. -The [`metadata`](#metadata-message-metadata) object contains the common elements -of the Kafka [producer][Apache Kafka producer] and [consumer][Apache Kafka consumer] records, with the `headers` element corresponding to the application -properties collection of other protocols. +The [`message`](#message-protocol-binding) object contains the common elements +of the Kafka [producer][Apache Kafka producer] and +[consumer][Apache Kafka consumer] records, with the `headers` element +corresponding to the application properties collection of other protocols. The following properties are defined: @@ -701,8 +770,8 @@ Example: ```JSON { - "format": "Kafka/0.11", - "metadata": { + "binding": "Kafka", + "message": { "topic": { "value": "mytopic" }, diff --git a/schema/model.json b/schema/model.json index baa2443..07ec6a1 100644 --- a/schema/model.json +++ b/schema/model.json @@ -3,9 +3,9 @@ "json-schema/draft-07" ], "groups": { - "schemaGroups": { - "singular": "schemaGroup", - "plural": "schemaGroups", + "schemagroups": { + "singular": "schemagroup", + "plural": "schemagroups", "resources": { "schemas": { "singular": "schema", diff --git a/schema/schemas/document-schema.avsc b/schema/schemas/document-schema.avsc index f97e2c2..f6fcbd7 100644 --- a/schema/schemas/document-schema.avsc +++ b/schema/schemas/document-schema.avsc @@ -4,51 +4,51 @@ "namespace": "io.xregistry", "fields": [ { - "name": "schemaGroups", + "name": "schemagroups", "type": { "type": "map", "values": { "type": "record", - "name": "SchemaGroupType", + "name": "SchemagroupType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -58,14 +58,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -75,14 +75,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -100,43 +100,43 @@ "name": "SchemaType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -146,14 +146,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -163,14 +163,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -189,43 +189,43 @@ "name": "SchemaVersionType", "fields": [ { - "name": "Id", + "name": "id", "type": "string" }, { - "name": "Name", + "name": "name", "type": [ "string", "null" ] }, { - "name": "Epoch", + "name": "epoch", "type": [ "int", "null" ] }, { - "name": "Self", + "name": "self", "type": "string" }, { - "name": "Description", + "name": "description", "type": [ "string", "null" ] }, { - "name": "Documentation", + "name": "documentation", "type": [ "string", "null" ] }, { - "name": "Labels", + "name": "labels", "type": { "type": "map", "values": [ @@ -235,14 +235,14 @@ } }, { - "name": "CreatedBy", + "name": "createdby", "type": [ "string", "null" ] }, { - "name": "CreatedOn", + "name": "createdon", "type": [ { "type": "int", @@ -252,14 +252,14 @@ ] }, { - "name": "ModifiedBy", + "name": "modifiedby", "type": [ "string", "null" ] }, { - "name": "ModifiedOn", + "name": "modifiedon", "type": [ { "type": "int", @@ -270,7 +270,7 @@ }, { "type": "string", - "name": "Format", + "name": "format", "doc": "Schema format identifier for this schema version." }, { @@ -311,17 +311,17 @@ } ] }, - "name": "Schemaobject", + "name": "schemaobject", "doc": "Inlined schema document object" }, { "type": "string", - "name": "Schema", + "name": "schema", "doc": "Inlined schema document string" }, { "type": "string", - "name": "Schemaurl", + "name": "schemaurl", "doc": "Inlined schema document string" } ] @@ -332,11 +332,11 @@ "name": "SchemaVersionInfo", "fields": [ { - "name": "VersionsUrl", + "name": "versionsUrl", "type": "string" }, { - "name": "VersionCount", + "name": "versionCount", "type": "int" } ] diff --git a/schema/schemas/document-schema.json b/schema/schemas/document-schema.json index f05b785..6c48822 100644 --- a/schema/schemas/document-schema.json +++ b/schema/schemas/document-schema.json @@ -2,10 +2,10 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://xregistry.io/schema/schemagroups", "properties": { - "schemaGroups": { + "schemagroups": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/schemaGroup" + "$ref": "#/definitions/schemagroup" } } }, @@ -40,17 +40,17 @@ "type": "string", "description": "Schema format identifier for this schema version." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, @@ -102,17 +102,17 @@ "format": { "type": "string" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, @@ -146,7 +146,7 @@ } ] }, - "schemaGroup": { + "schemagroup": { "type": "object", "properties": { "id": { @@ -175,17 +175,17 @@ "format": { "type": "string" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, diff --git a/schema/schemas/openapi.json b/schema/schemas/openapi.json index 1112158..550c80a 100644 --- a/schema/schemas/openapi.json +++ b/schema/schemas/openapi.json @@ -81,21 +81,21 @@ } } }, - "/schemaGroups/{groupId}": { + "/schemagroups/{groupid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { - "operationId": "getSchemaGroup", + "operationId": "getSchemagroup", "responses": { "200": { "description": "The resource group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/schemaGroup" + "$ref": "#/components/schemas/schemagroup" } } } @@ -122,14 +122,14 @@ } } ], - "operationId": "putSchemaGroup", + "operationId": "putSchemagroup", "description": "creates or updates the resource group", "requestBody": { "description": "A request to create or update the discovery group's collection of groups with the given group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/schemaGroup" + "$ref": "#/components/schemas/schemagroup" } } } @@ -140,7 +140,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/schemaGroup" + "$ref": "#/components/schemas/schemagroup" } } } @@ -157,7 +157,7 @@ } }, "delete": { - "operationId": "deleteSchemaGroup", + "operationId": "deleteSchemagroup", "parameters": [ { "in": "query", @@ -184,14 +184,14 @@ } } }, - "/schemaGroups/{groupId}/schemas": { + "/schemagroups/{groupid}/schemas": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" } ], "get": { - "operationId": "getSchemaGroupSchemasAll", + "operationId": "getSchemagroupSchemasAll", "description": "Get an optionally filtered collection of resources", "parameters": [ { @@ -259,13 +259,13 @@ } } }, - "/schemaGroups/{groupId}/schemas/{resourceId}": { + "/schemagroups/{groupid}/schemas/{resourceid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { "in": "query", @@ -278,7 +278,7 @@ } ], "get": { - "operationId": "getSchemaGroupSchema", + "operationId": "getSchemagroupSchema", "responses": { "200": { "description": "The corresponding resource", @@ -377,7 +377,7 @@ ], "summary": "Create or update a resource", "description": "Create a resource. ", - "operationId": "putSchemaGroupSchema", + "operationId": "putSchemagroupSchema", "requestBody": { "description": "The resource to be created/updated", "content": { @@ -417,7 +417,7 @@ "post": { "summary": "Post new resource version", "description": "Register resource version If resource of specified name does not exist in specified group, resource and resource version is created at version 1. If resource of specified name exists already in specified group, resource is created at latest version + 1. If resource with identical content already exists, existing resource's ID is returned. \n", - "operationId": "postSchemaGroupSchema", + "operationId": "postSchemagroupSchema", "parameters": [ { "$ref": "#/components/parameters/resource-description" @@ -525,7 +525,7 @@ "delete": { "summary": "Delete resource", "description": "Delete resource", - "operationId": "deleteSchemaGroupSchema", + "operationId": "deleteSchemagroupSchema", "parameters": [ { "in": "query", @@ -552,17 +552,17 @@ } } }, - "/schemaGroups/{groupId}/schemas/{resourceId}/versions": { + "/schemagroups/{groupid}/schemas/{resourceid}/versions": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" } ], "get": { - "operationId": "getSchemaGroupSchemaVersionsAll", + "operationId": "getSchemagroupSchemaVersionsAll", "description": "Get an optionally filtered collection of versions", "parameters": [ { @@ -620,16 +620,16 @@ } } }, - "/schemaGroups/{groupId}/schemas/{resourceId}/versions/{versionId}": { + "/schemagroups/{groupid}/schemas/{resourceid}/versions/{versionid}": { "parameters": [ { - "$ref": "#/components/parameters/groupId" + "$ref": "#/components/parameters/groupid" }, { - "$ref": "#/components/parameters/resourceId" + "$ref": "#/components/parameters/resourceid" }, { - "$ref": "#/components/parameters/versionId" + "$ref": "#/components/parameters/versionid" }, { "in": "query", @@ -643,7 +643,7 @@ } ], "get": { - "operationId": "getSchemaGroupSchemaVersion", + "operationId": "getSchemagroupSchemaVersion", "description": "Gets the document stored for the schema version", "responses": { "200": { @@ -722,7 +722,7 @@ } } ], - "operationId": "updateSchemaGroupSchemaVersion", + "operationId": "updateSchemagroupSchemaVersion", "description": "Updates the metadata for the schema version", "requestBody": { "description": "The schema version document", @@ -770,7 +770,7 @@ } } ], - "operationId": "deleteSchemaGroupSchemaVersion", + "operationId": "deleteSchemagroupSchemaVersion", "responses": { "204": { "description": "Ok" @@ -823,9 +823,9 @@ "format": "uri-reference" } }, - "groupId": { + "groupid": { "in": "path", - "name": "groupId", + "name": "groupid", "description": "The id of the group", "required": true, "schema": { @@ -834,9 +834,9 @@ "format": "uri-reference" } }, - "resourceId": { + "resourceid": { "in": "path", - "name": "resourceId", + "name": "resourceid", "description": "The id of the schema", "required": true, "schema": { @@ -845,9 +845,9 @@ "format": "uri-reference" } }, - "versionId": { + "versionid": { "in": "path", - "name": "versionId", + "name": "versionid", "description": "The id of the schema", "required": true, "schema": { @@ -1096,10 +1096,10 @@ "document": { "type": "object", "properties": { - "schemaGroups": { + "schemagroups": { "type": "object", "additionalProperties": { - "$ref": "#/components/schemas/schemaGroup" + "$ref": "#/components/schemas/schemagroup" } } } @@ -1134,17 +1134,17 @@ "type": "string", "description": "Schema format identifier for this schema version." }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, @@ -1196,17 +1196,17 @@ "format": { "type": "string" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, @@ -1240,7 +1240,7 @@ } ] }, - "schemaGroup": { + "schemagroup": { "type": "object", "properties": { "id": { @@ -1269,17 +1269,17 @@ "format": { "type": "string" }, - "createdBy": { + "createdby": { "type": "string" }, - "createdOn": { + "createdon": { "type": "string", "format": "date-time" }, - "modifiedBy": { + "modifiedby": { "type": "string" }, - "modifiedOn": { + "modifiedon": { "type": "string", "format": "date-time" }, diff --git a/tools/schema-generator.py b/tools/schema-generator.py index 52fad43..7758d0f 100644 --- a/tools/schema-generator.py +++ b/tools/schema-generator.py @@ -1,4 +1,5 @@ import argparse +import copy import json import os import re @@ -39,24 +40,24 @@ "documentation": {"type": "string", "format": "uri"}, "labels": {"type": "object"}, "format": {"type": "string"}, - "createdBy": {"type": "string"}, - "createdOn": {"type": "string", "format": "date-time"}, - "modifiedBy": {"type": "string"}, - "modifiedOn": {"type": "string", "format": "date-time"} + "createdby": {"type": "string"}, + "createdon": {"type": "string", "format": "date-time"}, + "modifiedby": {"type": "string"}, + "modifiedon": {"type": "string", "format": "date-time"} } avro_common_attributes = [ - {"name": "Id", "type": "string"}, - {"name": "Name", "type": ["string", "null"]}, - {"name": "Epoch", "type": ["int", "null"]}, - {"name": "Self", "type": "string"}, - {"name": "Description", "type": ["string", "null"]}, - {"name": "Documentation", "type": ["string", "null"]}, - {"name": "Labels", "type": { "type": "map", "values": ["string", "null"]}}, - {"name": "CreatedBy", "type": ["string", "null"]}, - {"name": "CreatedOn", "type": [{"type":"int", "logicalType": "time-millis"}, "null"]}, - {"name": "ModifiedBy", "type": ["string", "null"]}, - {"name": "ModifiedOn", "type": [{"type":"int", "logicalType": "time-millis"},"null"]} + {"name": "id", "type": "string"}, + {"name": "name", "type": ["string", "null"]}, + {"name": "epoch", "type": ["int", "null"]}, + {"name": "self", "type": "string"}, + {"name": "description", "type": ["string", "null"]}, + {"name": "documentation", "type": ["string", "null"]}, + {"name": "labels", "type": { "type": "map", "values": ["string", "null"]}}, + {"name": "createdby", "type": ["string", "null"]}, + {"name": "createdon", "type": [{"type":"int", "logicalType": "time-millis"}, "null"]}, + {"name": "modifiedby", "type": ["string", "null"]}, + {"name": "modifiedon", "type": [{"type":"int", "logicalType": "time-millis"},"null"]} ] avro_generic_record_name = "GenericRecord" @@ -119,6 +120,10 @@ def pascal(string): result = ''.join(word.capitalize() for word in words) return result +def camel(string): + pascalString = pascal(string) + return pascalString[0:1].lower() + pascalString[1:] + def generate_openapi(model_definition): @@ -164,67 +169,67 @@ def replace_ops(schema_fragment: dict, expression: str, reference: str): path = "/{%-groupNamePlural-%}" path_template = openapi["paths"][path] for _, group in model_definition.get("groups", {}).items(): - path_template_copy = json.loads(json.dumps(path_template)) + path_template_copy = copy.deepcopy(path_template) replace_refs(path_template_copy, "{%-groupTypeReference-%}", f"#/components/schemas/{group['singular']}") replace_ops(path_template_copy, "{%-groupNamePlural-%}", f"{pascal(group['plural'])}") openapi["paths"][f"/{group['plural']}"]: path_template_copy openapi["paths"].pop(path) - path = "/{%-groupNamePlural-%}/{groupId}" + path = "/{%-groupNamePlural-%}/{groupid}" group_template = openapi["paths"][path] for _, group in model_definition.get("groups", {}).items(): - group_template_copy = json.loads(json.dumps(group_template)) + group_template_copy = copy.deepcopy(group_template) replace_refs(group_template_copy, "{%-groupTypeReference-%}", f"#/components/schemas/{group['singular']}") replace_ops(group_template_copy, "{%-groupNameSingular-%}", f"{pascal(group['singular'])}") - openapi["paths"][f"/{group['plural']}/{{groupId}}"] = group_template_copy + openapi["paths"][f"/{group['plural']}/{{groupid}}"] = group_template_copy openapi["paths"].pop(path) - path = "/{%-groupNamePlural-%}/{groupId}/{%-resourceNamePlural-%}" + path = "/{%-groupNamePlural-%}/{groupid}/{%-resourceNamePlural-%}" resource_template = openapi["paths"][path] for _, group in model_definition.get("groups", {}).items(): for _, resource in group.get("resources", {}).items(): resource = resolve_resource(group, resource) - resource_template_copy = json.loads(json.dumps(resource_template)) + resource_template_copy = copy.deepcopy(resource_template) replace_refs(resource_template_copy, "{%-resourceTypeReference-%}", f"#/components/schemas/{resource['singular']}") replace_refs(resource_template_copy, "{%-groupTypeReference-%}", f"#/components/schemas/{group['singular']}") replace_ops(resource_template_copy, "{%-resourceNamePlural-%}", f"{pascal(group['singular'])}{pascal(resource['plural'])}") - openapi["paths"][f"/{group['plural']}/{{groupId}}/{resource['plural']}"]= resource_template_copy + openapi["paths"][f"/{group['plural']}/{{groupid}}/{resource['plural']}"]= resource_template_copy openapi["paths"].pop(path) - path = "/{%-groupNamePlural-%}/{groupId}/{%-resourceNamePlural-%}/{resourceId}" + path = "/{%-groupNamePlural-%}/{groupid}/{%-resourceNamePlural-%}/{resourceid}" resourceid_template = openapi["paths"][path] for _, group in model_definition.get("groups", {}).items(): for _, resource in group.get("resources", {}).items(): resource = resolve_resource(group, resource) - resourceid_template_copy = json.loads(json.dumps(resourceid_template)) + resourceid_template_copy = copy.deepcopy(resourceid_template) replace_refs(resourceid_template_copy, "{%-resourceTypeReference-%}", f"#/components/schemas/{resource['singular']}") replace_refs(resourceid_template_copy, "{%-groupTypeReference-%}", f"#/components/schemas/{group['singular']}") replace_ops(resourceid_template_copy, "{%-resourceNameSingular-%}", f"{pascal(group['singular'])}{pascal(resource['singular'])}") - openapi["paths"][f"/{group['plural']}/{{groupId}}/{resource['plural']}/{{resourceId}}"]= resourceid_template_copy + openapi["paths"][f"/{group['plural']}/{{groupid}}/{resource['plural']}/{{resourceid}}"]= resourceid_template_copy openapi["paths"].pop(path) - path = "/{%-groupNamePlural-%}/{groupId}/{%-resourceNamePlural-%}/{resourceId}/versions" + path = "/{%-groupNamePlural-%}/{groupid}/{%-resourceNamePlural-%}/{resourceid}/versions" versions_template = openapi["paths"][path] for _, group in model_definition.get("groups", {}).items(): for _, resource in group.get("resources", {}).items(): resource = resolve_resource(group, resource) - versions_template_copy = json.loads(json.dumps(versions_template)) + versions_template_copy = copy.deepcopy(versions_template) replace_refs(versions_template_copy, "{%-resourceTypeReference-%}", f"#/components/schemas/{resource['singular']}") replace_refs(versions_template_copy, "{%-groupTypeReference-%}", f"#/components/schemas/{group['singular']}") replace_ops(versions_template_copy, "{%-resourceNameSingular-%}", f"{pascal(group['singular'])}{pascal(resource['singular'])}") - openapi["paths"][f"/{group['plural']}/{{groupId}}/{resource['plural']}/{{resourceId}}/versions"]= versions_template_copy + openapi["paths"][f"/{group['plural']}/{{groupid}}/{resource['plural']}/{{resourceid}}/versions"]= versions_template_copy openapi["paths"].pop(path) - path = "/{%-groupNamePlural-%}/{groupId}/{%-resourceNamePlural-%}/{resourceId}/versions/{versionId}" + path = "/{%-groupNamePlural-%}/{groupid}/{%-resourceNamePlural-%}/{resourceid}/versions/{versionid}" versionid_template = openapi["paths"][path] for _, group in model_definition.get("groups", {}).items(): for _, resource in group.get("resources", {}).items(): resource = resolve_resource(group, resource) - versionid_template_copy = json.loads(json.dumps(versionid_template)) + versionid_template_copy = copy.deepcopy(versionid_template) replace_refs(versionid_template_copy, "{%-resourceTypeReference-%}", f"#/components/schemas/{resource['singular']}") replace_refs(versionid_template_copy, "{%-groupTypeReference-%}", f"#/components/schemas/{group['singular']}") replace_ops(versionid_template_copy, "{%-resourceNameSingular-%}", f"{pascal(group['singular'])}{pascal(resource['singular'])}") - openapi["paths"][f"/{group['plural']}/{{groupId}}/{resource['plural']}/{{resourceId}}/versions/{{versionId}}"]= versionid_template_copy + openapi["paths"][f"/{group['plural']}/{{groupid}}/{resource['plural']}/{{resourceid}}/versions/{{versionid}}"]= versionid_template_copy openapi["paths"].pop(path) return openapi @@ -245,54 +250,52 @@ def generate_json_schema(model_definition, for_openapi=False) -> dict: dict: The generated JSON schema. """ + def handle_item(resource_schema, type, item): + if type == "object": + resource_schema["type"] = "object" + if "attributes" in item: + handle_attributes(resource_schema, item["attributes"]) + elif type == "map": + resource_schema["type"] = "object" + if "type" in item: + resource_schema["additionalProperties"] = copy.deepcopy(json_type_mapping[item["type"]]) + if item["type"] == "object" or item["type"] == "map" or item["type"] == "array": + if "item" in item: + handle_item(resource_schema["additionalProperties"], item["type"], item["item"]) + elif type == "array": + resource_schema["type"] = "array" + if "type" in item: + resource_schema["items"] = copy.deepcopy(json_type_mapping[item["type"]]) + if item["type"] == "object" or item["type"] == "map" or item["type"] == "array": + if "item" in item: + handle_item(resource_schema["items"], item["type"], item["item"]) + + def handle_attributes(resource_schema, attributes): """ This function takes in a resource schema and a dictionary of attributes and their properties. It iterates through each attribute and creates a JSON schema for it based on its properties. - The function also handles nested attributes and conditional attributes using the "ifValue" property. + The function also handles nested attributes and conditional attributes using the "ifvalue" property. The resulting schema is added to the resource schema. """ for attr_name, attr_props in attributes.items(): - attr_schema = json.loads(json.dumps(json_type_mapping[attr_props["type"]])) + attr_schema = copy.deepcopy(json_type_mapping[attr_props["type"]]) if "description" in attr_props: attr_schema["description"] = attr_props["description"] + + if attr_props["type"] == "object" or attr_props["type"] == "map" or attr_props["type"] == "array": + if "item" in attr_props: + handle_item(attr_schema, attr_props["type"], attr_props["item"]) + if "required" in attr_props and attr_props["required"] == True: if "required" not in resource_schema: resource_schema["required"] = [] resource_schema["required"].append(attr_name) - - if attr_schema["type"] == "object" or attr_schema["type"] == "map": - if "attributes" in attr_props: - item_schema = { "properties": {}, "required": []} - handle_attributes(item_schema, attr_props["attributes"]) - if len(item_schema["required"]) == 0: - item_schema.pop("required") - if "itemType" in attr_props and attr_props["itemType"] == "object": - attr_schema["additionalProperties"] = item_schema - else: - attr_schema["properties"] = item_schema["properties"] - if "required" in item_schema: - attr_schema["required"] = item_schema["required"] - if "additionalProperties" in item_schema: - attr_schema["additionalProperties"] = item_schema["additionalProperties"] - if "oneOf" in item_schema: - attr_schema["oneOf"] = item_schema["oneOf"] - - - if attr_schema["type"] == "array" and "itemType" in attr_props: - if attr_props["itemType"] == "object" and "attributes" in attr_props: - item_schema = { "properties": {}, "required": []} - handle_attributes(item_schema, attr_props["attributes"]) - if len(item_schema["required"]) == 0: - item_schema.pop("required") - attr_schema["items"] = item_schema - else: - attr_schema["items"] = json.loads(json.dumps(json_type_mapping[attr_props["itemType"]])) - - if "ifValue" in attr_props: + + if "ifvalue" in attr_props: if attr_name == "*": - raise Exception("Can't use wild card attribute name with ifValue") + raise Exception("Can't use wild card attribute name with ifvalue") if for_openapi: resource_schema["discriminator"] = { @@ -302,35 +305,48 @@ def handle_attributes(resource_schema, attributes): if attr_name in resource_schema["properties"]: resource_schema["properties"].pop(attr_name) - resource_schema["required"].remove(attr_name) + if "required" in resource_schema and attr_name in resource_schema["required"]: + resource_schema["required"].remove(attr_name) one_of = [] - for condition_value, condition_props in attr_props["ifValue"].items(): + for condition_value, condition_props in attr_props["ifvalue"].items(): # create an identifier from condition_value, turning all spaces and special characters in to underscore condition_schema_identifier = attr_name + "_" + "".join([c if c.isalnum() else "_" for c in condition_value]) # for openapi, add a reference to this schema in the discriminator mapping if for_openapi: resource_schema["discriminator"]["mapping"][condition_value] = f"#/components/schemas/{condition_schema_identifier}" - conditional_attr_schema = json.loads(json.dumps(attr_schema)) + conditional_attr_schema = copy.deepcopy(attr_schema) conditional_attr_schema.update({ "enum": [condition_value], }) - conditional_schema = { - "properties": { - attr_name: conditional_attr_schema - }, - "required": [attr_name] - } - handle_attributes(conditional_schema, condition_props.get("siblingAttributes", {})) + if "siblingattributes" in condition_props: + conditional_schema = { + "properties": { + attr_name: conditional_attr_schema + }, + "required": [attr_name] + } + handle_attributes(conditional_schema, condition_props.get("siblingattributes", {})) + else: + conditional_attr_schema.update({ + "default": condition_value + }) + conditional_schema = { + "properties": { + attr_name: conditional_attr_schema + }, + } + if for_openapi: resource_schema["discriminator"]["mapping"][condition_value] = f"#/components/schemas/{condition_schema_identifier}" - schema_definitions[condition_schema_identifier] = conditional_schema + schema_definitions[condition_schema_identifier] = copy.deepcopy(conditional_schema) else: - one_of.append(conditional_schema) + one_of.append(copy.deepcopy(conditional_schema)) if len(one_of) > 0: - if "oneOf" in attr_schema: - resource_schema["oneOf"].extend(one_of) + if "oneOf" in resource_schema: + resource_schema["allOf"] = [{"oneOf" : resource_schema.pop("oneOf")}] + resource_schema["allOf"].append({"oneOf": one_of}) else: resource_schema["oneOf"] = one_of else: @@ -338,9 +354,11 @@ def handle_attributes(resource_schema, attributes): if "additionalProperties" in resource_schema: resource_schema["additionalProperties"].update(attr_schema) else: - resource_schema["additionalProperties"] = attr_schema + resource_schema["additionalProperties"] = copy.deepcopy(attr_schema) else: - resource_schema["properties"][attr_name] = attr_schema + if not "properties" in resource_schema: + resource_schema["properties"] = {} + resource_schema["properties"][attr_name] = copy.deepcopy(attr_schema) ## body of the core function starts here @@ -391,13 +409,13 @@ def handle_attributes(resource_schema, attributes): resource_schema = { "type": "object", - "properties": json.loads(json.dumps(json_common_attributes)), + "properties": copy.deepcopy(json_common_attributes), "required": ["id"], } attributes = resource.get("attributes", {}) if resource.get("versions", 1) != 1: - resource_version_schema = json.loads(json.dumps(resource_schema)) + resource_version_schema = copy.deepcopy(resource_schema) handle_attributes(resource_version_schema, attributes) resource_schema["oneOf"] = [ @@ -431,7 +449,7 @@ def handle_attributes(resource_schema, attributes): group_schema = { "type": "object", - "properties": json.loads(json.dumps(json_common_attributes)), + "properties": copy.deepcopy(json_common_attributes), "required": ["id"], } attributes = group.get("attributes", {}) @@ -457,61 +475,76 @@ def generate_avro_schema(model_definition) -> dict: avro_generic_record_emitted = False record_types = set() + def handle_item(resource_schema, type, item, name, prefix): + if type == "object": + if "attributes" in item: + item_schema = { "type": "record", "name" : prefix+name+"Type", "fields": []} + handle_attributes(item_schema, item["attributes"], prefix) + resource_schema["type"] = item_schema + else: + if avro_generic_record_emitted: + resource_schema["type"] = avro_generic_record_name + else: + resource_schema["type"] = copy.deepcopy(avro_generic_record) + avro_generic_record_emitted = True + elif type == "map": + resource_schema["type"] = { "type": "map", "name": prefix+name+"Type","values": "" } + if "type" in item: + item_schema = copy.deepcopy(avro_type_mapping[item["type"]]) + if item["type"] == "object" or item["type"] == "map" or item["type"] == "array": + if "item" in item: + handle_item(item_schema, item["type"], item["item"], name+"Item", prefix) + resource_schema["type"]["values"] = item_schema["type"] + else: + raise Exception("Map item must have a type specified") + elif type == "array": + resource_schema["type"] = { "type": "array", "name": prefix+name+"ArrayType", "items": "" } + if "type" in item: + item_schema = copy.deepcopy(avro_type_mapping[item["type"]]) + if item["type"] == "object" or item["type"] == "map" or item["type"] == "array": + if "item" in item: + handle_item(item_schema, item["type"], item["item"], name, prefix) + resource_schema["type"]["items"] = item_schema["type"] + else: + resource_schema["type"]["items"] = item_schema + else: + raise Exception("Array item must have a type specified") + + def handle_attributes(resource_schema, attributes, type_prefix=""): nonlocal avro_generic_record_emitted for attr_name, attr_props in attributes.items(): pascal_attr_name=pascal(attr_name) # attribute schema is based on the type mapping - attr_schema = json.loads(json.dumps(avro_type_mapping[attr_props["type"]])) + attr_schema = copy.deepcopy(avro_type_mapping[attr_props["type"]]) if attr_name != "*": attr_schema["name"] = type_prefix+pascal_attr_name+"Type" # add the description, if any, as a doc attribute if "description" in attr_props: attr_schema["doc"] = attr_props["description"] - if attr_props["type"] == "object": - if "attributes" in attr_props: - item_schema = { "type": "record", "name" : type_prefix+pascal_attr_name+"Type", "fields": []} - handle_attributes(item_schema, attr_props["attributes"], type_prefix) - attr_schema["type"] = item_schema + if attr_props["type"] == "object" or attr_props["type"] == "map" or attr_props["type"] == "array": + if "item" in attr_props: + handle_item(attr_schema, attr_props["type"], attr_props["item"], pascal_attr_name, type_prefix) else: - if avro_generic_record_emitted: - attr_schema["type"] = avro_generic_record_name - else: - attr_schema["type"] = json.loads(json.dumps(avro_generic_record)) - avro_generic_record_emitted = True - elif attr_props["type"] == "map": - if "attributes" in attr_props: - item_schema = { "type": "record", "name" : type_prefix+pascal_attr_name+"ItemType", "fields": []} - handle_attributes(item_schema, attr_props["attributes"], type_prefix) - item_schema = { "type": "map", "name" : type_prefix+pascal_attr_name+"Type", "values": item_schema } - attr_schema["type"] = item_schema - - - if attr_props["type"] == "array" and "itemType" in attr_props: - if attr_props["itemType"] == "object": - if "attributes" in attr_props: - item_schema = { "type": "record", "name" : type_prefix+pascal_attr_name+"Type", "fields": []} - handle_attributes(item_schema, attr_props["attributes"], type_prefix) - attr_schema["type"]["items"] = item_schema - else: + if attr_props["type"] == "object": if avro_generic_record_emitted: - attr_schema["type"]["items"] = avro_generic_record_name + attr_schema["type"] = avro_generic_record_name else: - attr_schema["type"]["items"] = json.loads(json.dumps(avro_generic_record)) + attr_schema["type"] = copy.deepcopy(avro_generic_record) avro_generic_record_emitted = True - else: - attr_schema["type"]["items"] = json.loads(json.dumps(avro_type_mapping[attr_props["itemType"]])) + else: + raise Exception("array or map attribute must have an item specified") - if "ifValue" in attr_props: + if "ifvalue" in attr_props: if attr_name == "*": - raise Exception("Can't use wild card attribute name with ifValue") + raise Exception("Can't use wild card attribute name with ifvalue") if pascal_attr_name in resource_schema["fields"]: resource_schema["fields"].pop(pascal_attr_name) union = [] - for condition_value, condition_props in attr_props["ifValue"].items(): + for condition_value, condition_props in attr_props["ifvalue"].items(): # create an identifier from condition_value, turning all spaces and special characters in to underscore condition_schema_identifier = pascal_attr_name + pascal("".join([c if c.isalnum() else "_" for c in condition_value])) conditional_schema = { @@ -519,11 +552,11 @@ def handle_attributes(resource_schema, attributes, type_prefix=""): "name": type_prefix+condition_schema_identifier+"Type", "fields": [] } - handle_attributes(conditional_schema, condition_props.get("siblingAttributes", {}), condition_schema_identifier) + handle_attributes(conditional_schema, condition_props.get("siblingattributes", {}), condition_schema_identifier) union.append(conditional_schema) if len(union) > 0: field_schema = { - "name": pascal_attr_name, + "name": camel(pascal_attr_name), "type": union } if "description" in attr_props: @@ -545,7 +578,7 @@ def handle_attributes(resource_schema, attributes, type_prefix=""): field_schema["doc"] = attr_props["description"] resource_schema["fields"].append(field_schema) else: - attr_schema["name"] = pascal_attr_name + attr_schema["name"] = camel(pascal_attr_name) # if the attribute is not required, union the type with null #if not "required" in attr_props or attr_props["required"] == False: # attr_schema = ["null", attr_schema] @@ -572,7 +605,7 @@ def handle_attributes(resource_schema, attributes, type_prefix=""): resource_name = resource["singular"] if resource_name in record_types: resource_collection_fields.append({ - "name": resource["plural"], + "name": camel(resource["plural"]), "type" :{ "type": "map", "values": pascal(resource_name)+"Type" @@ -583,11 +616,11 @@ def handle_attributes(resource_schema, attributes, type_prefix=""): resource_schema = { "type": "record", "name": pascal(resource_name)+"Type", - "fields": json.loads(json.dumps(avro_common_attributes)) + "fields": copy.deepcopy(avro_common_attributes) } attributes = resource.get("attributes", {}) if resource.get("versions", 1) != 1: - resource_version_schema = json.loads(json.dumps(resource_schema)) + resource_version_schema = copy.deepcopy(resource_schema) handle_attributes(resource_version_schema, attributes) resource_version_schema["name"] = pascal(resource_name)+"VersionType" resource_schema["fields"].append( @@ -603,11 +636,11 @@ def handle_attributes(resource_schema, attributes, type_prefix=""): "name": pascal(resource_name)+"VersionInfo", "fields": [ { - "name": "VersionsUrl", + "name": "versionsUrl", "type": "string" }, { - "name": "VersionCount", + "name": "versionCount", "type": "int" } ] @@ -618,7 +651,7 @@ def handle_attributes(resource_schema, attributes, type_prefix=""): handle_attributes(resource_schema, attributes) resource_collection_fields.append({ - "name": resource["plural"], + "name": camel(resource["plural"]), "type" :{ "type": "map", "values": resource_schema @@ -629,14 +662,14 @@ def handle_attributes(resource_schema, attributes, type_prefix=""): group_schema = { "type": "record", "name": pascal(group_name)+"Type", - "fields": json.loads(json.dumps(avro_common_attributes)), + "fields": copy.deepcopy(avro_common_attributes), } attributes = group.get("attributes", {}) handle_attributes(group_schema, attributes) for resource_collection in resource_collection_fields: group_schema["fields"].append(resource_collection) groups_schema = { - "name": groups_name, + "name": camel(groups_name), "type": { "type": "map", "values": group_schema