objectTypeClass() {
+ return Server.class;
+ }
+
+ @Override
+ public Class> referenceClass() {
+ return Reference.class;
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/AsyncAPI.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/AsyncAPI.java
new file mode 100644
index 00000000..716b5338
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/AsyncAPI.java
@@ -0,0 +1,116 @@
+package com.asyncapi.v2._6_0.model;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._6_0.model.channel.ChannelItem;
+import com.asyncapi.v2._6_0.model.component.Components;
+import com.asyncapi.v2._6_0.model.info.Info;
+import com.asyncapi.v2._6_0.model.server.Server;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This is the root document object for the API specification.
+ * It combines resource listing and API declaration together into one document.
+ *
+ * @version 2.6.0
+ * @see AsyncAPI
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class AsyncAPI extends ExtendableObject {
+
+ /**
+ * Required.
+ *
+ * Specifies the AsyncAPI Specification version being used.
+ * It can be used by tooling Specifications and clients to interpret the version.
+ * The structure shall be major.minor.patch, where patch versions must be compatible
+ * with the existing major.minor tooling.
+ *
+ * Typically patch versions will be introduced to address errors in the documentation,
+ * and tooling should typically be compatible with the corresponding major.minor (1.0.*).
+ * Patch versions will correspond to patches of this document.
+ */
+ @NotNull
+ private String asyncapi = "2.6.0";
+
+ /**
+ * Identifier of the application the AsyncAPI document is defining.
+ *
+ * This field represents a unique universal identifier of the application the AsyncAPI document is defining.
+ * It must conform to the URI format, according to RFC3986 .
+ *
+ * It is RECOMMENDED to use a URN to globally and uniquely identify the application during long periods of time,
+ * even after it becomes unavailable or ceases to exist.
+ */
+ @Nullable
+ private String id;
+
+ /**
+ * Required.
+ *
+ * Provides metadata about the API. The metadata can be used by the clients if needed.
+ */
+ @NotNull
+ private Info info;
+
+ /**
+ * TODO: references
+ * Provides connection details of servers.
+ */
+ @Nullable
+ private Map servers;
+
+ /**
+ * A string representing the default content type to use when encoding/decoding a message's payload.
+ * The value MUST be a specific media type (e.g. application/json).
+ * This value MUST be used by schema parsers when the contentType property is omitted.
+ *
+ * In case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.
+ */
+ @Nullable
+ private String defaultContentType;
+
+ /**
+ * Required.
+ *
+ * The available channels and messages for the API.
+ *
+ * Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.
+ *
+ * Channels are also known as "topics", "routing keys", "event types" or "paths".
+ */
+ @NotNull
+ private Map channels;
+
+ /**
+ * An element to hold various schemas for the specification.
+ */
+ @Nullable
+ private Components components;
+
+ /**
+ * A list of tags used by the specification with additional metadata. Each tag name in the list MUST be unique.
+ */
+ @Nullable
+ private List tags;
+
+ /**
+ * Additional external documentation.
+ */
+ @Nullable
+ private ExternalDocumentation externalDocs;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/ExternalDocumentation.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/ExternalDocumentation.java
new file mode 100644
index 00000000..2d4e58ad
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/ExternalDocumentation.java
@@ -0,0 +1,40 @@
+package com.asyncapi.v2._6_0.model;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Allows referencing an external resource for extended documentation.
+ *
+ * @version 2.6.0
+ * @see ExternalDocumentation
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ExternalDocumentation extends ExtendableObject {
+
+ /**
+ * A short description of the target documentation. CommonMark syntax can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * Required.
+ *
+ * The URL for the target documentation. Value MUST be in the format of a URL.
+ */
+ @NotNull
+ private String url;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/Reference.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/Reference.java
new file mode 100644
index 00000000..c5ef3856
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/Reference.java
@@ -0,0 +1,40 @@
+package com.asyncapi.v2._6_0.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * A simple object to allow referencing other components in the specification, internally and externally.
+ *
+ * The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules.
+ * A JSON Reference SHALL only be used to refer to a schema that is formatted in either JSON or YAML.
+ * In the case of a YAML-formatted Schema, the JSON Reference SHALL be applied to the JSON representation of
+ * that schema. The JSON representation SHALL be made by applying the conversion described here .
+ *
+ * For this specification, reference resolution is done as defined by the JSON Reference specification and not by
+ * the JSON Schema specification.
+ *
+ * @version 2.6.0
+ * @see Reference
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@EqualsAndHashCode
+@NoArgsConstructor
+@AllArgsConstructor
+public class Reference {
+
+ /**
+ * Required.
+ *
+ * The reference string.
+ */
+ @NotNull
+ @JsonProperty(value = "$ref")
+ private String ref;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/Tag.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/Tag.java
new file mode 100644
index 00000000..565aa50f
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/Tag.java
@@ -0,0 +1,44 @@
+package com.asyncapi.v2._6_0.model;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Allows adding meta data to a single tag.
+ *
+ * @version 2.6.0
+ * @see Tag
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class Tag extends ExtendableObject {
+
+ /**
+ * Required. The name of the tag.
+ */
+ @NotNull
+ private String name;
+
+ /**
+ * A short description for the tag. CommonMark syntax can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * Additional external documentation for this tag.
+ */
+ @Nullable
+ private ExternalDocumentation externalDocs;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/ChannelItem.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/ChannelItem.java
new file mode 100644
index 00000000..787d651c
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/ChannelItem.java
@@ -0,0 +1,97 @@
+package com.asyncapi.v2._6_0.model.channel;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._6_0.jackson.model.channel.ChannelParametersDeserializer;
+import com.asyncapi.v2._6_0.model.channel.operation.Operation;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import com.asyncapi.v2.jackson.binding.channel.ChannelBindingsDeserializer;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Describes the operations available on a single channel.
+ *
+ * @version 2.6.0
+ * @see ChannelItem
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ChannelItem extends ExtendableObject {
+
+ /**
+ * Allows for a referenced definition of this channel item. The referenced structure MUST be in the form of a {@link com.asyncapi.v2._6_0.model.channel.ChannelItem} Object.
+ * In case a Channel Item Object field appears both in the defined object and the referenced object, the behavior is undefined.
+ * Resolution is done as defined by the JSON Reference .
+ *
+ * Deprecated: Usage of the $ref property has been deprecated.
+ */
+ @Nullable
+ @JsonProperty("$ref")
+ private String ref;
+
+ /**
+ * An optional description of this channel item. CommonMark syntax can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * The servers on which this channel is available, specified as an optional unordered list of names (string keys) of {@link com.asyncapi.v2._6_0.model.server.Server} Objects defined in the {@link com.asyncapi.v2._6_0.model.server.Server} Object (a map).
+ * If servers is absent or empty then this channel must be available on all servers defined in the Servers Object.
+ */
+ @Nullable
+ private List servers;
+
+ /**
+ * A definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.
+ */
+ @Nullable
+ private Operation subscribe;
+
+ /**
+ * A definition of the PUBLISH operation.
+ */
+ @Nullable
+ private Operation publish;
+
+ /**
+ * A map of the parameters included in the channel name.
+ * It SHOULD be present only when using channels with expressions (as defined by RFC 6570 section 2.2 ).
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.channel.Parameter}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ChannelParametersDeserializer.class)
+ private Map parameters;
+
+ /**
+ * A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the channel.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link ChannelBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ChannelBindingsDeserializer.class)
+ private Map bindings;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/Parameter.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/Parameter.java
new file mode 100644
index 00000000..16f2a618
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/Parameter.java
@@ -0,0 +1,55 @@
+package com.asyncapi.v2._6_0.model.channel;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._6_0.jackson.model.schema.SchemaDeserializer;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes a parameter included in a channel name.
+ *
+ * @version 2.6.0
+ * @see Parameter
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class Parameter extends ExtendableObject {
+
+ /**
+ * A verbose explanation of the parameter. CommonMark syntax can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * Definition of the parameter.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2.schema.Schema}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = SchemaDeserializer.class)
+ private Object schema;
+
+ /**
+ * A runtime expression that specifies the location of the parameter value.
+ *
+ * Even when a definition for the target field exists, it MUST NOT be used to validate this parameter but, instead,
+ * the schema property MUST be used.
+ */
+ @Nullable
+ private String location;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/CorrelationId.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/CorrelationId.java
new file mode 100644
index 00000000..66bf407e
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/CorrelationId.java
@@ -0,0 +1,42 @@
+package com.asyncapi.v2._6_0.model.channel.message;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * An object that specifies an identifier at design time that can used for message tracing and correlation.
+ *
+ * For specifying and computing the location of a Correlation ID, a runtime expression is used.
+ *
+ * @version 2.6.0
+ * @see CorrelationId
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class CorrelationId extends ExtendableObject {
+
+ /**
+ * An optional description of the identifier. CommonMark syntax can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * REQUIRED.
+ *
+ * A runtime expression that specifies the location of the correlation ID.
+ */
+ @NotNull
+ private String location;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/Message.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/Message.java
new file mode 100644
index 00000000..eec867c6
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/Message.java
@@ -0,0 +1,181 @@
+package com.asyncapi.v2._6_0.model.channel.message;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._6_0.jackson.model.channel.message.MessageCorrelationIdDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.channel.message.MessageHeadersDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.channel.message.MessagePayloadDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.channel.message.MessageTraitsDeserializer;
+import com.asyncapi.v2._6_0.model.ExternalDocumentation;
+import com.asyncapi.v2._6_0.model.Tag;
+import com.asyncapi.v2.binding.message.MessageBinding;
+import com.asyncapi.v2.jackson.binding.message.MessageBindingsDeserializer;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Describes a message received on a given channel and operation.
+ *
+ * @version 2.6.0
+ * @see Message
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class Message extends ExtendableObject {
+
+ /**
+ * Unique string used to identify the message.
+ *
+ * The id MUST be unique among all messages described in the API. The messageId value is case-sensitive.
+ * Tools and libraries MAY use the messageId to uniquely identify a message, therefore, it is RECOMMENDED to
+ * follow common programming naming conventions.
+ */
+ @Nullable
+ private String messageId;
+
+ /**
+ * Schema definition of the application headers. Schema MUST be of type "object".
+ * It MUST NOT define the protocol headers.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2.schema.Schema}
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = MessageHeadersDeserializer.class)
+ private Object headers;
+
+ /**
+ * Definition of the message payload. It can be of any type but defaults to Schema object.
+ * It must match the schema format, including encoding type - e.g Avro should be inlined as either a YAML or JSON object
+ * NOT a string to be parsed as YAML or JSON.
+ *
+ * WILL BE:
+ *
+ * {@link com.asyncapi.v2.schema.Schema}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = MessagePayloadDeserializer.class)
+ private Object payload;
+
+ /**
+ * Definition of the correlation ID used for message tracing or matching.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.channel.message.CorrelationId}
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = MessageCorrelationIdDeserializer.class)
+ private Object correlationId;
+
+ /**
+ * A string containing the name of the schema format used to define the message payload.
+ * If omitted, implementations should parse the payload as a {@link com.asyncapi.v2.schema.Schema} object. When the payload is defined using a
+ * $ref to a remote file, it is RECOMMENDED the schema format includes the file encoding type to allow implementations
+ * to parse the file correctly. E.g., adding +yaml if content type is application/vnd.apache.avro results in
+ * application/vnd.apache.avro+yaml.
+ *
+ * Check out the supported schema formats table for more information.
+ * Custom values are allowed but their implementation is OPTIONAL.
+ * A custom value MUST NOT refer to one of the schema formats listed in the table .
+ */
+ @Nullable
+ private String schemaFormat;
+
+ /**
+ * The content type to use when encoding/decoding a message's payload. The value MUST be a specific
+ * media type (e.g. application/json). When omitted, the value MUST be the one specified on the
+ * {@link com.asyncapi.v2._6_0.model.AsyncAPI#getDefaultContentType()} field.
+ */
+ @Nullable
+ private String contentType;
+
+ /**
+ * A machine-friendly name for the message.
+ */
+ @Nullable
+ private String name;
+
+ /**
+ * A human-friendly title for the message.
+ */
+ @Nullable
+ private String title;
+
+ /**
+ * A short summary of what the message is about.
+ */
+ @Nullable
+ private String summary;
+
+ /**
+ * A verbose explanation of the message. CommonMark syntax can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * A list of tags for API documentation control. Tags can be used for logical grouping of messages.
+ */
+ @Nullable
+ private List tags;
+
+ /**
+ * Additional external documentation for this message.
+ */
+ @Nullable
+ private ExternalDocumentation externalDocs;
+
+ /**
+ * A map where the keys describe the name of the protocol and the values describe protocol-specific definitions
+ * for the message.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link MessageBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = MessageBindingsDeserializer.class)
+ private Map bindings;
+
+ /**
+ * List of examples.
+ */
+ @Nullable
+ private List examples;
+
+ /**
+ * A list of traits to apply to the message object. Traits MUST be merged into the message object using the
+ * JSON Merge Patch algorithm in the same order they are defined here.
+ * The resulting object MUST be a valid Message Object.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.channel.message.MessageTrait}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = MessageTraitsDeserializer.class)
+ private List traits;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/MessageExample.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/MessageExample.java
new file mode 100644
index 00000000..9d461a0a
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/MessageExample.java
@@ -0,0 +1,47 @@
+package com.asyncapi.v2._6_0.model.channel.message;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * Message Example Object represents an example of a {@link com.asyncapi.v2._6_0.model.channel.message.Message} Object and MUST contain either headers and/or payload fields.
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class MessageExample extends ExtendableObject {
+
+ /**
+ * The value of this field MUST validate against the {@link com.asyncapi.v2._6_0.model.channel.message.Message} headers field.
+ */
+ @Nullable
+ public Map headers;
+
+ /**
+ * The value of this field MUST validate against the Message {@link com.asyncapi.v2._6_0.model.channel.message.Message#getPayload()} field.
+ */
+ @Nullable
+ private Object payload;
+
+ /**
+ * A machine-friendly name.
+ */
+ @Nullable
+ private String name;
+
+ /**
+ * A short summary of what the example is about.
+ */
+ @Nullable
+ private String summary;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/MessageTrait.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/MessageTrait.java
new file mode 100644
index 00000000..22420d52
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/MessageTrait.java
@@ -0,0 +1,156 @@
+package com.asyncapi.v2._6_0.model.channel.message;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._6_0.jackson.model.channel.message.MessageCorrelationIdDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.channel.message.MessageHeadersDeserializer;
+import com.asyncapi.v2._6_0.model.ExternalDocumentation;
+import com.asyncapi.v2._6_0.model.Tag;
+import com.asyncapi.v2.binding.message.MessageBinding;
+import com.asyncapi.v2.jackson.binding.message.MessageBindingsDeserializer;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Describes a trait that MAY be applied to a Message Object({@link com.asyncapi.v2._6_0.model.channel.message.Message}).
+ *
+ * This object MAY contain any property from the Message Object({@link com.asyncapi.v2._6_0.model.channel.message.Message}), except payload and traits.
+ *
+ * If you're looking to apply traits to an operation, see the Operation Trait Object({@link com.asyncapi.v2._6_0.model.channel.operation.OperationTrait}).
+ *
+ * @version 2.6.0
+ * @see Message
+ * @see MessageTrait
+ * @see OperationTrait
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class MessageTrait extends ExtendableObject {
+
+ /**
+ * Unique string used to identify the message.
+ *
+ * The id MUST be unique among all messages described in the API. The messageId value is case-sensitive.
+ * Tools and libraries MAY use the messageId to uniquely identify a message, therefore, it is RECOMMENDED to
+ * follow common programming naming conventions.
+ */
+ @Nullable
+ private String messageId;
+
+ /**
+ * Schema definition of the application headers. Schema MUST be of type "object".
+ * It MUST NOT define the protocol headers.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2.schema.Schema}
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = MessageHeadersDeserializer.class)
+ private Object headers;
+
+ /**
+ * Definition of the correlation ID used for message tracing or matching.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.channel.message.CorrelationId}
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = MessageCorrelationIdDeserializer.class)
+ private Object correlationId;
+
+ /**
+ * A string containing the name of the schema format used to define the message payload.
+ * If omitted, implementations should parse the payload as a {@link com.asyncapi.v2.schema.Schema} object. When the payload is defined using a
+ * $ref to a remote file, it is RECOMMENDED the schema format includes the file encoding type to allow implementations
+ * to parse the file correctly. E.g., adding +yaml if content type is application/vnd.apache.avro results in
+ * application/vnd.apache.avro+yaml.
+ *
+ * Check out the supported schema formats table for more information.
+ * Custom values are allowed but their implementation is OPTIONAL.
+ * A custom value MUST NOT refer to one of the schema formats listed in the table .
+ */
+ @Nullable
+ private String schemaFormat;
+
+ /**
+ * The content type to use when encoding/decoding a message's payload. The value MUST be a specific
+ * media type (e.g. application/json). When omitted, the value MUST be the one specified on the
+ * {@link com.asyncapi.v2._6_0.model.AsyncAPI#getDefaultContentType()} field.
+ */
+ @Nullable
+ private String contentType;
+
+ /**
+ * A machine-friendly name for the message.
+ */
+ @Nullable
+ private String name;
+
+ /**
+ * A human-friendly title for the message.
+ */
+ @Nullable
+ private String title;
+
+ /**
+ * A short summary of what the message is about.
+ */
+ @Nullable
+ private String summary;
+
+ /**
+ * A verbose explanation of the message. CommonMark syntax can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * A list of tags for API documentation control. Tags can be used for logical grouping of messages.
+ */
+ @Nullable
+ private List tags;
+
+ /**
+ * Additional external documentation for this message.
+ */
+ @Nullable
+ private ExternalDocumentation externalDocs;
+
+ /**
+ * A map where the keys describe the name of the protocol and the values describe protocol-specific definitions
+ * for the message.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link MessageBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = MessageBindingsDeserializer.class)
+ private Map bindings;
+
+ /**
+ * List of examples.
+ */
+ @Nullable
+ private List examples;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/OneOfMessages.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/OneOfMessages.java
new file mode 100644
index 00000000..816d1c0a
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/message/OneOfMessages.java
@@ -0,0 +1,36 @@
+package com.asyncapi.v2._6_0.model.channel.message;
+
+import com.asyncapi.v2._6_0.jackson.model.channel.message.MessagesDeserializer;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * Describes which message is acceptable.
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+public class OneOfMessages {
+
+ /**
+ * Given message MUST be one of provided messages.
+ *
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.channel.message.Message}
+ *
+ */
+ @NotNull
+ @JsonDeserialize(using = MessagesDeserializer.class)
+ private List oneOf;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/operation/Operation.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/operation/Operation.java
new file mode 100644
index 00000000..a5ff9fb7
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/operation/Operation.java
@@ -0,0 +1,128 @@
+package com.asyncapi.v2._6_0.model.channel.operation;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._6_0.jackson.model.channel.operation.OperationMessageDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.channel.operation.OperationTraitsDeserializer;
+import com.asyncapi.v2._6_0.model.ExternalDocumentation;
+import com.asyncapi.v2._6_0.model.Tag;
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import com.asyncapi.v2.jackson.binding.operation.OperationBindingsDeserializer;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Describes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.
+ *
+ * For example, an operation might describe a chat application use case where a user sends a text message to a group.
+ * A publish operation describes messages that are received by the chat application, whereas a subscribe operation describes messages that are sent by the chat application.
+ *
+ * @version 2.6.0
+ * @see Operation
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class Operation extends ExtendableObject {
+
+ /**
+ * Unique string used to identify the operation.
+ *
+ * The id MUST be unique among all operations described in the API. The operationId value is case-sensitive.
+ * Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to
+ * follow common programming naming conventions.
+ */
+ @Nullable
+ private String operationId;
+
+ /**
+ * A short summary of what the operation is about.
+ */
+ @Nullable
+ private String summary;
+
+ /**
+ * A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * A declaration of which security mechanisms are associated with this operation. Only one of the security
+ * requirement objects MUST be satisfied to authorize an operation. In cases where Server Security also applies,
+ * it MUST also be satisfied.
+ *
+ * Each name MUST correspond to a security scheme which is declared in the {@link com.asyncapi.v2._6_0.model.component.Components#getSecuritySchemes()} Security Schemes under the {@link com.asyncapi.v2._6_0.model.component.Components} Object.
+ * If the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names.
+ * Provide scopes that are required to establish successful connection with the server.
+ * If scopes are not needed, the list can be empty. For other security scheme types, the array MUST be empty.
+ */
+ @Nullable
+ private List>> security;
+
+ /**
+ * A list of tags for logical grouping and categorization of operations.
+ */
+ @Nullable
+ private List tags;
+
+ /**
+ * Additional external documentation for this operation.
+ */
+ @Nullable
+ private ExternalDocumentation externalDocs;
+
+ /**
+ * A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link OperationBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = OperationBindingsDeserializer.class)
+ private Map bindings;
+
+ /**
+ * A list of traits to apply to the operation object.
+ * Traits MUST be merged into the operation object using the JSON Merge Patch algorithm in the same order they are defined here.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.channel.operation.OperationTrait}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = OperationTraitsDeserializer.class)
+ private List traits;
+
+ /**
+ * A definition of the message that will be published or received by this operation.
+ * Map containing a single oneOf key is allowed here to specify multiple messages.
+ * However, a message MUST be valid only against one of the message objects.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.channel.message.Message}
+ * {@link com.asyncapi.v2._6_0.model.channel.message.OneOfMessages}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = OperationMessageDeserializer.class)
+ private Object message;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/operation/OperationTrait.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/operation/OperationTrait.java
new file mode 100644
index 00000000..22a5e623
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/channel/operation/OperationTrait.java
@@ -0,0 +1,103 @@
+package com.asyncapi.v2._6_0.model.channel.operation;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._6_0.model.ExternalDocumentation;
+import com.asyncapi.v2._6_0.model.Tag;
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import com.asyncapi.v2.jackson.binding.operation.OperationBindingsDeserializer;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Describes a trait that MAY be applied to an {@link com.asyncapi.v2._6_0.model.channel.operation.Operation}.
+ *
+ * This object MAY contain any property from the {@link com.asyncapi.v2._6_0.model.channel.operation.Operation}, except:
+ *
+ * Message
+ * Traits
+ *
+ *
+ * If you're looking to apply traits to a message, see the {@link com.asyncapi.v2._6_0.model.channel.message.MessageTrait}.
+ *
+ * @version 2.0.0
+ * @see Operation
+ * @see OperationTrait
+ * @see MessageTrait
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class OperationTrait extends ExtendableObject {
+
+ /**
+ * Unique string used to identify the operation.
+ *
+ * The id MUST be unique among all operations described in the API. The operationId value is case-sensitive.
+ * Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to
+ * follow common programming naming conventions.
+ */
+ @Nullable
+ private String operationId;
+
+ /**
+ * A short summary of what the operation is about.
+ */
+ @Nullable
+ private String summary;
+
+ /**
+ * A verbose explanation of the operation. can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * A declaration of which security mechanisms are associated with this operation. Only one of the security
+ * requirement objects MUST be satisfied to authorize an operation. In cases where Server Security also applies,
+ * it MUST also be satisfied.
+ *
+ * Each name MUST correspond to a security scheme which is declared in the {@link com.asyncapi.v2._6_0.model.component.Components#getSecuritySchemes()} Security Schemes under the {@link com.asyncapi.v2._6_0.model.component.Components} Object.
+ * If the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names.
+ * Provide scopes that are required to establish successful connection with the server.
+ * If scopes are not needed, the list can be empty. For other security scheme types, the array MUST be empty.
+ */
+ @Nullable
+ private List>> security;
+
+ /**
+ * A list of tags for API documentation control. Tags can be used for logical grouping of operations.
+ */
+ @Nullable
+ private List tags;
+
+ /**
+ * Additional external documentation for this operation.
+ */
+ @Nullable
+ private ExternalDocumentation externalDocs;
+
+ /**
+ * A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link OperationBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = OperationBindingsDeserializer.class)
+ private Map bindings;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/component/Components.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/component/Components.java
new file mode 100644
index 00000000..4a9a8bef
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/component/Components.java
@@ -0,0 +1,219 @@
+package com.asyncapi.v2._6_0.model.component;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._6_0.jackson.model.component.ComponentsCorrelationIdsDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.component.ComponentsMessageTraitsDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.component.ComponentsMessagesDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.component.ComponentsOperationTraitsDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.component.ComponentsParametersDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.component.ComponentsSchemasDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.component.ComponentsSecuritySchemesDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.component.ComponentsServerVariablesDeserializer;
+import com.asyncapi.v2._6_0.jackson.model.component.ComponentsServersDeserializer;
+import com.asyncapi.v2._6_0.model.channel.ChannelItem;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
+import com.asyncapi.v2.jackson.binding.channel.ChannelBindingsDeserializer;
+import com.asyncapi.v2.jackson.binding.message.MessageBindingsDeserializer;
+import com.asyncapi.v2.jackson.binding.operation.OperationBindingsDeserializer;
+import com.asyncapi.v2.jackson.binding.server.ServerBindingsDeserializer;
+import com.asyncapi.v2.security_scheme.SecurityScheme;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * Holds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the
+ * components object will have no effect on the API unless they are explicitly referenced from properties outside the
+ * components object.
+ *
+ * @version 2.6.0
+ * @see Components
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class Components extends ExtendableObject {
+
+ /**
+ * An object to hold reusable {@link }Schema Objects.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2.schema.Schema}
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ComponentsSchemasDeserializer.class)
+ private Map schemas;
+
+ /**
+ * An object to hold reusable {@link com.asyncapi.v2._6_0.model.server.Server} Objects.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.server.Server}
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ComponentsServersDeserializer.class)
+ private Map servers;
+
+ /**
+ * An object to hold reusable {@link com.asyncapi.v2._6_0.model.server.ServerVariable} Objects.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.server.ServerVariable}
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ComponentsServerVariablesDeserializer.class)
+ private Map serverVariables;
+
+ /**
+ * An object to hold reusable {@link com.asyncapi.v2._6_0.model.channel.ChannelItem} Objects.
+ */
+ private Map channels;
+
+ /**
+ * An object to hold reusable {@link com.asyncapi.v2._6_0.model.channel.message.Message} Objects.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.channel.message.Message}
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ComponentsMessagesDeserializer.class)
+ private Map messages;
+
+ /**
+ * An object to hold reusable {@link SecurityScheme} Objects.
+ *
+ * MUST BE:
+ *
+ * {@link SecurityScheme}
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ComponentsSecuritySchemesDeserializer.class)
+ private Map securitySchemes;
+
+ /**
+ * An object to hold reusable {@link com.asyncapi.v2._6_0.model.channel.Parameter} Objects.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.channel.Parameter}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ComponentsParametersDeserializer.class)
+ private Map parameters;
+
+ /**
+ * An object to hold reusable {@link com.asyncapi.v2._6_0.model.channel.message.CorrelationId} Objects.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.channel.message.CorrelationId}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ComponentsCorrelationIdsDeserializer.class)
+ private Map correlationIds;
+
+ /**
+ * An object to hold reusable {@link com.asyncapi.v2._6_0.model.channel.operation.OperationTrait} Objects.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.channel.operation.OperationTrait}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ComponentsOperationTraitsDeserializer.class)
+ private Map operationTraits;
+
+ /**
+ * An object to hold reusable {@link com.asyncapi.v2._6_0.model.channel.message.MessageTrait} Objects.
+ *
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.channel.message.MessageTrait}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ComponentsMessageTraitsDeserializer.class)
+ private Map messageTraits;
+
+ /**
+ * An object to hold reusable {@link ServerBinding} Objects.
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link ServerBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ServerBindingsDeserializer.class)
+ private Map serverBindings;
+
+ /**
+ * An object to hold reusable {@link ChannelBinding} Objects.
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link ChannelBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ChannelBindingsDeserializer.class)
+ private Map channelBindings;
+
+ /**
+ * An object to hold reusable {@link OperationBinding} Objects.
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link OperationBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = OperationBindingsDeserializer.class)
+ private Map operationBindings;
+
+ /**
+ * An object to hold reusable {@link MessageBinding} Objects.
+ * MUST BE:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link MessageBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = MessageBindingsDeserializer.class)
+ private Map messageBindings;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/info/Contact.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/info/Contact.java
new file mode 100644
index 00000000..0967dc56
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/info/Contact.java
@@ -0,0 +1,43 @@
+package com.asyncapi.v2._6_0.model.info;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Contact information for the exposed API.
+ *
+ * @version 2.6.0
+ * @see Contact
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class Contact extends ExtendableObject {
+
+ /**
+ * The identifying name of the contact person/organization.
+ */
+ @Nullable
+ private String name;
+
+ /**
+ * The URL pointing to the contact information. MUST be in the format of a URL.
+ */
+ @Nullable
+ private String url;
+
+ /**
+ * The email address of the contact person/organization. MUST be in the format of an email address.
+ */
+ @Nullable
+ private String email;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/info/Info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/info/Info.java
new file mode 100644
index 00000000..d82738ad
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/info/Info.java
@@ -0,0 +1,66 @@
+package com.asyncapi.v2._6_0.model.info;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * The object provides metadata about the API. The metadata can be used by the clients if needed.
+ *
+ * @version 2.6.0
+ * @see Info
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class Info extends ExtendableObject {
+
+ /**
+ * Required.
+ *
+ * The title of the application.
+ */
+ @NotNull
+ private String title;
+
+ /**
+ * Required.
+ *
+ * Provides the version of the application API (not to be confused with the specification version).
+ */
+ @NotNull
+ private String version;
+
+ /**
+ * A short description of the application. CommonMark syntax can be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * A URL to the Terms of Service for the API. MUST be in the format of a URL.
+ */
+ @Nullable
+ private String termsOfService;
+
+ /**
+ * The contact information for the exposed API.
+ */
+ @Nullable
+ private Contact contact;
+
+ /**
+ * The license information for the exposed API.
+ */
+ @Nullable
+ private License license;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/info/License.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/info/License.java
new file mode 100644
index 00000000..c5191c16
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/info/License.java
@@ -0,0 +1,38 @@
+package com.asyncapi.v2._6_0.model.info;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * License information for the exposed API.
+ *
+ * @version 2.6.0
+ * @see License
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class License extends ExtendableObject {
+
+ /**
+ * Required. The license name used for the API.
+ */
+ @NotNull
+ private String name;
+
+ /**
+ * A URL to the license used for the API. MUST be in the format of a URL.
+ */
+ @Nullable
+ private String url;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/server/Server.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/server/Server.java
new file mode 100644
index 00000000..cf9a6a4d
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/server/Server.java
@@ -0,0 +1,116 @@
+package com.asyncapi.v2._6_0.model.server;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._6_0.jackson.model.server.ServerVariablesDeserializer;
+import com.asyncapi.v2._6_0.model.Tag;
+import com.asyncapi.v2.binding.server.ServerBinding;
+import com.asyncapi.v2.jackson.binding.server.ServerBindingsDeserializer;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * An object representing a message broker, a server or any other kind of computer program capable of sending and/or
+ * receiving data. This object is used to capture details such as URIs, protocols and security configuration.
+ * Variable substitution can be used so that some details, for example usernames and passwords, can be injected by
+ * code generation tools.
+ *
+ * @version 2.6.0
+ * @see Server
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class Server extends ExtendableObject {
+
+ /**
+ * REQUIRED.
+ *
+ * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host
+ * location is relative to the location where the AsyncAPI document is being served. Variable substitutions will be
+ * made when a variable is named in {brackets}.
+ */
+ @NotNull
+ private String url;
+
+ /**
+ * REQUIRED.
+ *
+ * The protocol this URL supports for connection. Supported protocol include, but are not limited to:
+ * amqp, amqps, http, https, ibmmq, jms, kafka, kafka-secure, anypointmq, mqtt, secure-mqtt, solace, stomp, stomps, ws, wss, mercure, googlepubsub, pulsar.
+ */
+ @NotNull
+ private String protocol;
+
+ /**
+ * The version of the protocol used for connection. For instance: AMQP 0.9.1, HTTP 2.0, Kafka 1.0.0, etc.
+ */
+ @Nullable
+ private String protocolVersion;
+
+ /**
+ * An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text
+ * representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * A map between a variable name and its value. The value is used for substitution in the server's URL template.
+ *
+ * MUST be one of:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link com.asyncapi.v2._6_0.model.server.ServerVariable}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ServerVariablesDeserializer.class)
+ private Map variables;
+
+ /**
+ * A declaration of which security mechanisms can be used with this server. The list of values includes alternative
+ * security requirement objects that can be used. Only one of the security requirement objects need to be satisfied
+ * to authorize a connection or operation.
+ *
+ * Lists the required security schemes to execute this operation. The name used for each property MUST correspond
+ * to a security scheme declared in the Security Schemes under the Components Object.
+ *
+ * When a list of Security Requirement Objects is defined on a Server object, only one of the Security Requirement
+ * Objects in the list needs to be satisfied to authorize the connection.
+ */
+ @Nullable
+ private List>> security;
+
+ /**
+ * A list of tags for logical grouping and categorization of servers.
+ */
+ @Nullable
+ private List tags;
+
+ /**
+ * A map where the keys describe the name of the protocol and the values describe protocol-specific definitions
+ * for the server.
+ *
+ * MUST be one of:
+ *
+ * {@link com.asyncapi.v2._6_0.model.Reference}
+ * {@link ServerBinding}
+ *
+ */
+ @Nullable
+ @JsonDeserialize(using = ServerBindingsDeserializer.class)
+ private Map bindings;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/server/ServerVariable.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/server/ServerVariable.java
new file mode 100644
index 00000000..368b7a0f
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/server/ServerVariable.java
@@ -0,0 +1,54 @@
+package com.asyncapi.v2._6_0.model.server;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * An object representing a Server Variable for server URL template substitution.
+ *
+ * @version 2.6.0
+ * @see ServerVariable
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ServerVariable extends ExtendableObject {
+
+ /**
+ * An enumeration of string values to be used if the substitution options are from a limited set.
+ */
+ @Nullable
+ @JsonProperty(value = "enum")
+ private List enumValues;
+
+ /**
+ * The default value to use for substitution, and to send, if an alternate value is not supplied.
+ */
+ @Nullable
+ @JsonProperty("default")
+ private String defaultValue;
+
+ /**
+ * An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * An array of examples of the server variable.
+ */
+ @Nullable
+ private List examples;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ChannelBinding.java
deleted file mode 100644
index 7b77ba87..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ChannelBinding.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.asyncapi.v2.binding;
-
-import lombok.EqualsAndHashCode;
-
-/**
- * Describes AsyncAPI channel binding.
- *
- * @author Pavel Bodiachevskii
- */
-@EqualsAndHashCode
-public class ChannelBinding {
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ChannelBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ChannelBindingsDeserializer.java
deleted file mode 100644
index b8fafccf..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ChannelBindingsDeserializer.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.asyncapi.v2.binding;
-
-import com.asyncapi.v2.binding.amqp.AMQPChannelBinding;
-import com.asyncapi.v2.binding.amqp1.AMQP1ChannelBinding;
-import com.asyncapi.v2.binding.http.HTTPChannelBinding;
-import com.asyncapi.v2.binding.jms.JMSChannelBinding;
-import com.asyncapi.v2.binding.mqtt.MQTTChannelBinding;
-import com.asyncapi.v2.binding.mqtt5.MQTT5ChannelBinding;
-import com.asyncapi.v2.binding.nats.NATSChannelBinding;
-import com.asyncapi.v2.binding.redis.RedisChannelBinding;
-import com.asyncapi.v2.binding.sns.SNSChannelBinding;
-import com.asyncapi.v2.binding.sqs.SQSChannelBinding;
-import com.asyncapi.v2.binding.stomp.STOMPChannelBinding;
-import com.asyncapi.v2.binding.ws.WebSocketsChannelBinding;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Serializes channel bindings map.
- *
- * @author Pavel Bodiachevskii
- */
-public class ChannelBindingsDeserializer extends JsonDeserializer> {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Map deserialize(
- JsonParser p,
- DeserializationContext ctxt
- ) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- Map bindings = new HashMap<>();
-
- node.fieldNames().forEachRemaining(
- fieldName -> {
- try {
- bindings.put(fieldName, chooseKnownPojo(fieldName, node.get(fieldName)));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- );
-
- return bindings;
- }
-
- private T chooseKnownPojo(String bindingKey, JsonNode binding) throws IOException {
- switch (bindingKey) {
- case "amqp": return (T) objectMapper.readValue(binding.toString(), AMQPChannelBinding.class);
- case "amqp1": return (T) objectMapper.readValue(binding.toString(), AMQP1ChannelBinding.class);
- case "http": return (T) objectMapper.readValue(binding.toString(), HTTPChannelBinding.class);
- case "jms": return (T) objectMapper.readValue(binding.toString(), JMSChannelBinding.class);
- case "kafka": return (T) objectMapper.readValue(binding.toString(), JMSChannelBinding.class);
- case "mqtt": return (T) objectMapper.readValue(binding.toString(), MQTTChannelBinding.class);
- case "mqtt5": return (T) objectMapper.readValue(binding.toString(), MQTT5ChannelBinding.class);
- case "nats": return (T) objectMapper.readValue(binding.toString(), NATSChannelBinding.class);
- case "redis": return (T) objectMapper.readValue(binding.toString(), RedisChannelBinding.class);
- case "sns": return (T) objectMapper.readValue(binding.toString(), SNSChannelBinding.class);
- case "sqs": return (T) objectMapper.readValue(binding.toString(), SQSChannelBinding.class);
- case "stomp": return (T) objectMapper.readValue(binding.toString(), STOMPChannelBinding.class);
- case "ws": return (T) objectMapper.readValue(binding.toString(), WebSocketsChannelBinding.class);
- default: return null;
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/MessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/MessageBinding.java
deleted file mode 100644
index e37c187c..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/MessageBinding.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.asyncapi.v2.binding;
-
-import lombok.EqualsAndHashCode;
-
-/**
- * Describes AsyncAPI message binding.
- *
- * @author Pavel Bodiachevskii
- */
-@EqualsAndHashCode
-public class MessageBinding {
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/MessageBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/MessageBindingsDeserializer.java
deleted file mode 100644
index 9c873372..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/MessageBindingsDeserializer.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.asyncapi.v2.binding;
-
-import com.asyncapi.v2.binding.amqp.AMQPMessageBinding;
-import com.asyncapi.v2.binding.amqp1.AMQP1MessageBinding;
-import com.asyncapi.v2.binding.http.HTTPMessageBinding;
-import com.asyncapi.v2.binding.jms.JMSMessageBinding;
-import com.asyncapi.v2.binding.mqtt.MQTTMessageBinding;
-import com.asyncapi.v2.binding.mqtt5.MQTT5MessageBinding;
-import com.asyncapi.v2.binding.nats.NATSMessageBinding;
-import com.asyncapi.v2.binding.redis.RedisMessageBinding;
-import com.asyncapi.v2.binding.sns.SNSMessageBinding;
-import com.asyncapi.v2.binding.sqs.SQSMessageBinding;
-import com.asyncapi.v2.binding.stomp.STOMPMessageBinding;
-import com.asyncapi.v2.binding.ws.WebSocketsMessageBinding;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Serializes message bindings map.
- *
- * @author Pavel Bodiachevskii
- */
-public class MessageBindingsDeserializer extends JsonDeserializer> {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Map deserialize(
- JsonParser p,
- DeserializationContext ctxt
- ) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- Map bindings = new HashMap<>();
-
- node.fieldNames().forEachRemaining(
- fieldName -> {
- try {
- bindings.put(fieldName, chooseKnownPojo(fieldName, node.get(fieldName)));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- );
-
- return bindings;
- }
-
- private T chooseKnownPojo(String bindingKey, JsonNode binding) throws IOException {
- switch (bindingKey) {
- case "amqp": return (T) objectMapper.readValue(binding.toString(), AMQPMessageBinding.class);
- case "amqp1": return (T) objectMapper.readValue(binding.toString(), AMQP1MessageBinding.class);
- case "http": return (T) objectMapper.readValue(binding.toString(), HTTPMessageBinding.class);
- case "jms": return (T) objectMapper.readValue(binding.toString(), JMSMessageBinding.class);
- case "kafka": return (T) objectMapper.readValue(binding.toString(), JMSMessageBinding.class);
- case "mqtt": return (T) objectMapper.readValue(binding.toString(), MQTTMessageBinding.class);
- case "mqtt5": return (T) objectMapper.readValue(binding.toString(), MQTT5MessageBinding.class);
- case "nats": return (T) objectMapper.readValue(binding.toString(), NATSMessageBinding.class);
- case "redis": return (T) objectMapper.readValue(binding.toString(), RedisMessageBinding.class);
- case "sns": return (T) objectMapper.readValue(binding.toString(), SNSMessageBinding.class);
- case "sqs": return (T) objectMapper.readValue(binding.toString(), SQSMessageBinding.class);
- case "stomp": return (T) objectMapper.readValue(binding.toString(), STOMPMessageBinding.class);
- case "ws": return (T) objectMapper.readValue(binding.toString(), WebSocketsMessageBinding.class);
- default: return null;
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/OperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/OperationBinding.java
deleted file mode 100644
index f8dc3cb4..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/OperationBinding.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.asyncapi.v2.binding;
-
-import lombok.EqualsAndHashCode;
-
-/**
- * Describes AsyncAPI operation binding.
- *
- * @author Pavel Bodiachevskii
- */
-@EqualsAndHashCode
-public class OperationBinding {
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/OperationBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/OperationBindingsDeserializer.java
deleted file mode 100644
index ce67be04..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/OperationBindingsDeserializer.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.asyncapi.v2.binding;
-
-import com.asyncapi.v2.binding.amqp.AMQPOperationBinding;
-import com.asyncapi.v2.binding.amqp1.AMQP1OperationBinding;
-import com.asyncapi.v2.binding.http.HTTPOperationBinding;
-import com.asyncapi.v2.binding.jms.JMSOperationBinding;
-import com.asyncapi.v2.binding.mqtt.MQTTOperationBinding;
-import com.asyncapi.v2.binding.mqtt5.MQTT5OperationBinding;
-import com.asyncapi.v2.binding.nats.NATSOperationBinding;
-import com.asyncapi.v2.binding.redis.RedisOperationBinding;
-import com.asyncapi.v2.binding.sns.SNSOperationBinding;
-import com.asyncapi.v2.binding.sqs.SQSOperationBinding;
-import com.asyncapi.v2.binding.stomp.STOMPOperationBinding;
-import com.asyncapi.v2.binding.ws.WebSocketsOperationBinding;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Serializes operation bindings map.
- *
- * @author Pavel Bodiachevskii
- */
-public class OperationBindingsDeserializer extends JsonDeserializer> {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Map deserialize(
- JsonParser p,
- DeserializationContext ctxt
- ) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- Map bindings = new HashMap<>();
-
- node.fieldNames().forEachRemaining(
- fieldName -> {
- try {
- bindings.put(fieldName, chooseKnownPojo(fieldName, node.get(fieldName)));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- );
-
- return bindings;
- }
-
- private T chooseKnownPojo(String bindingKey, JsonNode binding) throws IOException {
- switch (bindingKey) {
- case "amqp": return (T) objectMapper.readValue(binding.toString(), AMQPOperationBinding.class);
- case "amqp1": return (T) objectMapper.readValue(binding.toString(), AMQP1OperationBinding.class);
- case "http": return (T) objectMapper.readValue(binding.toString(), HTTPOperationBinding.class);
- case "jms": return (T) objectMapper.readValue(binding.toString(), JMSOperationBinding.class);
- case "kafka": return (T) objectMapper.readValue(binding.toString(), JMSOperationBinding.class);
- case "mqtt": return (T) objectMapper.readValue(binding.toString(), MQTTOperationBinding.class);
- case "mqtt5": return (T) objectMapper.readValue(binding.toString(), MQTT5OperationBinding.class);
- case "nats": return (T) objectMapper.readValue(binding.toString(), NATSOperationBinding.class);
- case "redis": return (T) objectMapper.readValue(binding.toString(), RedisOperationBinding.class);
- case "sns": return (T) objectMapper.readValue(binding.toString(), SNSOperationBinding.class);
- case "sqs": return (T) objectMapper.readValue(binding.toString(), SQSOperationBinding.class);
- case "stomp": return (T) objectMapper.readValue(binding.toString(), STOMPOperationBinding.class);
- case "ws": return (T) objectMapper.readValue(binding.toString(), WebSocketsOperationBinding.class);
- default: return null;
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ServerBinding.java
deleted file mode 100644
index c500f249..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ServerBinding.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.asyncapi.v2.binding;
-
-import lombok.EqualsAndHashCode;
-
-/**
- * Describes AsyncAPI server binding.
- *
- * @author Pavel Bodiachevskii
- */
-@EqualsAndHashCode
-public class ServerBinding {
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ServerBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ServerBindingsDeserializer.java
deleted file mode 100644
index 65580ba9..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ServerBindingsDeserializer.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.asyncapi.v2.binding;
-
-import com.asyncapi.v2.binding.amqp.AMQPServerBinding;
-import com.asyncapi.v2.binding.amqp1.AMQP1ServerBinding;
-import com.asyncapi.v2.binding.http.HTTPServerBinding;
-import com.asyncapi.v2.binding.jms.JMSServerBinding;
-import com.asyncapi.v2.binding.mqtt.MQTTServerBinding;
-import com.asyncapi.v2.binding.mqtt5.MQTT5ServerBinding;
-import com.asyncapi.v2.binding.nats.NATSServerBinding;
-import com.asyncapi.v2.binding.redis.RedisServerBinding;
-import com.asyncapi.v2.binding.sns.SNSServerBinding;
-import com.asyncapi.v2.binding.sqs.SQSServerBinding;
-import com.asyncapi.v2.binding.stomp.STOMPServerBinding;
-import com.asyncapi.v2.binding.ws.WebSocketsServerBinding;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Serializes server bindings map.
- *
- * @author Pavel Bodiachevskii
- */
-public class ServerBindingsDeserializer extends JsonDeserializer> {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Map deserialize(
- JsonParser p,
- DeserializationContext ctxt
- ) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- Map bindings = new HashMap<>();
-
- node.fieldNames().forEachRemaining(
- fieldName -> {
- try {
- bindings.put(fieldName, chooseKnownPojo(fieldName, node.get(fieldName)));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- );
-
- return bindings;
- }
-
- private T chooseKnownPojo(String bindingKey, JsonNode binding) throws IOException {
- switch (bindingKey) {
- case "amqp": return (T) objectMapper.readValue(binding.toString(), AMQPServerBinding.class);
- case "amqp1": return (T) objectMapper.readValue(binding.toString(), AMQP1ServerBinding.class);
- case "http": return (T) objectMapper.readValue(binding.toString(), HTTPServerBinding.class);
- case "jms": return (T) objectMapper.readValue(binding.toString(), JMSServerBinding.class);
- case "kafka": return (T) objectMapper.readValue(binding.toString(), JMSServerBinding.class);
- case "mqtt": return (T) objectMapper.readValue(binding.toString(), MQTTServerBinding.class);
- case "mqtt5": return (T) objectMapper.readValue(binding.toString(), MQTT5ServerBinding.class);
- case "nats": return (T) objectMapper.readValue(binding.toString(), NATSServerBinding.class);
- case "redis": return (T) objectMapper.readValue(binding.toString(), RedisServerBinding.class);
- case "sns": return (T) objectMapper.readValue(binding.toString(), SNSServerBinding.class);
- case "sqs": return (T) objectMapper.readValue(binding.toString(), SQSServerBinding.class);
- case "stomp": return (T) objectMapper.readValue(binding.toString(), STOMPServerBinding.class);
- case "ws": return (T) objectMapper.readValue(binding.toString(), WebSocketsServerBinding.class);
- default: return null;
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/package-info.java
deleted file mode 100644
index ab4021dc..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe AMQP-specific version 0-9-1 information on AsyncAPI.
- *
- * @version 0.2.0
- * @see AMQP bindings
- */
-package com.asyncapi.v2.binding.amqp;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/package-info.java
deleted file mode 100644
index cbc13878..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe AMQP-specific version 1.0 information on AsyncAPI.
- *
- * @version 0.1.0
- * @see AMQP bindings
- */
-package com.asyncapi.v2.binding.amqp1;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/ChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/ChannelBinding.java
new file mode 100644
index 00000000..90d9c6fc
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/ChannelBinding.java
@@ -0,0 +1,13 @@
+package com.asyncapi.v2.binding.channel;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.EqualsAndHashCode;
+
+/**
+ * Describes AsyncAPI channel binding.
+ *
+ * @author Pavel Bodiachevskii
+ */
+@EqualsAndHashCode(callSuper = true)
+public class ChannelBinding extends ExtendableObject {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/amqp/AMQPChannelBinding.java
similarity index 73%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/amqp/AMQPChannelBinding.java
index 4ad08275..8616e337 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/amqp/AMQPChannelBinding.java
@@ -1,14 +1,16 @@
-package com.asyncapi.v2.binding.amqp;
+package com.asyncapi.v2.binding.channel.amqp;
-import com.asyncapi.v2.binding.ChannelBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
/**
* Describes AMQP 0-9-1 channel binding.
- *
+ *
* Contains information about the channel representation in AMQP.
*
* @version 0.2.0
@@ -26,96 +28,101 @@ public class AMQPChannelBinding extends ChannelBinding {
* Defines what type of channel is it. Can be either queue or routingKey (default).
*/
@Nullable
- @CheckForNull
private String is;
/**
* When is=routingKey, this object defines the exchange properties.
*/
@Nullable
- @CheckForNull
private ExchangeProperties exchange;
/**
* When is=queue, this object defines the queue properties.
*/
@Nullable
- @CheckForNull
private QueueProperties queue;
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.2.0";
+
@Data
+ @Builder
@NoArgsConstructor
@AllArgsConstructor
+ @EqualsAndHashCode
public static class ExchangeProperties {
/**
* The name of the exchange. It MUST NOT exceed 255 characters long.
*/
@Nullable
- @CheckForNull
private String name;
/**
* The type of the exchange. Can be either topic, direct, fanout, default or headers.
*/
@Nullable
- @CheckForNull
private String type;
/**
* Whether the exchange should survive broker restarts or not.
*/
@Nullable
- @CheckForNull
- private String durable;
+ private Boolean durable;
/**
* Whether the exchange should be deleted when the last queue is unbound from it.
*/
- private boolean autoDelete;
+ @Nullable
+ private Boolean autoDelete;
/**
* The virtual host of the exchange. Defaults to /.
*/
@Nullable
- @CheckForNull
- private String vhost;
+ @Builder.Default
+ private String vhost = "/";
}
@Data
+ @Builder
@NoArgsConstructor
@AllArgsConstructor
+ @EqualsAndHashCode
public static class QueueProperties {
/**
* The name of the queue. It MUST NOT exceed 255 characters long.
*/
@Nullable
- @CheckForNull
private String name;
/**
* Whether the queue should survive broker restarts or not.
*/
- private boolean durable;
+ @Nullable
+ private Boolean durable;
/**
* Whether the queue should be used only by one connection or not.
*/
- private boolean exclusive;
+ @Nullable
+ private Boolean exclusive;
/**
* Whether the queue should be deleted when the last consumer unsubscribes.
*/
- private boolean autoDelete;
+ @Nullable
+ private Boolean autoDelete;
/**
* The virtual host of the queue. Defaults to /.
*/
@Nullable
- @CheckForNull
- private String vhost;
+ @Builder.Default
+ private String vhost = "/";
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1ChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/amqp1/AMQP1ChannelBinding.java
similarity index 72%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1ChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/amqp1/AMQP1ChannelBinding.java
index 850bc6fa..c214aa4a 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1ChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/amqp1/AMQP1ChannelBinding.java
@@ -1,17 +1,17 @@
-package com.asyncapi.v2.binding.amqp1;
+package com.asyncapi.v2.binding.channel.amqp1;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes AMQP 1.0 channel binding.
*
* @version 0.1.0
- * @see AMQP channel binding
+ * @see AMQP 1.0 channel binding
* @author Pavel Bodiachevskii
*/
@Data
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/anypointmq/AnypointMQChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/anypointmq/AnypointMQChannelBinding.java
new file mode 100644
index 00000000..3e1d3d54
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/anypointmq/AnypointMQChannelBinding.java
@@ -0,0 +1,51 @@
+package com.asyncapi.v2.binding.channel.anypointmq;
+
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes Anypoint MQ channel binding.
+ *
+ * @version 0.0.1
+ * @see Anypoint MQ channel binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class AnypointMQChannelBinding extends ChannelBinding {
+
+ /**
+ * OPTIONAL, defaults to the channel name.
+ *
+ * The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs
+ * from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ.
+ */
+ @Nullable
+ private String destination;
+
+ /**
+ * OPTIONAL, defaults to queue.
+ *
+ * The type of destination, which MUST be either exchange or queue or fifo-queue.
+ * SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering)
+ * supported by this channel.
+ */
+ @Nullable
+ private String destinationType;
+
+ /**
+ * OPTIONAL, defaults to latest. The version of this binding.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.0.1";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/googlepubsub/GooglePubSubChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/googlepubsub/GooglePubSubChannelBinding.java
new file mode 100644
index 00000000..89e05cfd
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/googlepubsub/GooglePubSubChannelBinding.java
@@ -0,0 +1,120 @@
+package com.asyncapi.v2.binding.channel.googlepubsub;
+
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The Channel Bindings Object is used to describe the Google Cloud Pub/Sub specific Topic details with AsyncAPI.
+ *
+ * Describes Google Cloud Pub/Sub channel binding.
+ *
+ * @version 0.1.0
+ * @see Google Cloud Pub/Sub channel binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class GooglePubSubChannelBinding extends ChannelBinding {
+
+ /**
+ * The Google Cloud Pub/Sub Topic name
+ */
+ private String topic;
+
+ /**
+ * An object of key-value pairs (These are used to categorize Cloud Resources like Cloud Pub/Sub Topics.)
+ */
+ @Nullable
+ private Map labels;
+
+ /**
+ * Indicates the minimum duration to retain a message after it is published to the topic (Must be a valid Duration .)
+ */
+ @Nullable
+ private String messageRetentionDuration;
+
+ /**
+ * Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored
+ */
+ @Nullable
+ private MessageStoragePolicy messageStoragePolicy;
+
+ /**
+ * Settings for validating messages published against a schema
+ */
+ @Nullable
+ private SchemaSettings schemaSettings;
+
+ /**
+ * OPTIONAL, defaults to latest. The version of this binding.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
+
+ /**
+ * The Message Storage Policy Object is used to describe the Google Cloud Pub/Sub MessageStoragePolicy Object with AsyncAPI.
+ */
+ @Data
+ @Builder
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @EqualsAndHashCode
+ public static class MessageStoragePolicy {
+
+ /**
+ * A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage
+ */
+ @Nullable
+ private List allowedPersistenceRegions;
+
+ }
+
+ /**
+ * The Schema Settings Object is used to describe the Google Cloud Pub/Sub SchemaSettings Object with AsyncAPI.
+ */
+ @Data
+ @Builder
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @EqualsAndHashCode
+ public static class SchemaSettings {
+
+ /**
+ * The encoding of the message (Must be one of the possible Encoding values.)
+ */
+ @Nullable
+ private String encoding;
+
+ /**
+ * The minimum (inclusive) revision allowed for validating messages
+ */
+ @Nullable
+ private String firstRevisionId;
+
+ /**
+ * The maximum (inclusive) revision allowed for validating messages
+ */
+ @Nullable
+ private String lastRevisionId;
+
+ /**
+ * The name of the schema that messages published should be validated against (The format is projects/{project}/schemas/{schema}.)
+ */
+ @Nullable
+ private String name;
+
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/http/HTTPChannelBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/http/HTTPChannelBinding.java
index c5c27ea5..11465c10 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/http/HTTPChannelBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.http;
+package com.asyncapi.v2.binding.channel.http;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes HTTP channel binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/ibmmq/IBMMQChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/ibmmq/IBMMQChannelBinding.java
new file mode 100644
index 00000000..0a62e9f6
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/ibmmq/IBMMQChannelBinding.java
@@ -0,0 +1,155 @@
+package com.asyncapi.v2.binding.channel.ibmmq;
+
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes IBM MQ channel binding.
+ *
+ * This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.
+ *
+ * @version 0.1.0
+ * @see IBM MQ channel binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class IBMMQChannelBinding extends ChannelBinding {
+
+ /**
+ * Defines the type of AsyncAPI channel.
+ *
+ * MUST be either topic or queue. For type topic, the AsyncAPI channel name MUST be assumed for the IBM MQ topic string unless overridden.
+ */
+ @Nullable
+ private String destinationType;
+
+ /**
+ * REQUIRED if destinationType = queue
+ *
+ * queue and topic fields MUST NOT coexist within a channel binding
+ */
+ @Nullable
+ private Queue queue;
+
+ /**
+ * Defines the properties of a topic.
+ *
+ * OPTIONAL if destinationType = topic
+ *
+ * queue and topic fields MUST NOT coexist within a channel binding.
+ */
+ @Nullable
+ private Topic topic;
+
+ /**
+ * The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are
+ * greater in size than this value may fail to be delivered. More information on the maximum message length can be
+ * found on this page in the IBM MQ Knowledge Center.
+ *
+ * MUST be 0-104,857,600 bytes (100 MB).
+ */
+ @Nullable
+ private Integer maxMsgLength;
+
+ /**
+ * The version of this binding.
+ */
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
+
+ /**
+ * Defines the properties of a queue.
+ */
+ @Data
+ @Builder
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @EqualsAndHashCode
+ public static class Queue {
+
+ /**
+ * Defines the name of the IBM MQ queue associated with the channel.
+ *
+ * A value MUST be specified. MUST NOT exceed 48 characters in length. MUST be a valid IBM MQ queue name
+ */
+ @NotNull
+ private String objectName;
+
+ /**
+ * Defines if the queue is a cluster queue and therefore partitioned. If true, a binding option MAY be specified
+ * when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center.
+ *
+ * If false, binding options SHOULD NOT be specified when accessing the queue.
+ */
+ @Nullable
+ @Builder.Default
+ private Boolean isPartitioned = false;
+
+ /**
+ * Specifies if it is recommended to open the queue exclusively.
+ */
+ @Nullable
+ @Builder.Default
+ private Boolean exclusive = false;
+
+ }
+
+ /**
+ * Defines the properties of a topic.
+ */
+ @Data
+ @Builder
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @EqualsAndHashCode
+ public static class Topic {
+
+ /**
+ * The value of the IBM MQ topic string to be used.
+ *
+ * OPTIONAL
+ * Note: if specified, SHALL override AsyncAPI channel name.
+ *
+ * MUST NOT exceed 10240 characters in length. MAY coexist with topic.objectName
+ */
+ @Nullable
+ private String string;
+
+ /**
+ * The name of the IBM MQ topic object.
+ *
+ * OPTIONAL
+ * Note: if specified, SHALL override AsyncAPI channel name.
+ *
+ * MUST NOT exceed 48 characters in length. MAY coexist with topic.string
+ */
+ @Nullable
+ private String objectName;
+
+ /**
+ * Defines if the subscription may be durable.
+ */
+ @Nullable
+ @Builder.Default
+ private Boolean durablePermitted = true;
+
+ /**
+ * Defines if the last message published will be made available to new subscriptions.
+ */
+ @Nullable
+ @Builder.Default
+ private Boolean lastMsgRetained = false;
+
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/jms/JMSChannelBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/jms/JMSChannelBinding.java
index dd1e8e3b..f1fa217f 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/jms/JMSChannelBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.jms;
+package com.asyncapi.v2.binding.channel.jms;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes JMS channel binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/kafka/KafkaChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/kafka/KafkaChannelBinding.java
new file mode 100644
index 00000000..c625a04b
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/kafka/KafkaChannelBinding.java
@@ -0,0 +1,115 @@
+package com.asyncapi.v2.binding.channel.kafka;
+
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * Describes Kafka channel binding.
+ *
+ * @version 0.4.0
+ * @see Kafka channel binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class KafkaChannelBinding extends ChannelBinding {
+
+ /**
+ * Kafka topic name if different from channel name.
+ */
+ @Nullable
+ private String topic;
+
+ /**
+ * Number of partitions configured on this topic (useful to know how many parallel consumers you may run).
+ *
+ * MUST be positive.
+ */
+ @Nullable
+ private Integer partitions;
+
+ /**
+ * Number of replicas configured on this topic.
+ *
+ * MUST be positive.
+ */
+ @Nullable
+ private Integer replicas;
+
+ /**
+ * Topic configuration properties that are relevant for the API.
+ */
+ @Nullable
+ private TopicConfiguration topicConfiguration;
+
+ /**
+ * The version of this binding. If omitted, "latest" MUST be assumed.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.4.0";
+
+ /**
+ * This objects contains information about the API relevant topic configuration in Kafka.
+ *
+ * @version 0.4.0
+ * @see Kafka channel binding
+ * @author Pavel Bodiachevskii
+ */
+ @Data
+ @Builder
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class TopicConfiguration {
+
+ /**
+ * The cleanup.policy configuration option.
+ *
+ * array may only contain delete and/or compact
+ */
+ @Nullable
+ @JsonProperty("cleanup.policy")
+ private List cleanupPolicy;
+
+ /**
+ * The retention.ms configuration option.
+ */
+ @Nullable
+ @JsonProperty("retention.ms")
+ private Integer retentionMs;
+
+ /**
+ * The retention.bytes configuration option.
+ */
+ @Nullable
+ @JsonProperty("retention.bytes")
+ private Integer retentionBytes;
+
+ /**
+ * The delete.retention.ms configuration option.
+ */
+ @Nullable
+ @JsonProperty("delete.retention.ms")
+ private Integer deleteRetentionMs;
+
+ /**
+ * The max.message.bytes configuration option.
+ */
+ @Nullable
+ @JsonProperty("max.message.bytes")
+ private Integer maxMessageBytes;
+
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/mercure/MercureChannelBinding.java
similarity index 57%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/mercure/MercureChannelBinding.java
index 6e801d3a..d0c3703e 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/mercure/MercureChannelBinding.java
@@ -1,21 +1,21 @@
-package com.asyncapi.v2.binding.kafka;
+package com.asyncapi.v2.binding.channel.mercure;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
- * Describes Kafka server binding.
+ *
+ * Describes Mercure channel binding.
*
* @version 0.1.0
- * @see Kafka server binding
+ * @see Mercure channel binding
* @author Pavel Bodiachevskii
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
-public class KafkaServerBinding extends ServerBinding {
+public class MercureChannelBinding extends ChannelBinding {
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/mqtt/MQTTChannelBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/mqtt/MQTTChannelBinding.java
index feba35e3..ca180f07 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/mqtt/MQTTChannelBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.mqtt;
+package com.asyncapi.v2.binding.channel.mqtt;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes MQTT channel binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5ChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/mqtt5/MQTT5ChannelBinding.java
similarity index 79%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5ChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/mqtt5/MQTT5ChannelBinding.java
index 9e550a59..6b073eae 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5ChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/mqtt5/MQTT5ChannelBinding.java
@@ -1,16 +1,16 @@
-package com.asyncapi.v2.binding.mqtt5;
+package com.asyncapi.v2.binding.channel.mqtt5;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes MQTT 5 channel binding.
*
- * @version 0.1.0
+ * @version 0.2.0
* @see MQTT 5 channel binding
* @author Pavel Bodiachevskii
*/
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/nats/NATSChannelBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/nats/NATSChannelBinding.java
index 21e8f9e5..d8b53857 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/nats/NATSChannelBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.nats;
+package com.asyncapi.v2.binding.channel.nats;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes NATS channel binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/pulsar/PulsarChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/pulsar/PulsarChannelBinding.java
new file mode 100644
index 00000000..9bbae92f
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/pulsar/PulsarChannelBinding.java
@@ -0,0 +1,105 @@
+package com.asyncapi.v2.binding.channel.pulsar;
+
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * Describes Pulsar channel binding.
+ *
+ * @version 0.1.0
+ * @see Pulsar channel binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class PulsarChannelBinding extends ChannelBinding {
+
+ /**
+ * The namespace the channel is associated with.
+ */
+ @NotNull
+ private String namespace;
+
+ /**
+ * Persistence of the topic in Pulsar. It MUST be either persistent or non-persistent.
+ */
+ @NotNull
+ private String persistence;
+
+ /**
+ * Topic compaction threshold given in Megabytes.
+ */
+ @Nullable
+ private Integer compaction;
+
+ /**
+ * A list of clusters the topic is replicated to.
+ */
+ @Nullable
+ @JsonProperty("geo-replication")
+ private List geoReplication;
+
+ /**
+ * Topic retention policy.
+ */
+ @Nullable
+ private RetentionDefinition retention;
+
+ /**
+ * Message time-to-live in seconds.
+ */
+ @Nullable
+ private Integer ttl;
+
+ /**
+ * Message deduplication. When true, it ensures that each message produced on Pulsar topics is persisted to disk only once.
+ */
+ @Nullable
+ private Boolean deduplication;
+
+ /**
+ * The version of this binding. If omitted, "latest" MUST be assumed.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
+
+ /**
+ * The Retention Definition Object is used to describe the Pulsar Retention policy.
+ */
+ @Data
+ @Builder
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @EqualsAndHashCode
+ public static class RetentionDefinition {
+
+ /**
+ * Time given in Minutes.
+ */
+ @Nullable
+ @Builder.Default
+ private Integer time = 0;
+
+ /**
+ * Size given in MegaBytes.
+ */
+ @Nullable
+ @Builder.Default
+ private Integer size = 0;
+
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/redis/RedisChannelBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/redis/RedisChannelBinding.java
index d775ffb8..4edb073e 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/redis/RedisChannelBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.redis;
+package com.asyncapi.v2.binding.channel.redis;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes Redis channel binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/sns/SNSChannelBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/sns/SNSChannelBinding.java
index 0e8ab2fa..101d3629 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/sns/SNSChannelBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.sns;
+package com.asyncapi.v2.binding.channel.sns;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes SNS channel binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/solace/SolaceChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/solace/SolaceChannelBinding.java
new file mode 100644
index 00000000..58ff56e2
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/solace/SolaceChannelBinding.java
@@ -0,0 +1,23 @@
+package com.asyncapi.v2.binding.channel.solace;
+
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * This class MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * Describes Solace channel binding.
+ *
+ * @version 0.3.0
+ * @see Solace channel binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class SolaceChannelBinding extends ChannelBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/sqs/SQSChannelBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/sqs/SQSChannelBinding.java
index f53291fd..8a23ba1c 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/sqs/SQSChannelBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.sqs;
+package com.asyncapi.v2.binding.channel.sqs;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes SQS channel binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/stomp/STOMPChannelBinding.java
similarity index 73%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/stomp/STOMPChannelBinding.java
index ce7504c7..df9b5f31 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/stomp/STOMPChannelBinding.java
@@ -1,17 +1,17 @@
-package com.asyncapi.v2.binding.stomp;
+package com.asyncapi.v2.binding.channel.stomp;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes STOMP channel binding.
*
* @version 0.1.0
- * @see STOMP channel binding
+ * @see STOMP channel binding
* @author Pavel Bodiachevskii
*/
@Data
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/ws/WebSocketsChannelBinding.java
similarity index 80%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/ws/WebSocketsChannelBinding.java
index 93bf93c6..4a1d7ae2 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/channel/ws/WebSocketsChannelBinding.java
@@ -1,14 +1,16 @@
-package com.asyncapi.v2.binding.ws;
+package com.asyncapi.v2.binding.channel.ws;
-import com.asyncapi.v2.binding.ChannelBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.binding.channel.ChannelBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
/**
* Describes WebSockets channel binding.
- *
+ *
* When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual
* channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another
* way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake,
@@ -29,34 +31,33 @@ public class WebSocketsChannelBinding extends ChannelBinding {
* The HTTP method to use when establishing the connection. Its value MUST be either GET or POST.
*/
@Nullable
- @CheckForNull
private String method;
/**
+ * TODO: Schema object
* A Schema object containing the definitions for each query parameter. This schema MUST be of type
* object and have a properties key.
*
* @see Schema object
*/
@Nullable
- @CheckForNull
private Object query;
/**
+ * TODO: Schema object
* A Schema object containing the definitions of the HTTP headers to use when establishing the connection.
* This schema MUST be of type object and have a properties key.
*
* @see Schema object
*/
@Nullable
- @CheckForNull
private Object headers;
/**
* The version of this binding. If omitted, "latest" MUST be assumed.
*/
@Nullable
- @CheckForNull
- private String bindingVersion;
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/package-info.java
deleted file mode 100644
index 799e37c7..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe HTTP-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see HTTP bindings
- */
-package com.asyncapi.v2.binding.http;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/package-info.java
deleted file mode 100644
index cb564f62..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe JMS-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see JMS bindings
- */
-package com.asyncapi.v2.binding.jms;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaMessageBinding.java
deleted file mode 100644
index 890c7883..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaMessageBinding.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.asyncapi.v2.binding.kafka;
-
-import com.asyncapi.v2.binding.MessageBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-/**
- * Describes Kafka message binding.
- *
- * Contains information about the message representation in Kafka.
- *
- * @version 0.1.0
- * @see Kafka message binding
- * @author Pavel Bodiachevskii
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class KafkaMessageBinding extends MessageBinding {
-
- /**
- * The message key.
- *
- * @see Schema object
- */
- @Nullable
- @CheckForNull
- private Object key;
-
- /**
- * The version of this binding. If omitted, "latest" MUST be assumed.
- */
- @Nullable
- @CheckForNull
- private String bindingVersion;
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/package-info.java
deleted file mode 100644
index 7d95b0bc..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe Kafka-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see Kafka bindings
- */
-package com.asyncapi.v2.binding.kafka;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/MessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/MessageBinding.java
new file mode 100644
index 00000000..ebe7e2ed
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/MessageBinding.java
@@ -0,0 +1,13 @@
+package com.asyncapi.v2.binding.message;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.EqualsAndHashCode;
+
+/**
+ * Describes AsyncAPI message binding.
+ *
+ * @author Pavel Bodiachevskii
+ */
+@EqualsAndHashCode(callSuper = true)
+public class MessageBinding extends ExtendableObject {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/amqp/AMQPMessageBinding.java
similarity index 68%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/amqp/AMQPMessageBinding.java
index 58ea317b..73d05041 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/amqp/AMQPMessageBinding.java
@@ -1,14 +1,16 @@
-package com.asyncapi.v2.binding.amqp;
+package com.asyncapi.v2.binding.message.amqp;
-import com.asyncapi.v2.binding.MessageBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.binding.message.MessageBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
/**
* Describes AMQP 0-9-1 message binding.
- *
+ *
* Contains information about the message representation in AMQP.
*
* @version 0.2.0
@@ -26,21 +28,19 @@ public class AMQPMessageBinding extends MessageBinding {
* A MIME encoding for the message content.
*/
@Nullable
- @CheckForNull
private String contentEncoding;
/**
* Application-specific message type.
*/
@Nullable
- @CheckForNull
private String messageType;
/**
* The version of this binding. If omitted, "latest" MUST be assumed.
*/
@Nullable
- @CheckForNull
- private String bindingVersion;
+ @Builder.Default
+ private String bindingVersion = "0.2.0";
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1MessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/amqp1/AMQP1MessageBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1MessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/amqp1/AMQP1MessageBinding.java
index 4fbf6a32..5ef4bbaa 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1MessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/amqp1/AMQP1MessageBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.amqp1;
+package com.asyncapi.v2.binding.message.amqp1;
-import com.asyncapi.v2.binding.MessageBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes AMQP 1.0 message binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/anypointmq/AnypointMQMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/anypointmq/AnypointMQMessageBinding.java
new file mode 100644
index 00000000..0fcff490
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/anypointmq/AnypointMQMessageBinding.java
@@ -0,0 +1,42 @@
+package com.asyncapi.v2.binding.message.anypointmq;
+
+import com.asyncapi.v2.binding.message.MessageBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes Anypoint MQ message binding.
+ *
+ * @version 0.0.1
+ * @see Anypoint MQ message binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class AnypointMQMessageBinding extends MessageBinding {
+
+ /**
+ * OPTIONAL.
+ *
+ * A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers).
+ * This schema MUST be of type object and have a properties key. Examples of Anypoint MQ protocol headers are
+ * messageId and messageGroupId.
+ */
+ @Nullable
+ private Object headers;
+
+ /**
+ * OPTIONAL, defaults to latest. The version of this binding.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.0.1";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/googlepubsub/GooglePubSubMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/googlepubsub/GooglePubSubMessageBinding.java
new file mode 100644
index 00000000..55b85375
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/googlepubsub/GooglePubSubMessageBinding.java
@@ -0,0 +1,81 @@
+package com.asyncapi.v2.binding.message.googlepubsub;
+
+import com.asyncapi.v2.binding.message.MessageBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * The Message Binding Object is used to describe the Google Cloud Pub/Sub specific PubsubMessage details, alongside with
+ * pertintent parts of the Google Cloud Pub/Sub Schema Object, with AsyncAPI.
+ *
+ * Describes Google Cloud Pub/Sub message binding.
+ *
+ * @version 0.1.0
+ * @see Google Cloud Pub/Sub message binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class GooglePubSubMessageBinding extends MessageBinding {
+
+ /**
+ * If non-empty, identifies related messages for which publish order should be respected (For more information, see ordering messages .)
+ */
+ @Nullable
+ private String orderingKey;
+
+ /**
+ * Attributes for this message (If this field is empty, the message must contain non-empty data. This can be used to
+ * filter messages on the subscription.)
+ */
+ @Nullable
+ private Object attributes;
+
+ /**
+ * Describes the schema used to validate the payload of this message
+ */
+ @Nullable
+ private SchemaDefinition schema;
+
+ /**
+ * OPTIONAL, defaults to latest. The version of this binding.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
+
+ /**
+ * The Schema Definition Object is used to describe the Google Cloud Pub/Sub Schema Object with AsyncAPI.
+ * While some of this information could be, or is, described using native AsyncAPI, for consistency it makes sense to
+ * provide this information here at all times, especially for cases where AsyncAPI does not natively support describing
+ * payloads using a supported Google Cloud Pub/Sub schema format like Protobuf.
+ */
+ @Data
+ @Builder
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @EqualsAndHashCode
+ public static class SchemaDefinition {
+
+ /**
+ * The name of the schema
+ */
+ @Nullable
+ private String name;
+
+ /**
+ * The type of the schema
+ */
+ @Nullable
+ private String type;
+
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/http/HTTPMessageBinding.java
similarity index 70%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/http/HTTPMessageBinding.java
index 6a87623b..02014e14 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/http/HTTPMessageBinding.java
@@ -1,14 +1,16 @@
-package com.asyncapi.v2.binding.http;
+package com.asyncapi.v2.binding.message.http;
-import com.asyncapi.v2.binding.MessageBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.binding.message.MessageBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
/**
* Describes HTTP message binding.
- *
+ *
* Contains information about the message representation in HTTP.
*
* @version 0.1.0
@@ -29,14 +31,13 @@ public class HTTPMessageBinding extends MessageBinding {
* @see Schema object
*/
@Nullable
- @CheckForNull
private Object headers;
/**
* The version of this binding. If omitted, "latest" MUST be assumed.
*/
@Nullable
- @CheckForNull
- private String bindingVersion;
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/ibmmq/IBMMQMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/ibmmq/IBMMQMessageBinding.java
new file mode 100644
index 00000000..381c6062
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/ibmmq/IBMMQMessageBinding.java
@@ -0,0 +1,73 @@
+package com.asyncapi.v2.binding.message.ibmmq;
+
+import com.asyncapi.v2.binding.message.MessageBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes IBM MQ message binding.
+ *
+ * This object contains information about the message representation in IBM MQ.
+ *
+ * @version 0.1.0
+ * @see IBM MQ message binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class IBMMQMessageBinding extends MessageBinding {
+
+ /**
+ * The type of the message.
+ *
+ * MUST be either string, jms or binary
+ */
+ @Nullable
+ private String type;
+
+ /**
+ * Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma
+ * separated list. Supporting information on IBM MQ message formats can be found on this page in the IBM MQ Knowledge Center.
+ *
+ * OPTIONAL if type = binary
+ *
+ * headers MUST NOT be specified if type = string or jms
+ */
+ @Nullable
+ private String headers;
+
+ /**
+ * Provides additional information for application developers: describes the message type or format.
+ *
+ * The description field of the IBM MQ message binding object MAY include CommonMark markdown formatting.
+ * A minimum markdown syntax as described by CommonMark 0.27 is assumed.
+ */
+ @Nullable
+ private String description;
+
+ /**
+ * The recommended setting the client should use for the TTL (Time-To-Live) of the message.
+ * This is a period of time expressed in milliseconds and set by the application that puts the message.
+ * expiry values are API dependant e.g., MQI and JMS use different units of time and default values for unlimited.
+ * General information on IBM MQ message expiry can be found on this page in the IBM MQ Knowledge Center.
+ *
+ * expiry value MUST be either zero (unlimited) or greater than zero.
+ */
+ @Nullable
+ private Integer expiry;
+
+ /**
+ * The version of this binding.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/jms/JMSMessageBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/jms/JMSMessageBinding.java
index 772f7b11..46d271ad 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/jms/JMSMessageBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.jms;
+package com.asyncapi.v2.binding.message.jms;
-import com.asyncapi.v2.binding.MessageBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes JMS message binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/kafka/KafkaMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/kafka/KafkaMessageBinding.java
new file mode 100644
index 00000000..455cc905
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/kafka/KafkaMessageBinding.java
@@ -0,0 +1,61 @@
+package com.asyncapi.v2.binding.message.kafka;
+
+import com.asyncapi.v2.binding.message.MessageBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes Kafka message binding.
+ *
+ * Contains information about the message representation in Kafka.
+ *
+ * @version 0.1.0
+ * @see Kafka message binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class KafkaMessageBinding extends MessageBinding {
+
+ /**
+ * TODO: Avro Schema
+ * The message key.
+ *
+ * @see Schema object
+ */
+ @Nullable
+ private Object key;
+
+ /**
+ * If a Schema Registry is used when performing this operation, tells where the id of schema is stored (e.g. header or payload).
+ */
+ @Nullable
+ private String schemaIdLocation;
+
+ /**
+ * Number of bytes or vendor specific values when schema id is encoded in payload (e.g confluent/ apicurio-legacy / apicurio-new).
+ */
+ @Nullable
+ private String schemaIdPayloadEncoding;
+
+ /**
+ * Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied.
+ */
+ @Nullable
+ private String schemaLookupStrategy;
+
+ /**
+ * The version of this binding. If omitted, "latest" MUST be assumed.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.4.0";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaChannelBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/mercure/MercureMessageBinding.java
similarity index 57%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaChannelBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/mercure/MercureMessageBinding.java
index c05361b1..0bbe57b1 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaChannelBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/mercure/MercureMessageBinding.java
@@ -1,21 +1,21 @@
-package com.asyncapi.v2.binding.kafka;
+package com.asyncapi.v2.binding.message.mercure;
-import com.asyncapi.v2.binding.ChannelBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
- * Describes Kafka channel binding.
+ *
+ * Describes Mercure message binding.
*
* @version 0.1.0
- * @see Kafka channel binding
+ * @see Mercure message binding
* @author Pavel Bodiachevskii
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
-public class KafkaChannelBinding extends ChannelBinding {
+public class MercureMessageBinding extends MessageBinding {
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/mqtt/MQTTMessageBinding.java
similarity index 59%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/mqtt/MQTTMessageBinding.java
index be3a1369..2e24ebfb 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/mqtt/MQTTMessageBinding.java
@@ -1,14 +1,16 @@
-package com.asyncapi.v2.binding.mqtt;
+package com.asyncapi.v2.binding.message.mqtt;
-import com.asyncapi.v2.binding.MessageBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.binding.message.MessageBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
/**
* Describes MQTT message binding.
- *
+ *
* Contains information about the message representation in MQTT.
*
* @version 0.1.0
@@ -26,7 +28,7 @@ public class MQTTMessageBinding extends MessageBinding {
* The version of this binding. If omitted, "latest" MUST be assumed.
*/
@Nullable
- @CheckForNull
- private String bindingVersion;
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5MessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/mqtt5/MQTT5MessageBinding.java
similarity index 79%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5MessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/mqtt5/MQTT5MessageBinding.java
index a6b46a97..9b850e40 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5MessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/mqtt5/MQTT5MessageBinding.java
@@ -1,16 +1,16 @@
-package com.asyncapi.v2.binding.mqtt5;
+package com.asyncapi.v2.binding.message.mqtt5;
-import com.asyncapi.v2.binding.MessageBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes MQTT 5 message binding.
*
- * @version 0.1.0
+ * @version 0.2.0
* @see MQTT 5 message binding
* @author Pavel Bodiachevskii
*/
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/nats/NATSMessageBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/nats/NATSMessageBinding.java
index dc005ebe..d1d75520 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/nats/NATSMessageBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.nats;
+package com.asyncapi.v2.binding.message.nats;
-import com.asyncapi.v2.binding.MessageBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes NATS message binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/pulsar/PulsarMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/pulsar/PulsarMessageBinding.java
new file mode 100644
index 00000000..909994a2
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/pulsar/PulsarMessageBinding.java
@@ -0,0 +1,23 @@
+package com.asyncapi.v2.binding.message.pulsar;
+
+import com.asyncapi.v2.binding.message.MessageBinding;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * Describes Pulsar message binding.
+ *
+ * This object MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * @version 0.1.0
+ * @see Pulsar message binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class PulsarMessageBinding extends MessageBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/redis/RedisMessageBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/redis/RedisMessageBinding.java
index 1b937dc7..8218be2d 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/redis/RedisMessageBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.redis;
+package com.asyncapi.v2.binding.message.redis;
-import com.asyncapi.v2.binding.MessageBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes Redis message binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/sns/SNSMessageBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/sns/SNSMessageBinding.java
index 8206f9e8..d20c2d12 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/sns/SNSMessageBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.sns;
+package com.asyncapi.v2.binding.message.sns;
-import com.asyncapi.v2.binding.MessageBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes SNS message binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/solace/SolaceMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/solace/SolaceMessageBinding.java
new file mode 100644
index 00000000..3da3d1d5
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/solace/SolaceMessageBinding.java
@@ -0,0 +1,23 @@
+package com.asyncapi.v2.binding.message.solace;
+
+import com.asyncapi.v2.binding.message.MessageBinding;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * This class MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * Describes Solace message binding.
+ *
+ * @version 0.3.0
+ * @see Solace message binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class SolaceMessageBinding extends MessageBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/sqs/SQSMessageBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/sqs/SQSMessageBinding.java
index 9951730d..5ed5ea51 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/sqs/SQSMessageBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.sqs;
+package com.asyncapi.v2.binding.message.sqs;
-import com.asyncapi.v2.binding.MessageBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes SQS message binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/stomp/STOMPMessageBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/stomp/STOMPMessageBinding.java
index ef6b7f60..e6428f0d 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/stomp/STOMPMessageBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.stomp;
+package com.asyncapi.v2.binding.message.stomp;
-import com.asyncapi.v2.binding.MessageBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes STOMP message binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsMessageBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/ws/WebSocketsMessageBinding.java
similarity index 83%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsMessageBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/ws/WebSocketsMessageBinding.java
index 00927c15..61582b36 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsMessageBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/message/ws/WebSocketsMessageBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.ws;
+package com.asyncapi.v2.binding.message.ws;
-import com.asyncapi.v2.binding.MessageBinding;
+import com.asyncapi.v2.binding.message.MessageBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes WebSockets message binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/package-info.java
deleted file mode 100644
index f15f8957..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe MQTT-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see MQTT bindings
- */
-package com.asyncapi.v2.binding.mqtt;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/package-info.java
deleted file mode 100644
index 4e0cade8..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe MQTT 5-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see MQTT 5 bindings
- */
-package com.asyncapi.v2.binding.mqtt5;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSOperationBinding.java
deleted file mode 100644
index 81b21c9d..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSOperationBinding.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.asyncapi.v2.binding.nats;
-
-import com.asyncapi.v2.binding.OperationBinding;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-
-/**
- * This class MUST NOT contain any properties. Its name is reserved for future use.
- *
- * Describes NATS operation binding.
- *
- * @version 0.1.0
- * @see NATS operation binding
- * @author Pavel Bodiachevskii
- */
-@Data
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class NATSOperationBinding extends OperationBinding {
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/package-info.java
deleted file mode 100644
index e95ec34d..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe NATS-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see NATS bindings
- */
-package com.asyncapi.v2.binding.nats;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/OperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/OperationBinding.java
new file mode 100644
index 00000000..7b167eec
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/OperationBinding.java
@@ -0,0 +1,13 @@
+package com.asyncapi.v2.binding.operation;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.EqualsAndHashCode;
+
+/**
+ * Describes AsyncAPI operation binding.
+ *
+ * @author Pavel Bodiachevskii
+ */
+@EqualsAndHashCode(callSuper = true)
+public class OperationBinding extends ExtendableObject {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/amqp/AMQPOperationBinding.java
similarity index 72%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/amqp/AMQPOperationBinding.java
index 23137f1c..750ad728 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/amqp/AMQPOperationBinding.java
@@ -1,15 +1,18 @@
-package com.asyncapi.v2.binding.amqp;
+package com.asyncapi.v2.binding.operation.amqp;
-import com.asyncapi.v2.binding.OperationBinding;
-import lombok.*;
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
import java.util.List;
/**
* Describes AMQP 0-9-1 operation binding.
- *
+ *
* Contains information about the operation representation in AMQP.
*
* @version 0.2.0
@@ -26,84 +29,86 @@ public class AMQPOperationBinding extends OperationBinding {
/**
* TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero.
*/
- private int expiration;
+ @Nullable
+ private Integer expiration;
/**
* Identifies the user who has sent the message.
- *
+ *
* Applies to: publish, subscribe
*/
@Nullable
- @CheckForNull
private String userId;
/**
* The routing keys the message should be routed to at the time of publishing.
- *
+ *
* Applies to: publish, subscribe
*/
@Nullable
- @CheckForNull
private List cc;
/**
* A priority for the message.
- *
+ *
* Applies to: publish, subscribe
*/
- private int priority;
+ @Nullable
+ private Integer priority;
/**
* Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent).
- *
+ *
* Applies to: publish, subscribe
*/
- private int deliveryMode;
+ @Nullable
+ private Integer deliveryMode;
/**
* Whether the message is mandatory or not.
- *
+ *
* Applies to: publish
*/
- private boolean mandatory;
+ @Nullable
+ private Boolean mandatory;
/**
* Like {@link #cc} but consumers will not receive this information.
- *
+ *
* Applies to: publish
*/
@Nullable
- @CheckForNull
private List bcc;
/**
* Name of the queue where the consumer should send the response.
- *
+ *
* Applies to: publish, subscribe
*/
@Nullable
- @CheckForNull
private String replyTo;
/**
* Whether the message should include a timestamp or not.
- *
+ *
* Applies to: publish, subscribe
*/
- private boolean timestamp;
+ @Nullable
+ private Boolean timestamp;
/**
* Whether the consumer should ack the message or not.
- *
+ *
* Applies to: subscribe
*/
- private boolean ack;
+ @Nullable
+ private Boolean ack;
/**
* The version of this binding. If omitted, "latest" MUST be assumed.
*/
@Nullable
- @CheckForNull
- private String bindingVersion;
+ @Builder.Default
+ private String bindingVersion = "0.2.0";
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1OperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/amqp1/AMQP1OperationBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1OperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/amqp1/AMQP1OperationBinding.java
index a4a1a8c9..f92e1e29 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1OperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/amqp1/AMQP1OperationBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.amqp1;
+package com.asyncapi.v2.binding.operation.amqp1;
-import com.asyncapi.v2.binding.OperationBinding;
+import com.asyncapi.v2.binding.operation.OperationBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes AMQP 1.0 operation binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/anypointmq/AnypointMQOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/anypointmq/AnypointMQOperationBinding.java
new file mode 100644
index 00000000..c2f2fb18
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/anypointmq/AnypointMQOperationBinding.java
@@ -0,0 +1,21 @@
+package com.asyncapi.v2.binding.operation.anypointmq;
+
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * This class MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * Describes Anypoint MQ operation binding.
+ *
+ * @version 0.0.1
+ * @see Anypoint MQ operation binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class AnypointMQOperationBinding extends OperationBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/googlepubsub/GooglePubSubOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/googlepubsub/GooglePubSubOperationBinding.java
new file mode 100644
index 00000000..69727478
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/googlepubsub/GooglePubSubOperationBinding.java
@@ -0,0 +1,21 @@
+package com.asyncapi.v2.binding.operation.googlepubsub;
+
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * This class MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * Describes Google Cloud Pub/Sub operation binding.
+ *
+ * @version 0.1.0
+ * @see Google Cloud Pub/Sub operation binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class GooglePubSubOperationBinding extends OperationBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/http/HTTPOperationBinding.java
similarity index 74%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/http/HTTPOperationBinding.java
index 7654b379..5789296b 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/http/HTTPOperationBinding.java
@@ -1,15 +1,17 @@
-package com.asyncapi.v2.binding.http;
+package com.asyncapi.v2.binding.operation.http;
-import com.asyncapi.v2.binding.OperationBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Describes HTTP operation binding.
- *
+ *
* Contains information about the operation representation in HTTP.
*
* @version 0.1.0
@@ -25,11 +27,10 @@ public class HTTPOperationBinding extends OperationBinding {
/**
* Required.
- *
+ *
* Type of operation. Its value MUST be either request or response.
*/
- @NonNull
- @Nonnull
+ @NotNull
private String type;
/**
@@ -37,7 +38,6 @@ public class HTTPOperationBinding extends OperationBinding {
* GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT, and TRACE.
*/
@Nullable
- @CheckForNull
private String method;
/**
@@ -47,14 +47,13 @@ public class HTTPOperationBinding extends OperationBinding {
* @see Schema object
*/
@Nullable
- @CheckForNull
private Object query;
/**
* The version of this binding. If omitted, "latest" MUST be assumed.
*/
@Nullable
- @CheckForNull
- private String bindingVersion;
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/ibmmq/IBMMQOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/ibmmq/IBMMQOperationBinding.java
new file mode 100644
index 00000000..e974652a
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/ibmmq/IBMMQOperationBinding.java
@@ -0,0 +1,23 @@
+package com.asyncapi.v2.binding.operation.ibmmq;
+
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * Describes IBM MQ operation binding.
+ *
+ * This object MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * @version 0.1.0
+ * @see IBM MQ operation binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class IBMMQOperationBinding extends OperationBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/jms/JMSOperationBinding.java
similarity index 81%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/jms/JMSOperationBinding.java
index d3d833f2..20c32de1 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/jms/JMSOperationBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.jms;
+package com.asyncapi.v2.binding.operation.jms;
-import com.asyncapi.v2.binding.OperationBinding;
+import com.asyncapi.v2.binding.operation.OperationBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes JMS operation binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/kafka/KafkaOperationBinding.java
similarity index 70%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/kafka/KafkaOperationBinding.java
index c67074a5..7fba6666 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/kafka/KafkaOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/kafka/KafkaOperationBinding.java
@@ -1,14 +1,16 @@
-package com.asyncapi.v2.binding.kafka;
+package com.asyncapi.v2.binding.operation.kafka;
-import com.asyncapi.v2.binding.OperationBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
/**
* Describes Kafka operation binding.
- *
+ *
* Contains information about the operation representation in Kafka.
*
* @version 0.1.0
@@ -23,28 +25,28 @@
public class KafkaOperationBinding extends OperationBinding {
/**
+ * TODO: Schema
* Id of the consumer group.
*
* @see Schema object
*/
@Nullable
- @CheckForNull
private Object groupId;
/**
+ * TODO: Schema
* Id of the consumer inside a consumer group.
*
* @see Schema object
*/
@Nullable
- @CheckForNull
private Object clientId;
/**
* The version of this binding. If omitted, "latest" MUST be assumed.
*/
@Nullable
- @CheckForNull
- private String bindingVersion;
+ @Builder.Default
+ private String bindingVersion = "0.4.0";
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/mercure/MercureOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/mercure/MercureOperationBinding.java
new file mode 100644
index 00000000..0161bd0c
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/mercure/MercureOperationBinding.java
@@ -0,0 +1,21 @@
+package com.asyncapi.v2.binding.operation.mercure;
+
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * This class MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * Describes Mercure operation binding.
+ *
+ * @version 0.1.0
+ * @see Mercure operation binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class MercureOperationBinding extends OperationBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/mqtt/MQTTOperationBinding.java
similarity index 64%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/mqtt/MQTTOperationBinding.java
index dbbff587..9938a7a4 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/mqtt/MQTTOperationBinding.java
@@ -1,14 +1,16 @@
-package com.asyncapi.v2.binding.mqtt;
+package com.asyncapi.v2.binding.operation.mqtt;
-import com.asyncapi.v2.binding.OperationBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
/**
* Describes MQTT operation binding.
- *
+ *
* Contains information about the operation representation in MQTT.
*
* @version 0.1.0
@@ -25,25 +27,27 @@ public class MQTTOperationBinding extends OperationBinding {
/**
* Defines how hard the broker/client will try to ensure that a message is received.
* Its value MUST be either 0, 1 or 2.
- *
+ *
* Applies to: publish, subscribe
*/
- private int qos;
+ @Nullable
+ private Integer qos;
/**
* Whether the broker should retain the message or not.
- *
+ *
* Applies to: publish, subscribe
*/
- private boolean retain;
+ @Nullable
+ private Boolean retain;
/**
* The version of this binding. If omitted, "latest" MUST be assumed.
- *
+ *
* Applies to: publish, subscribe
*/
@Nullable
- @CheckForNull
- private String bindingVersion;
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5OperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/mqtt5/MQTT5OperationBinding.java
similarity index 79%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5OperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/mqtt5/MQTT5OperationBinding.java
index e67b2f96..1d804a44 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5OperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/mqtt5/MQTT5OperationBinding.java
@@ -1,16 +1,16 @@
-package com.asyncapi.v2.binding.mqtt5;
+package com.asyncapi.v2.binding.operation.mqtt5;
-import com.asyncapi.v2.binding.OperationBinding;
+import com.asyncapi.v2.binding.operation.OperationBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes MQTT 5 operation binding.
*
- * @version 0.1.0
+ * @version 0.2.0
* @see MQTT 5 operation binding
* @author Pavel Bodiachevskii
*/
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/nats/NATSOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/nats/NATSOperationBinding.java
new file mode 100644
index 00000000..4ee0ea3b
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/nats/NATSOperationBinding.java
@@ -0,0 +1,38 @@
+package com.asyncapi.v2.binding.operation.nats;
+
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes NATS operation binding.
+ *
+ * @version 0.1.0
+ * @see NATS operation binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class NATSOperationBinding extends OperationBinding {
+
+ /**
+ * Defines the name of the queue to use. It MUST NOT exceed 255 characters.
+ */
+ @Nullable
+ private String queue;
+
+ /**
+ * The version of this binding. If omitted, "latest" MUST be assumed.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/pulsar/PulsarOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/pulsar/PulsarOperationBinding.java
new file mode 100644
index 00000000..4401701e
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/pulsar/PulsarOperationBinding.java
@@ -0,0 +1,23 @@
+package com.asyncapi.v2.binding.operation.pulsar;
+
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * Describes Pulsar operation binding.
+ *
+ * This object MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * @version 0.1.0
+ * @see Pulsar operation binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class PulsarOperationBinding extends OperationBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/redis/RedisOperationBinding.java
similarity index 81%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/redis/RedisOperationBinding.java
index a802104a..a48e021a 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/redis/RedisOperationBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.redis;
+package com.asyncapi.v2.binding.operation.redis;
-import com.asyncapi.v2.binding.OperationBinding;
+import com.asyncapi.v2.binding.operation.OperationBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes Redis operation binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/sns/SNSOperationBinding.java
similarity index 81%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/sns/SNSOperationBinding.java
index 22e62b1a..c066056a 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/sns/SNSOperationBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.sns;
+package com.asyncapi.v2.binding.operation.sns;
-import com.asyncapi.v2.binding.OperationBinding;
+import com.asyncapi.v2.binding.operation.OperationBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes SNS operation binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/SolaceDestination.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/SolaceDestination.java
new file mode 100644
index 00000000..b4f67d02
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/SolaceDestination.java
@@ -0,0 +1,72 @@
+package com.asyncapi.v2.binding.operation.solace;
+
+import com.asyncapi.v2.binding.operation.solace.queue.SolaceQueue;
+import com.asyncapi.v2.binding.operation.solace.topic.SolaceTopic;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes Solace destination.
+ *
+ * Contains information about the destination in Solace PubSub+ Broker.
+ *
+ * @version 0.3.0
+ * @see Solace operation binding
+ * @author Dennis Brinley, Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SolaceDestination {
+
+ /**
+ * 'queue' or 'topic'. If the type is queue, then the subscriber can bind to the queue, which in turn will
+ * subscribe to the topic as represented by the channel name or to the provided topicSubscriptions.
+ */
+ @Nullable
+ private Type destinationType;
+
+ /**
+ * 'direct' or 'persistent'. This determines the quality of service for publishing messages as documented here .
+ * Default is 'persistent'.
+ */
+ @Nullable
+ @Builder.Default
+ private DeliveryMode deliveryMode = DeliveryMode.PERSISTENT;
+
+ /**
+ * Solace queue destination details.
+ */
+ @Nullable
+ private SolaceQueue queue;
+
+ /**
+ * Solace topic destination details
+ */
+ @Nullable
+ private SolaceTopic topic;
+
+ public enum Type {
+
+ @JsonProperty("queue")
+ QUEUE,
+ @JsonProperty("topic")
+ TOPIC;
+
+ }
+
+ public enum DeliveryMode {
+
+ @JsonProperty("direct")
+ DIRECT,
+ @JsonProperty("persistent")
+ PERSISTENT;
+
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/SolaceOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/SolaceOperationBinding.java
new file mode 100644
index 00000000..c206866c
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/SolaceOperationBinding.java
@@ -0,0 +1,44 @@
+package com.asyncapi.v2.binding.operation.solace;
+
+import com.asyncapi.v2.binding.operation.OperationBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Describes Solace operation binding.
+ *
+ * Contains information about the operation representation in Solace PubSub+ Broker.
+ *
+ * @version 0.3.0
+ * @see Solace operation binding
+ * @author Dennis Brinley, Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class SolaceOperationBinding extends OperationBinding {
+
+ /**
+ * List of destinations
+ */
+ @Nullable
+ @Builder.Default
+ private List destinations = new ArrayList<>();
+
+ /**
+ * Version of the binding object (e.g. bindingVersion: 0.3.0)
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.3.0";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/queue/SolaceQueue.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/queue/SolaceQueue.java
new file mode 100644
index 00000000..ff33a4e9
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/queue/SolaceQueue.java
@@ -0,0 +1,69 @@
+package com.asyncapi.v2.binding.operation.solace.queue;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * Describes Solace queue.
+ *
+ * Contains information about the queue in Solace PubSub+ Broker.
+ *
+ * @version 0.3.0
+ * @see Solace operation binding
+ * @author Dennis Brinley, Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SolaceQueue {
+
+ /**
+ * The name of the queue, only applicable when destinationType is 'queue'.
+ */
+ @Nullable
+ private String name;
+
+ /**
+ * A list of topics that the queue subscribes to, only applicable when destinationType is 'queue'.
+ * If none is given, the queue subscribes to the topic as represented by the channel name.
+ */
+ @Nullable
+ private List topicSubscriptions;
+
+ /**
+ * 'exclusive' or 'nonexclusive'. This is documented here . Only applicable when destinationType is 'queue'.
+ */
+ @Nullable
+ private AccessType accessType;
+
+ /**
+ * The maximum amount of message spool that the given queue may use. This is documented here .
+ * Only applicable when destinationType is 'queue'.
+ */
+ @Nullable
+ private String maxMsgSpoolSize;
+
+ /**
+ * The maximum TTL to apply to messages to be spooled. This is documented here .
+ * Only applicable when destinationType is 'queue'.
+ */
+ @Nullable
+ private String maxTtl;
+
+ public enum AccessType {
+
+ @JsonProperty("exclusive")
+ EXCLUSIVE,
+ @JsonProperty("non-exclusive")
+ NON_EXCLUSIVE;
+
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/topic/SolaceTopic.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/topic/SolaceTopic.java
new file mode 100644
index 00000000..69b316ac
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/solace/topic/SolaceTopic.java
@@ -0,0 +1,33 @@
+package com.asyncapi.v2.binding.operation.solace.topic;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.List;
+
+/**
+ * Describes Solace topic.
+ *
+ * Contains information about the topic in Solace PubSub+ Broker.
+ *
+ * @version 0.3.0
+ * @see Solace operation binding
+ * @author Dennis Brinley, Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SolaceTopic {
+
+ /**
+ * A list of topics that the client subscribes to, only applicable when destinationType is 'topic'.
+ * If none is given, the client subscribes to the topic as represented by the channel name.
+ */
+ @Nullable
+ protected List topicSubscriptions;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/sqs/SQSOperationBinding.java
similarity index 81%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/sqs/SQSOperationBinding.java
index 9a1d1a09..e527e551 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/sqs/SQSOperationBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.sqs;
+package com.asyncapi.v2.binding.operation.sqs;
-import com.asyncapi.v2.binding.OperationBinding;
+import com.asyncapi.v2.binding.operation.OperationBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes SQS operation binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/stomp/STOMPOperationBinding.java
similarity index 81%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/stomp/STOMPOperationBinding.java
index f0d33f31..db615991 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/stomp/STOMPOperationBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.stomp;
+package com.asyncapi.v2.binding.operation.stomp;
-import com.asyncapi.v2.binding.OperationBinding;
+import com.asyncapi.v2.binding.operation.OperationBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes STOMP operation binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsOperationBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/ws/WebSocketsOperationBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsOperationBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/ws/WebSocketsOperationBinding.java
index 2a7b0da2..bba61517 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsOperationBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/operation/ws/WebSocketsOperationBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.ws;
+package com.asyncapi.v2.binding.operation.ws;
-import com.asyncapi.v2.binding.OperationBinding;
+import com.asyncapi.v2.binding.operation.OperationBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes WebSockets operation binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/package-info.java
deleted file mode 100644
index 3d64e409..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe Redis-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see Redis binding
- */
-package com.asyncapi.v2.binding.redis;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/ServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/ServerBinding.java
new file mode 100644
index 00000000..ed0c727c
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/ServerBinding.java
@@ -0,0 +1,14 @@
+package com.asyncapi.v2.binding.server;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.EqualsAndHashCode;
+
+/**
+ * Describes AsyncAPI server binding.
+ *
+ * @version 2.6.0
+ * @author Pavel Bodiachevskii
+ */
+@EqualsAndHashCode(callSuper = true)
+public class ServerBinding extends ExtendableObject {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/amqp/AMQPServerBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/amqp/AMQPServerBinding.java
index 2fd7d0e1..78523a63 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp/AMQPServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/amqp/AMQPServerBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.amqp;
+package com.asyncapi.v2.binding.server.amqp;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes AMQP 0-9-1 server binding.
*
* @version 0.2.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1ServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/amqp1/AMQP1ServerBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1ServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/amqp1/AMQP1ServerBinding.java
index da119d36..661759c1 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/amqp1/AMQP1ServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/amqp1/AMQP1ServerBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.amqp1;
+package com.asyncapi.v2.binding.server.amqp1;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes AMQP 1.0 server binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/anypointmq/AnypointMQServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/anypointmq/AnypointMQServerBinding.java
new file mode 100644
index 00000000..08ec2b17
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/anypointmq/AnypointMQServerBinding.java
@@ -0,0 +1,21 @@
+package com.asyncapi.v2.binding.server.anypointmq;
+
+import com.asyncapi.v2.binding.server.ServerBinding;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * This class MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * Describes Anypoint MQ server binding.
+ *
+ * @version 0.0.1
+ * @see Anypoint MQ server binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class AnypointMQServerBinding extends ServerBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/googlepubsub/GooglePubSubServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/googlepubsub/GooglePubSubServerBinding.java
new file mode 100644
index 00000000..56ffd92a
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/googlepubsub/GooglePubSubServerBinding.java
@@ -0,0 +1,21 @@
+package com.asyncapi.v2.binding.server.googlepubsub;
+
+import com.asyncapi.v2.binding.server.ServerBinding;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * This class MUST NOT contain any properties. Its name is reserved for future use.
+ *
+ * Describes Google Cloud Pub/Sub server binding.
+ *
+ * @version 0.1.0
+ * @see Google Cloud Pub/Sub server binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class GooglePubSubServerBinding extends ServerBinding {
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/http/HTTPServerBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/http/HTTPServerBinding.java
index e10878fb..091ac279 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/http/HTTPServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/http/HTTPServerBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.http;
+package com.asyncapi.v2.binding.server.http;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes HTTP server binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/ibmmq/IBMMQServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/ibmmq/IBMMQServerBinding.java
new file mode 100644
index 00000000..0e63bedc
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/ibmmq/IBMMQServerBinding.java
@@ -0,0 +1,82 @@
+package com.asyncapi.v2.binding.server.ibmmq;
+
+import com.asyncapi.v2.binding.server.ServerBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes IBM MQ server binding.
+ *
+ * This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager.
+ * This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.
+ *
+ * @version 0.1.0
+ * @see IBM MQ server binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class IBMMQServerBinding extends ServerBinding {
+
+ /**
+ * Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used
+ * in high availability deployments. If omitted, the server object is not part of a group.
+ *
+ * MUST NOT be specified for URI Scheme http:// or file://
+ */
+ @Nullable
+ private String groupId;
+
+ /**
+ * The name of the IBM MQ queue manager to bind to in the CCDT file.
+ *
+ * MUST NOT be specified for URI Scheme ibmmq://
+ */
+ @Nullable
+ @Builder.Default
+ private String ccdtQueueManagerName = "*";
+
+ /**
+ * The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager.
+ * More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center.
+ *
+ * MUST NOT be specified for protocol ibmmq or URI Scheme file:// or http://
+ */
+ @Nullable
+ @Builder.Default
+ private String cipherSpec = "ANY";
+
+ /**
+ * If multiEndpointServer is true then multiple connections can be workload balanced and applications should not make
+ * assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources
+ * is necessary, a single endpoint (multiEndpointServer = false) may be required.
+ *
+ * MUST NOT be specified for URI Scheme file:// or http://
+ */
+ @Builder.Default
+ private boolean multiEndpointServer = false;
+
+ /**
+ * The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity.
+ * A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager.
+ * More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center.
+ *
+ * MUST be 0-999999
+ */
+ @Builder.Default
+ private int heartBeatInterval = 300;
+
+ /**
+ * The version of this binding.
+ */
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/jms/JMSServerBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/jms/JMSServerBinding.java
index d3fb0abf..f205f22a 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/jms/JMSServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/jms/JMSServerBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.jms;
+package com.asyncapi.v2.binding.server.jms;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes JMS server binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/kafka/KafkaServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/kafka/KafkaServerBinding.java
new file mode 100644
index 00000000..d1d3994a
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/kafka/KafkaServerBinding.java
@@ -0,0 +1,46 @@
+package com.asyncapi.v2.binding.server.kafka;
+
+import com.asyncapi.v2.binding.server.ServerBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes Kafka server binding.
+ *
+ * @version 0.4.0
+ * @see Kafka server binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class KafkaServerBinding extends ServerBinding {
+
+ /**
+ * API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)
+ */
+ @Nullable
+ private String schemaRegistryUrl;
+
+ /**
+ * MUST NOT be specified if schemaRegistryUrl is not specified
+ *
+ * The vendor of Schema Registry and Kafka serdes library that should be used (e.g. apicurio, confluent, ibm, or karapace)
+ */
+ @Nullable
+ private String schemaRegistryVendor;
+
+ /**
+ * The version of this binding.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.4.0";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5ServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/mercure/MercureServerBinding.java
similarity index 57%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5ServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/mercure/MercureServerBinding.java
index ed26e78b..4941376b 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt5/MQTT5ServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/mercure/MercureServerBinding.java
@@ -1,21 +1,21 @@
-package com.asyncapi.v2.binding.mqtt5;
+package com.asyncapi.v2.binding.server.mercure;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
- * Describes MQTT 5 server binding.
+ *
+ * Describes Mercure server binding.
*
* @version 0.1.0
- * @see MQTT 5 server binding
+ * @see Mercure server binding
* @author Pavel Bodiachevskii
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
-public class MQTT5ServerBinding extends ServerBinding {
+public class MercureServerBinding extends ServerBinding {
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/mqtt/MQTTServerBinding.java
similarity index 76%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/mqtt/MQTTServerBinding.java
index 96fa7639..bf38fc3f 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/mqtt/MQTTServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/mqtt/MQTTServerBinding.java
@@ -1,14 +1,17 @@
-package com.asyncapi.v2.binding.mqtt;
+package com.asyncapi.v2.binding.server.mqtt;
-import com.asyncapi.v2.binding.ServerBinding;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.binding.server.ServerBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Describes MQTT server binding.
- *
+ *
* Contains information about the server representation in MQTT.
*
* @version 0.1.0
@@ -26,7 +29,6 @@ public class MQTTServerBinding extends ServerBinding {
* The client identifier.
*/
@Nullable
- @CheckForNull
private String clientId;
/**
@@ -38,7 +40,6 @@ public class MQTTServerBinding extends ServerBinding {
* Last Will and Testament configuration.
*/
@Nullable
- @CheckForNull
private LastWillConfiguration lastWill;
/**
@@ -50,10 +51,11 @@ public class MQTTServerBinding extends ServerBinding {
* The version of this binding. If omitted, "latest" MUST be assumed.
*/
@Nullable
- @CheckForNull
- private String bindingVersion;
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
@Data
+ @EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
public static class LastWillConfiguration {
@@ -61,8 +63,7 @@ public static class LastWillConfiguration {
/**
* The topic where the Last Will and Testament message will be sent.
*/
- @Nullable
- @CheckForNull
+ @NotNull
private String topic;
/**
@@ -71,6 +72,12 @@ public static class LastWillConfiguration {
*/
private int qos;
+ /**
+ * Last Will message.
+ */
+ @Nullable
+ private String message;
+
/**
* Whether the broker should retain the Last Will and Testament message or not.
*/
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/mqtt5/MQTT5ServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/mqtt5/MQTT5ServerBinding.java
new file mode 100644
index 00000000..d2bf748f
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/mqtt5/MQTT5ServerBinding.java
@@ -0,0 +1,33 @@
+package com.asyncapi.v2.binding.server.mqtt5;
+
+import com.asyncapi.v2.binding.server.ServerBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * Describes MQTT 5 server binding.
+ *
+ * @version 0.2.0
+ * @see MQTT 5 server binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class MQTT5ServerBinding extends ServerBinding {
+
+ /**
+ * TODO: support reference, Schema object
+ * Session Expiry Interval in seconds or a Schema Object containing the definition of the interval.
+ */
+ private int sessionExpiryInterval;
+
+ @Builder.Default
+ private String bindingVersion = "0.2.0";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/nats/NATSServerBinding.java
similarity index 73%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/nats/NATSServerBinding.java
index cb3ce02f..913b1fb4 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/nats/NATSServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/nats/NATSServerBinding.java
@@ -1,17 +1,17 @@
-package com.asyncapi.v2.binding.nats;
+package com.asyncapi.v2.binding.server.nats;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes NATS channel binding.
*
* @version 0.1.0
- * @see NATS channel binding
+ * @see NATS server binding
* @author Pavel Bodiachevskii
*/
@Data
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/pulsar/PulsarServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/pulsar/PulsarServerBinding.java
new file mode 100644
index 00000000..29e3db6d
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/pulsar/PulsarServerBinding.java
@@ -0,0 +1,39 @@
+package com.asyncapi.v2.binding.server.pulsar;
+
+import com.asyncapi.v2.binding.server.ServerBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes Pulsar server binding.
+ *
+ * @version 0.1.0
+ * @see Redis server binding
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class PulsarServerBinding extends ServerBinding {
+
+ /**
+ * The pulsar tenant. If omitted, "public" MUST be assumed.
+ */
+ @Nullable
+ @Builder.Default
+ private String tenant = "public";
+
+ /**
+ * The version of this binding.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.1.0";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/redis/RedisServerBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/redis/RedisServerBinding.java
index a7967cec..ba4018c7 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/redis/RedisServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/redis/RedisServerBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.redis;
+package com.asyncapi.v2.binding.server.redis;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes Redis server binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/sns/SNSServerBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/sns/SNSServerBinding.java
index f7bffbef..15fbfa81 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/SNSServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/sns/SNSServerBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.sns;
+package com.asyncapi.v2.binding.server.sns;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes SNS server binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/solace/SolaceServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/solace/SolaceServerBinding.java
new file mode 100644
index 00000000..00641525
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/solace/SolaceServerBinding.java
@@ -0,0 +1,40 @@
+package com.asyncapi.v2.binding.server.solace;
+
+import com.asyncapi.v2.binding.server.ServerBinding;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Describes Solace server binding.
+ *
+ * @version 0.3.0
+ * @see Solace server binding
+ * @author Dennis Brinley, Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class SolaceServerBinding extends ServerBinding {
+
+ /**
+ * Message VPN of the Solace Broker
+ *
+ * e.g. msgVpn: solace-broker-msg-vpn
+ */
+ @Nullable
+ private String msgVpn;
+
+ /**
+ * The version of this binding.
+ */
+ @Nullable
+ @Builder.Default
+ private String bindingVersion = "0.3.0";
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/sqs/SQSServerBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/sqs/SQSServerBinding.java
index cd004124..bb6f90ef 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/SQSServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/sqs/SQSServerBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.sqs;
+package com.asyncapi.v2.binding.server.sqs;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes SQS server binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/stomp/STOMPServerBinding.java
similarity index 82%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/stomp/STOMPServerBinding.java
index b4364104..9d3b4ac5 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/STOMPServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/stomp/STOMPServerBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.stomp;
+package com.asyncapi.v2.binding.server.stomp;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes STOMP server binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsServerBinding.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/ws/WebSocketsServerBinding.java
similarity index 83%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsServerBinding.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/ws/WebSocketsServerBinding.java
index 11dc2583..99f76072 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/WebSocketsServerBinding.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/server/ws/WebSocketsServerBinding.java
@@ -1,13 +1,13 @@
-package com.asyncapi.v2.binding.ws;
+package com.asyncapi.v2.binding.server.ws;
-import com.asyncapi.v2.binding.ServerBinding;
+import com.asyncapi.v2.binding.server.ServerBinding;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
- *
+ *
* Describes WebSockets server binding.
*
* @version 0.1.0
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/package-info.java
deleted file mode 100644
index 333b6631..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sns/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe SNS-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see SNS bindings
- */
-package com.asyncapi.v2.binding.sns;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/package-info.java
deleted file mode 100644
index 1615d317..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/sqs/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe SQS-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see SQS bindings
- */
-package com.asyncapi.v2.binding.sqs;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/package-info.java
deleted file mode 100644
index 93e8a455..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/stomp/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe STOMP-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see STOMP bindings
- */
-package com.asyncapi.v2.binding.stomp;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/package-info.java b/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/package-info.java
deleted file mode 100644
index 89ea1854..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/binding/ws/package-info.java
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * This classes defines how to describe WebSockets-specific information on AsyncAPI.
- *
- * @version 0.1.0
- * @see WebSockets Bindings
- */
-package com.asyncapi.v2.binding.ws;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsParametersDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/BindingsMapDeserializer.java
similarity index 53%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsParametersDeserializer.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/jackson/BindingsMapDeserializer.java
index 39f1c26f..7b78380f 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsParametersDeserializer.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/BindingsMapDeserializer.java
@@ -1,27 +1,22 @@
package com.asyncapi.v2.jackson;
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.channel.Parameter;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
- * Serializes channel parameters map.
- *
- * @author Pavel Bodiachevskii
+ * Deserializes AsyncAPI bindings map.
*/
-public class ComponentsParametersDeserializer extends JsonDeserializer> {
+public abstract class BindingsMapDeserializer extends JsonDeserializer> {
- private final ObjectMapper objectMapper = new ObjectMapper();
+ public abstract Object chooseKnownPojo(String bindingKey, JsonNode binding, ObjectCodec objectCodec) throws IOException;
@Override
public Map deserialize(
@@ -31,27 +26,19 @@ public Map deserialize(
ObjectCodec objectCodec = p.getCodec();
JsonNode node = objectCodec.readTree(p);
- Map parameters = new HashMap<>();
+ Map bindings = new HashMap<>();
node.fieldNames().forEachRemaining(
fieldName -> {
try {
- parameters.put(fieldName, chooseKnownPojo(node.get(fieldName)));
+ bindings.put(fieldName, chooseKnownPojo(fieldName, node.get(fieldName), objectCodec));
} catch (IOException e) {
e.printStackTrace();
}
}
);
- return parameters;
- }
-
- private Object chooseKnownPojo(JsonNode parametersValue) throws IOException {
- if (parametersValue.get("$ref") != null) {
- return objectMapper.readValue(parametersValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(parametersValue.toString(), Parameter.class);
- }
+ return bindings;
}
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ChannelParametersDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ChannelParametersDeserializer.java
deleted file mode 100644
index 0ae5d854..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ChannelParametersDeserializer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.channel.Parameter;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Serializes channel parameters map.
- *
- * @author Pavel Bodiachevskii
- */
-public class ChannelParametersDeserializer extends JsonDeserializer> {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Map deserialize(
- JsonParser p,
- DeserializationContext ctxt
- ) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- Map parameters = new HashMap<>();
-
- node.fieldNames().forEachRemaining(
- fieldName -> {
- try {
- parameters.put(fieldName, chooseKnownPojo(node.get(fieldName)));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- );
-
- return parameters;
- }
-
- private Object chooseKnownPojo(JsonNode parametersValue) throws IOException {
- if (parametersValue.get("$ref") != null) {
- return objectMapper.readValue(parametersValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(parametersValue.toString(), Parameter.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsMessagesDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsMessagesDeserializer.java
deleted file mode 100644
index abb158ac..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsMessagesDeserializer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.channel.message.Message;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Serializes component security schemes map.
- *
- * @author Pavel Bodiachevskii
- */
-public class ComponentsMessagesDeserializer extends JsonDeserializer> {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Map deserialize(
- JsonParser p,
- DeserializationContext ctxt
- ) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- Map parameters = new HashMap<>();
-
- node.fieldNames().forEachRemaining(
- fieldName -> {
- try {
- parameters.put(fieldName, chooseKnownPojo(node.get(fieldName)));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- );
-
- return parameters;
- }
-
- private Object chooseKnownPojo(JsonNode parametersValue) throws IOException {
- if (parametersValue.get("$ref") != null) {
- return objectMapper.readValue(parametersValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(parametersValue.toString(), Message.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsSchemasDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsSchemasDeserializer.java
deleted file mode 100644
index ec280cab..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsSchemasDeserializer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.schema.Schema;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Serializes component schemas map.
- *
- * @author Pavel Bodiachevskii
- */
-public class ComponentsSchemasDeserializer extends JsonDeserializer> {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Map deserialize(
- JsonParser p,
- DeserializationContext ctxt
- ) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- Map parameters = new HashMap<>();
-
- node.fieldNames().forEachRemaining(
- fieldName -> {
- try {
- parameters.put(fieldName, chooseKnownPojo(node.get(fieldName)));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- );
-
- return parameters;
- }
-
- private Object chooseKnownPojo(JsonNode parametersValue) throws IOException {
- if (parametersValue.get("$ref") != null) {
- return objectMapper.readValue(parametersValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(parametersValue.toString(), Schema.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsSecuritySchemesDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsSecuritySchemesDeserializer.java
deleted file mode 100644
index 053a7d73..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ComponentsSecuritySchemesDeserializer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.security_scheme.SecurityScheme;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Serializes component security schemes map.
- *
- * @author Pavel Bodiachevskii
- */
-public class ComponentsSecuritySchemesDeserializer extends JsonDeserializer> {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Map deserialize(
- JsonParser p,
- DeserializationContext ctxt
- ) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- Map parameters = new HashMap<>();
-
- node.fieldNames().forEachRemaining(
- fieldName -> {
- try {
- parameters.put(fieldName, chooseKnownPojo(node.get(fieldName)));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- );
-
- return parameters;
- }
-
- private Object chooseKnownPojo(JsonNode parametersValue) throws IOException {
- if (parametersValue.get("$ref") != null) {
- return objectMapper.readValue(parametersValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(parametersValue.toString(), SecurityScheme.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageTraitsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ListOfReferencesOrObjectsDeserializer.java
similarity index 57%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageTraitsDeserializer.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ListOfReferencesOrObjectsDeserializer.java
index 6499bdc9..4a2baf05 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageTraitsDeserializer.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ListOfReferencesOrObjectsDeserializer.java
@@ -1,27 +1,21 @@
package com.asyncapi.v2.jackson;
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.channel.message.MessageTrait;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-/**
- * Serializes message traits list.
- *
- * @author Pavel Bodiachevskii
- */
-public class MessageTraitsDeserializer extends JsonDeserializer> {
+public abstract class ListOfReferencesOrObjectsDeserializer extends JsonDeserializer> {
- private final ObjectMapper objectMapper = new ObjectMapper();
+ abstract public Class objectTypeClass();
+
+ abstract public Class> referenceClass();
@Override
public List deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
@@ -33,7 +27,7 @@ public List deserialize(JsonParser p, DeserializationContext ctxt) throw
node.forEach(
traitsValue -> {
try {
- traits.add(chooseKnownPojo(traitsValue));
+ traits.add(chooseKnownPojo(traitsValue, objectCodec));
} catch (IOException e) {
e.printStackTrace();
}
@@ -43,11 +37,14 @@ public List deserialize(JsonParser p, DeserializationContext ctxt) throw
return traits;
}
- private Object chooseKnownPojo(JsonNode traitsValue) throws IOException {
- if (traitsValue.get("$ref") != null) {
- return objectMapper.readValue(traitsValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(traitsValue.toString(), MessageTrait.class);
+ private Object chooseKnownPojo(JsonNode jsonNode, ObjectCodec objectCodec) throws IOException {
+ JsonNode ref = jsonNode.get("$ref");
+ try (JsonParser jsonParser = jsonNode.traverse(objectCodec)) {
+ if (ref != null) {
+ return jsonParser.readValueAs(referenceClass());
+ } else {
+ return jsonParser.readValueAs(objectTypeClass());
+ }
}
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MapOfReferencesOrObjectsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MapOfReferencesOrObjectsDeserializer.java
new file mode 100644
index 00000000..2fb73bc1
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MapOfReferencesOrObjectsDeserializer.java
@@ -0,0 +1,80 @@
+package com.asyncapi.v2.jackson;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.ObjectCodec;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Deserializes AsyncAPI map of parameters
+ * @param object
+ */
+public abstract class MapOfReferencesOrObjectsDeserializer extends JsonDeserializer> {
+
+ abstract public Class objectTypeClass();
+
+ abstract public Class> referenceClass();
+
+ @Override
+ public Map deserialize(JsonParser jsonParser,
+ DeserializationContext deserializationContext
+ ) throws IOException, JsonProcessingException {
+ ObjectCodec objectCodec = jsonParser.getCodec();
+ JsonNode map = objectCodec.readTree(jsonParser);
+
+ Map parameters = new HashMap<>();
+
+ map.fieldNames().forEachRemaining(
+ fieldName -> {
+ /*
+ Problem:
+ Both, Reference class and Schema class have $ref field.
+ So, this is only reason why I receive next exception:
+ "com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
+ Unrecognized field "title" (class com.asyncapi.v2._6_0.model.Reference),
+ not marked as ignorable (one known property: "$ref"])"
+ in case when Schema contains $ref.
+ Solution:
+ Try to deserialize reference. In case of exception, try to deserialize it as given ObjectType. In case of
+ one more exception, throw it.
+ TODO: Think how to improve.
+ */
+ try {
+ parameters.put(fieldName, chooseKnownPojo(map.get(fieldName), objectCodec));
+ } catch (IOException ignore) {
+ try {
+ parameters.put(fieldName, readAsObject(map.get(fieldName), objectCodec));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ );
+
+ return parameters;
+ }
+
+ private Object chooseKnownPojo(JsonNode jsonNode, ObjectCodec objectCodec) throws IOException {
+ JsonNode ref = jsonNode.get("$ref");
+ try (JsonParser jsonParser = jsonNode.traverse(objectCodec)) {
+ if (ref != null) {
+ return jsonParser.readValueAs(referenceClass());
+ } else {
+ return jsonParser.readValueAs(objectTypeClass());
+ }
+ }
+ }
+
+ private Object readAsObject(JsonNode jsonNode, ObjectCodec objectCodec) throws IOException {
+ try (JsonParser jsonParser = jsonNode.traverse(objectCodec)) {
+ return jsonParser.readValueAs(objectTypeClass());
+ }
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageCorrelationIdDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageCorrelationIdDeserializer.java
deleted file mode 100644
index 3e7a223e..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageCorrelationIdDeserializer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.channel.message.CorrelationId;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-
-/**
- * Serializes message traits list.
- *
- * @author Pavel Bodiachevskii
- */
-public class MessageCorrelationIdDeserializer extends JsonDeserializer {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- return chooseKnownPojo(node);
- }
-
- private Object chooseKnownPojo(JsonNode traitsValue) throws IOException {
- if (traitsValue.get("$ref") != null) {
- return objectMapper.readValue(traitsValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(traitsValue.toString(), CorrelationId.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageHeadersDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageHeadersDeserializer.java
deleted file mode 100644
index 19dfcc52..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageHeadersDeserializer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.schema.Schema;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-
-/**
- * Serializes message traits list.
- *
- * @author Pavel Bodiachevskii
- */
-public class MessageHeadersDeserializer extends JsonDeserializer {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- return chooseKnownPojo(node);
- }
-
- private Object chooseKnownPojo(JsonNode traitsValue) throws IOException {
- if (traitsValue.get("$ref") != null) {
- return objectMapper.readValue(traitsValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(traitsValue.toString(), Schema.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageTraitCorrelationIdDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageTraitCorrelationIdDeserializer.java
deleted file mode 100644
index 27364d15..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageTraitCorrelationIdDeserializer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.channel.message.CorrelationId;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-
-/**
- * Serializes message traits list.
- *
- * @author Pavel Bodiachevskii
- */
-public class MessageTraitCorrelationIdDeserializer extends JsonDeserializer {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- return chooseKnownPojo(node);
- }
-
- private Object chooseKnownPojo(JsonNode traitsValue) throws IOException {
- if (traitsValue.get("$ref") != null) {
- return objectMapper.readValue(traitsValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(traitsValue.toString(), CorrelationId.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageTraitHeadersDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageTraitHeadersDeserializer.java
deleted file mode 100644
index 4e482eca..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessageTraitHeadersDeserializer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.schema.Schema;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-
-/**
- * Serializes message traits list.
- *
- * @author Pavel Bodiachevskii
- */
-public class MessageTraitHeadersDeserializer extends JsonDeserializer {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- return chooseKnownPojo(node);
- }
-
- private Object chooseKnownPojo(JsonNode traitsValue) throws IOException {
- if (traitsValue.get("$ref") != null) {
- return objectMapper.readValue(traitsValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(traitsValue.toString(), Schema.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessagePayloadDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ObjectDeserializer.java
similarity index 52%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessagePayloadDeserializer.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ObjectDeserializer.java
index ffb15ec2..553750ac 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/MessagePayloadDeserializer.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ObjectDeserializer.java
@@ -1,38 +1,29 @@
package com.asyncapi.v2.jackson;
-import com.asyncapi.v2.model.schema.Schema;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
-/**
- * Serializes message traits list.
- *
- * @author Pavel Bodiachevskii
- */
-public class MessagePayloadDeserializer extends JsonDeserializer {
+public abstract class ObjectDeserializer extends JsonDeserializer {
- private final ObjectMapper objectMapper = new ObjectMapper();
+ abstract public Class objectTypeClass();
@Override
public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
ObjectCodec objectCodec = p.getCodec();
JsonNode node = objectCodec.readTree(p);
- return chooseKnownPojo(node);
+ return chooseKnownPojo(node, objectCodec);
}
- private Object chooseKnownPojo(JsonNode traitsValue) {
- try {
- return objectMapper.readValue(traitsValue.toString(), Schema.class);
- } catch (Exception e) {
- return traitsValue;
+ private Object chooseKnownPojo(JsonNode jsonNode, ObjectCodec objectCodec) throws IOException {
+ try (JsonParser jsonParser = jsonNode.traverse(objectCodec)) {
+ return jsonParser.readValueAs(objectTypeClass());
}
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/OperationMessageDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/OperationMessageDeserializer.java
deleted file mode 100644
index bcaffbe2..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/OperationMessageDeserializer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.channel.message.Message;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-
-/**
- * Serializes operation traits list.
- *
- * @author Pavel Bodiachevskii
- */
-public class OperationMessageDeserializer extends JsonDeserializer {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- return chooseKnownPojo(node);
- }
-
- private Object chooseKnownPojo(JsonNode traitsValue) throws IOException {
- if (traitsValue.get("$ref") != null) {
- return objectMapper.readValue(traitsValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(traitsValue.toString(), Message.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/OperationTraitsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/OperationTraitsDeserializer.java
deleted file mode 100644
index dc646646..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/OperationTraitsDeserializer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.asyncapi.v2.jackson;
-
-import com.asyncapi.v2.model.Reference;
-import com.asyncapi.v2.model.channel.operation.OperationTrait;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.ObjectCodec;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Serializes operation traits list.
- *
- * @author Pavel Bodiachevskii
- */
-public class OperationTraitsDeserializer extends JsonDeserializer> {
-
- private final ObjectMapper objectMapper = new ObjectMapper();
-
- @Override
- public List deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
- ObjectCodec objectCodec = p.getCodec();
- JsonNode node = objectCodec.readTree(p);
-
- List traits = new ArrayList<>();
-
- node.forEach(
- traitsValue -> {
- try {
- traits.add(chooseKnownPojo(traitsValue));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- );
-
- return traits;
- }
-
- private Object chooseKnownPojo(JsonNode traitsValue) throws IOException {
- if (traitsValue.get("$ref") != null) {
- return objectMapper.readValue(traitsValue.toString(), Reference.class);
- } else {
- return objectMapper.readValue(traitsValue.toString(), OperationTrait.class);
- }
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ReferenceOrObjectDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ReferenceOrObjectDeserializer.java
new file mode 100644
index 00000000..a378ee70
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/ReferenceOrObjectDeserializer.java
@@ -0,0 +1,61 @@
+package com.asyncapi.v2.jackson;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.ObjectCodec;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException;
+
+import java.io.IOException;
+
+public abstract class ReferenceOrObjectDeserializer extends JsonDeserializer {
+
+ abstract public Class objectTypeClass();
+
+ abstract public Class> referenceClass();
+
+ @Override
+ public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
+ ObjectCodec objectCodec = p.getCodec();
+ JsonNode node = objectCodec.readTree(p);
+
+ /*
+ Problem:
+ Both, Reference class and Schema class have $ref field.
+ So, this is only reason why I receive next exception:
+ "com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
+ Unrecognized field "title" (class com.asyncapi.v2._6_0.model.Reference),
+ not marked as ignorable (one known property: "$ref"])"
+ in case when Schema contains $ref.
+ Solution:
+ Try to deserialize reference. In case of exception, try to deserialize it as given ObjectType. In case of
+ one more exception, throw it.
+ TODO: Think how to improve.
+ */
+ try {
+ return chooseKnownPojo(node, objectCodec);
+ } catch (UnrecognizedPropertyException unrecognizedPropertyException) {
+ return readAsObject(node, objectCodec);
+ }
+ }
+
+ private Object chooseKnownPojo(JsonNode jsonNode, ObjectCodec objectCodec) throws IOException {
+ JsonNode ref = jsonNode.get("$ref");
+ try (JsonParser jsonParser = jsonNode.traverse(objectCodec)) {
+ if (ref != null) {
+ return jsonParser.readValueAs(referenceClass());
+ } else {
+ return jsonParser.readValueAs(objectTypeClass());
+ }
+ }
+ }
+
+ private Object readAsObject(JsonNode jsonNode, ObjectCodec objectCodec) throws IOException {
+ try (JsonParser jsonParser = jsonNode.traverse(objectCodec)) {
+ return jsonParser.readValueAs(objectTypeClass());
+ }
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/channel/ChannelBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/channel/ChannelBindingsDeserializer.java
new file mode 100644
index 00000000..8ae56749
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/channel/ChannelBindingsDeserializer.java
@@ -0,0 +1,68 @@
+package com.asyncapi.v2.jackson.binding.channel;
+
+import com.asyncapi.v2._6_0.model.Reference;
+import com.asyncapi.v2.binding.channel.amqp.AMQPChannelBinding;
+import com.asyncapi.v2.binding.channel.amqp1.AMQP1ChannelBinding;
+import com.asyncapi.v2.binding.channel.anypointmq.AnypointMQChannelBinding;
+import com.asyncapi.v2.binding.channel.googlepubsub.GooglePubSubChannelBinding;
+import com.asyncapi.v2.binding.channel.http.HTTPChannelBinding;
+import com.asyncapi.v2.binding.channel.ibmmq.IBMMQChannelBinding;
+import com.asyncapi.v2.binding.channel.jms.JMSChannelBinding;
+import com.asyncapi.v2.binding.channel.kafka.KafkaChannelBinding;
+import com.asyncapi.v2.binding.channel.mercure.MercureChannelBinding;
+import com.asyncapi.v2.binding.channel.mqtt.MQTTChannelBinding;
+import com.asyncapi.v2.binding.channel.mqtt5.MQTT5ChannelBinding;
+import com.asyncapi.v2.binding.channel.nats.NATSChannelBinding;
+import com.asyncapi.v2.binding.channel.pulsar.PulsarChannelBinding;
+import com.asyncapi.v2.binding.channel.redis.RedisChannelBinding;
+import com.asyncapi.v2.binding.channel.sns.SNSChannelBinding;
+import com.asyncapi.v2.binding.channel.solace.SolaceChannelBinding;
+import com.asyncapi.v2.binding.channel.sqs.SQSChannelBinding;
+import com.asyncapi.v2.binding.channel.stomp.STOMPChannelBinding;
+import com.asyncapi.v2.binding.channel.ws.WebSocketsChannelBinding;
+import com.asyncapi.v2.jackson.BindingsMapDeserializer;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.ObjectCodec;
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.io.IOException;
+
+/**
+ * Serializes channel bindings map.
+ *
+ * @author Pavel Bodiachevskii
+ */
+public class ChannelBindingsDeserializer extends BindingsMapDeserializer {
+
+ public Object chooseKnownPojo(String bindingKey, JsonNode binding, ObjectCodec objectCodec) throws IOException {
+ try (JsonParser jsonParser = binding.traverse(objectCodec)) {
+ if (binding.get("$ref" ) != null) {
+ return jsonParser.readValueAs(Reference.class);
+ }
+
+ switch (bindingKey) {
+ case "amqp": return jsonParser.readValueAs(AMQPChannelBinding.class);
+ case "amqp1": return jsonParser.readValueAs(AMQP1ChannelBinding.class);
+ case "anypointmq": return jsonParser.readValueAs(AnypointMQChannelBinding.class);
+ case "googlepubsub": return jsonParser.readValueAs(GooglePubSubChannelBinding.class);
+ case "http": return jsonParser.readValueAs(HTTPChannelBinding.class);
+ case "ibmmq": return jsonParser.readValueAs(IBMMQChannelBinding.class);
+ case "jms": return jsonParser.readValueAs(JMSChannelBinding.class);
+ case "kafka": return jsonParser.readValueAs(KafkaChannelBinding.class);
+ case "mercure": return jsonParser.readValueAs(MercureChannelBinding.class);
+ case "mqtt": return jsonParser.readValueAs(MQTTChannelBinding.class);
+ case "mqtt5": return jsonParser.readValueAs(MQTT5ChannelBinding.class);
+ case "nats": return jsonParser.readValueAs(NATSChannelBinding.class);
+ case "pulsar": return jsonParser.readValueAs(PulsarChannelBinding.class);
+ case "redis": return jsonParser.readValueAs(RedisChannelBinding.class);
+ case "sns": return jsonParser.readValueAs(SNSChannelBinding.class);
+ case "solace": return jsonParser.readValueAs(SolaceChannelBinding.class);
+ case "sqs": return jsonParser.readValueAs(SQSChannelBinding.class);
+ case "stomp": return jsonParser.readValueAs(STOMPChannelBinding.class);
+ case "ws": return jsonParser.readValueAs(WebSocketsChannelBinding.class);
+ default: return null;
+ }
+ }
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/message/MessageBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/message/MessageBindingsDeserializer.java
new file mode 100644
index 00000000..1c26dc4b
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/message/MessageBindingsDeserializer.java
@@ -0,0 +1,68 @@
+package com.asyncapi.v2.jackson.binding.message;
+
+import com.asyncapi.v2._6_0.model.Reference;
+import com.asyncapi.v2.binding.message.amqp.AMQPMessageBinding;
+import com.asyncapi.v2.binding.message.amqp1.AMQP1MessageBinding;
+import com.asyncapi.v2.binding.message.anypointmq.AnypointMQMessageBinding;
+import com.asyncapi.v2.binding.message.googlepubsub.GooglePubSubMessageBinding;
+import com.asyncapi.v2.binding.message.http.HTTPMessageBinding;
+import com.asyncapi.v2.binding.message.ibmmq.IBMMQMessageBinding;
+import com.asyncapi.v2.binding.message.jms.JMSMessageBinding;
+import com.asyncapi.v2.binding.message.kafka.KafkaMessageBinding;
+import com.asyncapi.v2.binding.message.mercure.MercureMessageBinding;
+import com.asyncapi.v2.binding.message.mqtt.MQTTMessageBinding;
+import com.asyncapi.v2.binding.message.mqtt5.MQTT5MessageBinding;
+import com.asyncapi.v2.binding.message.nats.NATSMessageBinding;
+import com.asyncapi.v2.binding.message.pulsar.PulsarMessageBinding;
+import com.asyncapi.v2.binding.message.redis.RedisMessageBinding;
+import com.asyncapi.v2.binding.message.sns.SNSMessageBinding;
+import com.asyncapi.v2.binding.message.solace.SolaceMessageBinding;
+import com.asyncapi.v2.binding.message.sqs.SQSMessageBinding;
+import com.asyncapi.v2.binding.message.stomp.STOMPMessageBinding;
+import com.asyncapi.v2.binding.message.ws.WebSocketsMessageBinding;
+import com.asyncapi.v2.jackson.BindingsMapDeserializer;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.ObjectCodec;
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.io.IOException;
+
+/**
+ * Serializes message bindings map.
+ *
+ * @author Pavel Bodiachevskii
+ */
+public class MessageBindingsDeserializer extends BindingsMapDeserializer {
+
+ public Object chooseKnownPojo(String bindingKey, JsonNode binding, ObjectCodec objectCodec) throws IOException {
+ try (JsonParser jsonParser = binding.traverse(objectCodec)) {
+ if (binding.get("$ref" ) != null) {
+ return jsonParser.readValueAs(Reference.class);
+ }
+
+ switch (bindingKey) {
+ case "amqp": return jsonParser.readValueAs(AMQPMessageBinding.class);
+ case "amqp1": return jsonParser.readValueAs(AMQP1MessageBinding.class);
+ case "anypointmq": return jsonParser.readValueAs(AnypointMQMessageBinding.class);
+ case "googlepubsub": return jsonParser.readValueAs(GooglePubSubMessageBinding.class);
+ case "http": return jsonParser.readValueAs(HTTPMessageBinding.class);
+ case "ibmmq": return jsonParser.readValueAs(IBMMQMessageBinding.class);
+ case "jms": return jsonParser.readValueAs(JMSMessageBinding.class);
+ case "kafka": return jsonParser.readValueAs(KafkaMessageBinding.class);
+ case "mercure": return jsonParser.readValueAs(MercureMessageBinding.class);
+ case "mqtt": return jsonParser.readValueAs(MQTTMessageBinding.class);
+ case "mqtt5": return jsonParser.readValueAs(MQTT5MessageBinding.class);
+ case "nats": return jsonParser.readValueAs(NATSMessageBinding.class);
+ case "pulsar": return jsonParser.readValueAs(PulsarMessageBinding.class);
+ case "redis": return jsonParser.readValueAs(RedisMessageBinding.class);
+ case "sns": return jsonParser.readValueAs(SNSMessageBinding.class);
+ case "solace": return jsonParser.readValueAs(SolaceMessageBinding.class);
+ case "sqs": return jsonParser.readValueAs(SQSMessageBinding.class);
+ case "stomp": return jsonParser.readValueAs(STOMPMessageBinding.class);
+ case "ws": return jsonParser.readValueAs(WebSocketsMessageBinding.class);
+ default: return null;
+ }
+ }
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/operation/OperationBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/operation/OperationBindingsDeserializer.java
new file mode 100644
index 00000000..aa059747
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/operation/OperationBindingsDeserializer.java
@@ -0,0 +1,69 @@
+package com.asyncapi.v2.jackson.binding.operation;
+
+import com.asyncapi.v2._6_0.model.Reference;
+import com.asyncapi.v2.binding.operation.amqp.AMQPOperationBinding;
+import com.asyncapi.v2.binding.operation.amqp1.AMQP1OperationBinding;
+import com.asyncapi.v2.binding.operation.anypointmq.AnypointMQOperationBinding;
+import com.asyncapi.v2.binding.operation.googlepubsub.GooglePubSubOperationBinding;
+import com.asyncapi.v2.binding.operation.http.HTTPOperationBinding;
+import com.asyncapi.v2.binding.operation.ibmmq.IBMMQOperationBinding;
+import com.asyncapi.v2.binding.operation.jms.JMSOperationBinding;
+import com.asyncapi.v2.binding.operation.kafka.KafkaOperationBinding;
+import com.asyncapi.v2.binding.operation.mercure.MercureOperationBinding;
+import com.asyncapi.v2.binding.operation.mqtt.MQTTOperationBinding;
+import com.asyncapi.v2.binding.operation.mqtt5.MQTT5OperationBinding;
+import com.asyncapi.v2.binding.operation.nats.NATSOperationBinding;
+import com.asyncapi.v2.binding.operation.pulsar.PulsarOperationBinding;
+import com.asyncapi.v2.binding.operation.redis.RedisOperationBinding;
+import com.asyncapi.v2.binding.operation.sns.SNSOperationBinding;
+import com.asyncapi.v2.binding.operation.solace.SolaceOperationBinding;
+import com.asyncapi.v2.binding.operation.sqs.SQSOperationBinding;
+import com.asyncapi.v2.binding.operation.stomp.STOMPOperationBinding;
+import com.asyncapi.v2.binding.operation.ws.WebSocketsOperationBinding;
+import com.asyncapi.v2.jackson.BindingsMapDeserializer;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.ObjectCodec;
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.io.IOException;
+
+/**
+ * Serializes operation bindings map.
+ *
+ * @version 2.6.0
+ * @author Pavel Bodiachevskii
+ */
+public class OperationBindingsDeserializer extends BindingsMapDeserializer {
+
+ public Object chooseKnownPojo(String bindingKey, JsonNode binding, ObjectCodec objectCodec) throws IOException {
+ try (JsonParser jsonParser = binding.traverse(objectCodec)) {
+ if (binding.get("$ref" ) != null) {
+ return jsonParser.readValueAs(Reference.class);
+ }
+
+ switch (bindingKey) {
+ case "amqp": return jsonParser.readValueAs(AMQPOperationBinding.class);
+ case "amqp1": return jsonParser.readValueAs(AMQP1OperationBinding.class);
+ case "anypointmq": return jsonParser.readValueAs(AnypointMQOperationBinding.class);
+ case "googlepubsub": return jsonParser.readValueAs(GooglePubSubOperationBinding.class);
+ case "http": return jsonParser.readValueAs(HTTPOperationBinding.class);
+ case "ibmmq": return jsonParser.readValueAs(IBMMQOperationBinding.class);
+ case "jms": return jsonParser.readValueAs(JMSOperationBinding.class);
+ case "kafka": return jsonParser.readValueAs(KafkaOperationBinding.class);
+ case "mercure": return jsonParser.readValueAs(MercureOperationBinding.class);
+ case "mqtt": return jsonParser.readValueAs(MQTTOperationBinding.class);
+ case "mqtt5": return jsonParser.readValueAs(MQTT5OperationBinding.class);
+ case "nats": return jsonParser.readValueAs(NATSOperationBinding.class);
+ case "pulsar": return jsonParser.readValueAs(PulsarOperationBinding.class);
+ case "redis": return jsonParser.readValueAs(RedisOperationBinding.class);
+ case "sns": return jsonParser.readValueAs(SNSOperationBinding.class);
+ case "solace": return jsonParser.readValueAs(SolaceOperationBinding.class);
+ case "sqs": return jsonParser.readValueAs(SQSOperationBinding.class);
+ case "stomp": return jsonParser.readValueAs(STOMPOperationBinding.class);
+ case "ws": return jsonParser.readValueAs(WebSocketsOperationBinding.class);
+ default: return null;
+ }
+ }
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/server/ServerBindingsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/server/ServerBindingsDeserializer.java
new file mode 100644
index 00000000..7f0b4727
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/jackson/binding/server/ServerBindingsDeserializer.java
@@ -0,0 +1,70 @@
+package com.asyncapi.v2.jackson.binding.server;
+
+import com.asyncapi.v2._6_0.model.Reference;
+import com.asyncapi.v2.binding.server.amqp.AMQPServerBinding;
+import com.asyncapi.v2.binding.server.amqp1.AMQP1ServerBinding;
+import com.asyncapi.v2.binding.server.anypointmq.AnypointMQServerBinding;
+import com.asyncapi.v2.binding.server.googlepubsub.GooglePubSubServerBinding;
+import com.asyncapi.v2.binding.server.http.HTTPServerBinding;
+import com.asyncapi.v2.binding.server.ibmmq.IBMMQServerBinding;
+import com.asyncapi.v2.binding.server.jms.JMSServerBinding;
+import com.asyncapi.v2.binding.server.kafka.KafkaServerBinding;
+import com.asyncapi.v2.binding.server.mercure.MercureServerBinding;
+import com.asyncapi.v2.binding.server.mqtt.MQTTServerBinding;
+import com.asyncapi.v2.binding.server.mqtt5.MQTT5ServerBinding;
+import com.asyncapi.v2.binding.server.nats.NATSServerBinding;
+import com.asyncapi.v2.binding.server.pulsar.PulsarServerBinding;
+import com.asyncapi.v2.binding.server.redis.RedisServerBinding;
+import com.asyncapi.v2.binding.server.sns.SNSServerBinding;
+import com.asyncapi.v2.binding.server.solace.SolaceServerBinding;
+import com.asyncapi.v2.binding.server.sqs.SQSServerBinding;
+import com.asyncapi.v2.binding.server.stomp.STOMPServerBinding;
+import com.asyncapi.v2.binding.server.ws.WebSocketsServerBinding;
+import com.asyncapi.v2.jackson.BindingsMapDeserializer;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.ObjectCodec;
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.io.IOException;
+
+/**
+ * Serializes server bindings map.
+ *
+ * @version 2.6.0
+ * @author Pavel Bodiachevskii
+ */
+public class ServerBindingsDeserializer extends BindingsMapDeserializer {
+
+ @Override
+ public Object chooseKnownPojo(String bindingKey, JsonNode binding, ObjectCodec objectCodec) throws IOException {
+ try (JsonParser jsonParser = binding.traverse(objectCodec)) {
+ if (binding.get("$ref" ) != null) {
+ return jsonParser.readValueAs(Reference.class);
+ }
+
+ switch (bindingKey) {
+ case "amqp": return jsonParser.readValueAs(AMQPServerBinding.class);
+ case "amqp1": return jsonParser.readValueAs(AMQP1ServerBinding.class);
+ case "anypointmq": return jsonParser.readValueAs(AnypointMQServerBinding.class);
+ case "googlepubsub": return jsonParser.readValueAs(GooglePubSubServerBinding.class);
+ case "http": return jsonParser.readValueAs(HTTPServerBinding.class);
+ case "ibmmq": return jsonParser.readValueAs(IBMMQServerBinding.class);
+ case "jms": return jsonParser.readValueAs(JMSServerBinding.class);
+ case "kafka": return jsonParser.readValueAs(KafkaServerBinding.class);
+ case "mercure": return jsonParser.readValueAs(MercureServerBinding.class);
+ case "mqtt": return jsonParser.readValueAs(MQTTServerBinding.class);
+ case "mqtt5": return jsonParser.readValueAs(MQTT5ServerBinding.class);
+ case "nats": return jsonParser.readValueAs(NATSServerBinding.class);
+ case "pulsar": return jsonParser.readValueAs(PulsarServerBinding.class);
+ case "redis": return jsonParser.readValueAs(RedisServerBinding.class);
+ case "sns": return jsonParser.readValueAs(SNSServerBinding.class);
+ case "solace": return jsonParser.readValueAs(SolaceServerBinding.class);
+ case "sqs": return jsonParser.readValueAs(SQSServerBinding.class);
+ case "stomp": return jsonParser.readValueAs(STOMPServerBinding.class);
+ case "ws": return jsonParser.readValueAs(WebSocketsServerBinding.class);
+ default: return null;
+ }
+ }
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/OAuth2SecurityScheme.java b/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/OAuth2SecurityScheme.java
deleted file mode 100644
index 9bc26393..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/OAuth2SecurityScheme.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.asyncapi.v2.model.security_scheme.oauth2;
-
-import com.asyncapi.v2.model.security_scheme.SecurityScheme;
-import lombok.*;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-/**
- * * @version 2.0.0
- * * @see SecurityScheme
- * @author Pavel Bodiachevskii
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = false)
-public class OAuth2SecurityScheme extends SecurityScheme {
-
- /**
- * REQUIRED.
- *
- * An object containing configuration information for the flow types supported.
- */
- @Nonnull
- @NonNull
- private OAuthFlows flows;
-
- @Builder(builderMethodName = "oauth2SecuritySchemeBuilder")
- public OAuth2SecurityScheme(@Nonnull @NonNull Type type,
- @Nullable String description,
- @Nonnull @NonNull OAuthFlows flows) {
- super(type, description);
- this.flows = flows;
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/OAuthFlows.java b/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/OAuthFlows.java
deleted file mode 100644
index aa439043..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/OAuthFlows.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.asyncapi.v2.model.security_scheme.oauth2;
-
-import com.asyncapi.v2.model.security_scheme.oauth2.flow.AuthorizationCodeOAuthFlow;
-import com.asyncapi.v2.model.security_scheme.oauth2.flow.ClientCredentialsOAuthFlow;
-import com.asyncapi.v2.model.security_scheme.oauth2.flow.ImplicitOAuthFlow;
-import com.asyncapi.v2.model.security_scheme.oauth2.flow.PasswordOAuthFlow;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import javax.annotation.CheckForNull;
-
-/**
- * Allows configuration of the supported OAuth Flows.
- *
- * This object MAY be extended with Specification Extensions .
- *
- * @version 2.0.0
- * @see OAuth Flows Object
- * @author Pavel Bodiachevskii
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class OAuthFlows {
-
- /**
- * Configuration for the OAuth Implicit flow
- */
- @CheckForNull
- private ImplicitOAuthFlow implicit;
-
- /**
- * Configuration for the OAuth Resource Owner Protected Credentials flow
- */
- @CheckForNull
- private PasswordOAuthFlow password;
-
- /**
- * Configuration for the OAuth Client Credentials flow.
- */
- @CheckForNull
- private ClientCredentialsOAuthFlow clientCredentials;
-
- /**
- * Configuration for the OAuth Authorization Code flow
- */
- @CheckForNull
- private AuthorizationCodeOAuthFlow authorizationCode;
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/AuthorizationCodeOAuthFlow.java b/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/AuthorizationCodeOAuthFlow.java
deleted file mode 100644
index 3330dec4..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/AuthorizationCodeOAuthFlow.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.asyncapi.v2.model.security_scheme.oauth2.flow;
-
-import lombok.*;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import java.util.Map;
-
-/**
- * @version 2.0.0
- * @see OAuth Flow Object
- * @author Pavel Bodiachevskii
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class AuthorizationCodeOAuthFlow extends OAuthFlow {
-
- /**
- * REQUIRED.
- *
- * The authorization URL to be used for this flow. This MUST be in the form of a URL
- */
- @Nonnull
- @NonNull
- private String authorizationUrl;
-
- /**
- * REQUIRED.
- *
- * The token URL to be used for this flow. This MUST be in the form of a URL.
- */
- @Nonnull
- @NonNull
- private String tokenUrl;
-
- @Builder(builderMethodName = "authorizationCodeOAuthFlowBuilder")
- public AuthorizationCodeOAuthFlow(@Nullable String refreshUrl,
- @Nonnull @NonNull Map scopes,
- @Nonnull @NonNull String authorizationUrl,
- @Nonnull @NonNull String tokenUrl) {
- super(refreshUrl, scopes);
- this.authorizationUrl = authorizationUrl;
- this.tokenUrl = tokenUrl;
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/ClientCredentialsOAuthFlow.java b/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/ClientCredentialsOAuthFlow.java
deleted file mode 100644
index 58869c74..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/ClientCredentialsOAuthFlow.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.asyncapi.v2.model.security_scheme.oauth2.flow;
-
-import lombok.*;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import java.util.Map;
-
-/**
- * @version 2.0.0
- * @see OAuth Flow Object
- * @author Pavel Bodiachevskii
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class ClientCredentialsOAuthFlow extends OAuthFlow {
-
- /**
- * REQUIRED.
- *
- * The token URL to be used for this flow. This MUST be in the form of a URL.
- */
- @Nonnull
- @NonNull
- private String tokenUrl;
-
- @Builder(builderMethodName = "clientCredentialsOAuthFlowBuilder")
- public ClientCredentialsOAuthFlow(@Nullable String refreshUrl,
- @Nonnull @NonNull Map scopes,
- @Nonnull @NonNull String tokenUrl) {
- super(refreshUrl, scopes);
- this.tokenUrl = tokenUrl;
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/OAuthFlow.java b/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/OAuthFlow.java
deleted file mode 100644
index 04fd470f..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/OAuthFlow.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.asyncapi.v2.model.security_scheme.oauth2.flow;
-
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import java.util.Map;
-
-/**
- * Configuration details for a supported OAuth Flow
- *
- * This object MAY be extended with Specification Extensions .
- *
- * @version 2.0.0
- * @see OAuth Flow Object
- * @author Pavel Bodiachevskii
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class OAuthFlow {
-
- /**
- * The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
- */
- @CheckForNull
- private String refreshUrl;
-
- /**
- * REQUIRED.
- *
- * The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.
- */
- @Nonnull
- @NonNull
- private Map scopes;
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/PasswordOAuthFlow.java b/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/PasswordOAuthFlow.java
deleted file mode 100644
index 5462af73..00000000
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/PasswordOAuthFlow.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.asyncapi.v2.model.security_scheme.oauth2.flow;
-
-import lombok.*;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import java.util.Map;
-
-/**
- * @version 2.0.0
- * @see OAuth Flow Object
- * @author Pavel Bodiachevskii
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class PasswordOAuthFlow extends OAuthFlow {
-
- /**
- * REQUIRED.
- *
- * The token URL to be used for this flow. This MUST be in the form of a URL.
- */
- @Nonnull
- @NonNull
- private String tokenUrl;
-
- @Builder(builderMethodName = "passwordOAuthFlowBuilder")
- public PasswordOAuthFlow(@Nullable String refreshUrl,
- @Nonnull @NonNull Map scopes,
- @Nonnull @NonNull String tokenUrl) {
- super(refreshUrl, scopes);
- this.tokenUrl = tokenUrl;
- }
-
-}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/schema/Schema.java b/asyncapi-core/src/main/java/com/asyncapi/v2/schema/Schema.java
similarity index 93%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/model/schema/Schema.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/schema/Schema.java
index 218f9d53..aa99503c 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/schema/Schema.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/schema/Schema.java
@@ -1,13 +1,18 @@
-package com.asyncapi.v2.model.schema;
+package com.asyncapi.v2.schema;
-import com.asyncapi.v2.model.ExternalDocumentation;
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2._0_0.jackson.model.schema.SchemasAdditionalPropertiesDeserializer;
+import com.asyncapi.v2._0_0.model.ExternalDocumentation;
import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
+import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
-import javax.annotation.CheckForNull;
+import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@@ -34,7 +39,8 @@
@Builder
@NoArgsConstructor
@AllArgsConstructor
-public class Schema {
+@EqualsAndHashCode(callSuper = true)
+public class Schema extends ExtendableObject {
/*
Schema Annotations
@@ -59,7 +65,8 @@ information for documentation and user interface display purposes.
*
* A title will preferably be short
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public String title;
/**
@@ -73,7 +80,8 @@ information for documentation and user interface display purposes.
*
* A description will provide explanation about the purpose of the instance described by this schema.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public String description;
/**
@@ -88,7 +96,7 @@ information for documentation and user interface display purposes.
* is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at
* the same level. For example, of type is string
, then default can be "foo"
but cannot be 1
.
*/
- @CheckForNull
+ @Nullable
@JsonProperty("default")
public Object defaultValue;
@@ -110,7 +118,8 @@ information for documentation and user interface display purposes.
*
* Omitting this keyword has the same behavior as values of false.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Boolean readOnly;
/**
@@ -129,7 +138,8 @@ information for documentation and user interface display purposes.
*
* Omitting this keyword has the same behavior as values of false.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Boolean writeOnly;
/**
@@ -143,10 +153,11 @@ information for documentation and user interface display purposes.
* Implementations MAY use the value(s) of "default", if present, as an additional example. If "examples" is absent,
* "default" MAY still be used in this manner.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public List examples;
- @CheckForNull
+ @Nullable
@JsonProperty("$ref")
private String ref;
@@ -184,7 +195,8 @@ as assertions (Section 3.2). While no special effort is required to
*
* The value of this property SHOULD be ignored if the instance described is not a string.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
private String contentEncoding;
/**
@@ -199,7 +211,8 @@ as assertions (Section 3.2). While no special effort is required to
* text document type, and the character set SHOULD be the character set into which the JSON string value was decoded (for which the default
* is Unicode).
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
private String contentMediaType;
/*
@@ -220,7 +233,8 @@ as assertions (Section 3.2). While no special effort is required to
* An instance validates if and only if the instance is in any of the sets listed for this keyword.
*
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Object type;
/**
@@ -230,7 +244,7 @@ as assertions (Section 3.2). While no special effort is required to
*
* Elements in the array might be of any value, including null.
*/
- @CheckForNull
+ @Nullable
@JsonProperty("enum")
public List enumValue;
@@ -239,7 +253,7 @@ as assertions (Section 3.2). While no special effort is required to
*
* An instance validates successfully against this keyword if its value is equal to the value of the keyword.
*/
- @CheckForNull
+ @Nullable
@JsonProperty("const")
public Object constValue;
@@ -252,7 +266,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* A numeric instance is valid only if division by this keyword's value results in an integer.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Integer multipleOf;
/**
@@ -260,32 +275,36 @@ Validation Keywords for Numeric Instances (number and integer)
*
* If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to "maximum".
*/
- @CheckForNull
- public Integer maximum;
+ @Nullable
+ @JsonProperty
+ public BigDecimal maximum;
/**
* The value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance.
*
* If the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) "exclusiveMaximum".
*/
- @CheckForNull
- public Integer exclusiveMaximum;
+ @Nullable
+ @JsonProperty
+ public BigDecimal exclusiveMaximum;
/**
* The value of "minimum" MUST be a number, representing an inclusive lower limit for a numeric instance.
*
* If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to "minimum".
*/
- @CheckForNull
- public Integer minimum;
+ @Nullable
+ @JsonProperty
+ public BigDecimal minimum;
/**
* The value of "exclusiveMinimum" MUST be number, representing an exclusive lower limit for a numeric instance.
*
* If the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) "exclusiveMinimum".
*/
- @CheckForNull
- public Integer exclusiveMinimum;
+ @Nullable
+ @JsonProperty
+ public BigDecimal exclusiveMinimum;
/*
Validation Keywords for Strings
@@ -298,7 +317,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* The length of a string instance is defined as the number of its characters as defined by RFC 7159 [RFC7159 ].
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Integer maxLength;
/**
@@ -310,7 +330,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as a value of 0.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Integer minLength;
/**
@@ -320,7 +341,8 @@ Validation Keywords for Numeric Instances (number and integer)
* A string instance is considered valid if the regular expression matches the instance successfully.
* Recall: regular expressions are not implicitly anchored.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public String pattern;
/*
@@ -339,7 +361,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as an empty schema.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Object items;
/**
@@ -355,7 +378,7 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as an empty schema.
*/
- @CheckForNull
+ @Nullable
public Schema additionalItems;
/**
@@ -363,7 +386,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Integer maxItems;
/**
@@ -373,7 +397,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as a value of 0.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Integer minItems;
/**
@@ -384,7 +409,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as a value of false.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Boolean uniqueItems;
/**
@@ -392,7 +418,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* An array instance is valid against "contains" if at least one of its elements is valid against the given schema.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Schema contains;
/*
@@ -405,7 +432,8 @@ Validation Keywords for Numeric Instances (number and integer)
* An object instance is valid against "maxProperties" if its number of properties is less than, or equal to,
* the value of this keyword.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Integer maxProperties;
/**
@@ -416,7 +444,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as a value of 0.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Integer minProperties;
/**
@@ -426,7 +455,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as an empty array.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public List required;
/**
@@ -440,7 +470,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as an empty object.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Map properties;
/**
@@ -457,7 +488,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as an empty object.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Map patternProperties;
/**
@@ -473,8 +505,10 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as an empty schema.
*/
- @CheckForNull
- public Schema additionalProperties;
+ @Nullable
+ @JsonProperty
+ @JsonDeserialize(using = SchemasAdditionalPropertiesDeserializer.class)
+ public Object additionalProperties;
/**
* [[CREF1: This keyword may be split into two, with the variation that uses an array of property names rather than a
@@ -496,7 +530,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as an empty object.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Object dependencies;
/**
@@ -507,7 +542,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* Omitting this keyword has the same behavior as an empty schema.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Schema propertyNames;
/*
@@ -542,7 +578,7 @@ Validation Keywords for Numeric Instances (number and integer)
* including when the keyword is present without either "then" or "else".
*/
@JsonProperty("if")
- @CheckForNull
+ @Nullable
public Schema ifValue;
/**
@@ -556,7 +592,7 @@ Validation Keywords for Numeric Instances (number and integer)
* purposes, in such cases.
*/
@JsonProperty("then")
- @CheckForNull
+ @Nullable
public Schema thenValue;
/**
@@ -570,7 +606,7 @@ Validation Keywords for Numeric Instances (number and integer)
* purposes, in such cases.
*/
@JsonProperty("else")
- @CheckForNull
+ @Nullable
public Schema elseValue;
/*
@@ -583,7 +619,8 @@ Validation Keywords for Numeric Instances (number and integer)
* An instance validates successfully against this keyword if it validates successfully against all schemas defined
* by this keyword's value.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public List allOf;
/**
@@ -592,7 +629,8 @@ Validation Keywords for Numeric Instances (number and integer)
* An instance validates successfully against this keyword if it validates successfully against at least one schema
* defined by this keyword's value.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public List anyOf;
/**
@@ -601,7 +639,8 @@ Validation Keywords for Numeric Instances (number and integer)
* An instance validates successfully against this keyword if it validates successfully against exactly one schema
* defined by this keyword's value.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public List oneOf;
/**
@@ -609,7 +648,8 @@ Validation Keywords for Numeric Instances (number and integer)
*
* An instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Schema not;
// Fields defined in AsyncAPI below
@@ -621,7 +661,8 @@ Validation Keywords for Numeric Instances (number and integer)
* See Data Type Formats for further details.
* While relying on JSON Schema's defined formats, the AsyncAPI Specification offers a few additional predefined formats.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Object format;
/*
@@ -634,18 +675,21 @@ Validation Keywords for Numeric Instances (number and integer)
* The property name used MUST be defined at this schema and it MUST be in the required
property list.
* When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details .
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public String discriminator;
/**
* Additional external documentation for this schema.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public ExternalDocumentation externalDocs;
/**
* Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false
.
*/
- @CheckForNull
+ @Nullable
+ @JsonProperty
public Boolean deprecated;
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/schema/Type.java b/asyncapi-core/src/main/java/com/asyncapi/v2/schema/Type.java
similarity index 91%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/model/schema/Type.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/schema/Type.java
index df648e4f..1a0572aa 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/schema/Type.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/schema/Type.java
@@ -1,4 +1,4 @@
-package com.asyncapi.v2.model.schema;
+package com.asyncapi.v2.schema;
/**
* @author Pavel Bodiachevskii
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/ApiKeySecurityScheme.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/ApiKeySecurityScheme.java
similarity index 55%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/ApiKeySecurityScheme.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/ApiKeySecurityScheme.java
index 7e91ffbb..2364f78e 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/ApiKeySecurityScheme.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/ApiKeySecurityScheme.java
@@ -1,14 +1,17 @@
-package com.asyncapi.v2.model.security_scheme;
+package com.asyncapi.v2.security_scheme;
import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.*;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
- * @version 2.0.0
- * @see SecurityScheme
+ * @version 2.6.0
+ * @see SecurityScheme
* @author Pavel Bodiachevskii
*/
@Data
@@ -19,17 +22,16 @@ public class ApiKeySecurityScheme extends SecurityScheme {
/**
* REQUIRED.
- *
+ *
* The location of the API key.
*/
- @NonNull
- @Nonnull
+ @NotNull
private ApiKeyLocation in;
@Builder(builderMethodName = "apiKeySecuritySchemeBuilder")
- public ApiKeySecurityScheme(@Nonnull @NonNull Type type,
+ public ApiKeySecurityScheme(@NotNull Type type,
@Nullable String description,
- @NonNull @Nonnull ApiKeyLocation in) {
+ @NotNull ApiKeyLocation in) {
super(type, description);
this.in = in;
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/OpenIdConnectSecurityScheme.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/OpenIdConnectSecurityScheme.java
similarity index 51%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/OpenIdConnectSecurityScheme.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/OpenIdConnectSecurityScheme.java
index 75aa0f65..2d389ba0 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/OpenIdConnectSecurityScheme.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/OpenIdConnectSecurityScheme.java
@@ -1,13 +1,16 @@
-package com.asyncapi.v2.model.security_scheme;
+package com.asyncapi.v2.security_scheme;
-import lombok.*;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
- * @version 2.0.0
- * @see SecurityScheme
+ * @version 2.6.0
+ * @see SecurityScheme
* @author Pavel Bodiachevskii
*/
@Data
@@ -18,17 +21,16 @@ public class OpenIdConnectSecurityScheme extends SecurityScheme {
/**
* REQUIRED.
- *
+ *
* OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.
*/
- @NonNull
- @Nonnull
+ @NotNull
private String openIdConnectUrl;
@Builder(builderMethodName = "openIdConnectSecurityScheme")
- public OpenIdConnectSecurityScheme(@Nonnull @NonNull Type type,
+ public OpenIdConnectSecurityScheme(@NotNull Type type,
@Nullable String description,
- @NonNull @Nonnull String openIdConnectUrl) {
+ @NotNull String openIdConnectUrl) {
super(type, description);
this.openIdConnectUrl = openIdConnectUrl;
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/SecurityScheme.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/SecurityScheme.java
similarity index 64%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/SecurityScheme.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/SecurityScheme.java
index 2ffedc67..d316ffad 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/SecurityScheme.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/SecurityScheme.java
@@ -1,19 +1,22 @@
-package com.asyncapi.v2.model.security_scheme;
+package com.asyncapi.v2.security_scheme;
-import com.asyncapi.v2.model.security_scheme.http.HttpApiKeySecurityScheme;
-import com.asyncapi.v2.model.security_scheme.http.HttpSecurityScheme;
-import com.asyncapi.v2.model.security_scheme.oauth2.OAuth2SecurityScheme;
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2.security_scheme.http.HttpApiKeySecurityScheme;
+import com.asyncapi.v2.security_scheme.http.HttpSecurityScheme;
+import com.asyncapi.v2.security_scheme.oauth2.OAuth2SecurityScheme;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Defines a security scheme that can be used by the operations. Supported schemes are:
- *
*
* User/Password.
* API key (either as user or as password).
@@ -23,12 +26,13 @@
* HTTP API key.
* OAuth2’s common flows (Implicit, Resource Owner Protected Credentials, Client Credentials and Authorization Code) as defined in RFC6749 .
* OpenID Connect Discovery.
+ * SASL (Simple Authentication and Security Layer) as defined in RFC4422 .
*
*
- * This object MAY be extended with Specification Extensions .
+ * This object MAY be extended with Specification Extensions .
*
- * @version 2.0.0
- * @see Security Scheme Object
+ * @version 2.6.0
+ * @see Security Scheme Object
* @author Pavel Bodiachevskii
*/
@Data
@@ -37,7 +41,7 @@
@AllArgsConstructor
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
- include = JsonTypeInfo.As.PROPERTY,
+ include = JsonTypeInfo.As.EXISTING_PROPERTY,
property = "type",
visible = true
)
@@ -50,13 +54,18 @@
@JsonSubTypes.Type(value = HttpApiKeySecurityScheme.class, name = "httpApiKey"),
@JsonSubTypes.Type(value = HttpSecurityScheme.class, name = "http"),
@JsonSubTypes.Type(value = OAuth2SecurityScheme.class, name = "oauth2"),
- @JsonSubTypes.Type(value = OpenIdConnectSecurityScheme.class, name = "openIdConnect")
+ @JsonSubTypes.Type(value = OpenIdConnectSecurityScheme.class, name = "openIdConnect"),
+ @JsonSubTypes.Type(value = SecurityScheme.class, name = "plain"),
+ @JsonSubTypes.Type(value = SecurityScheme.class, name = "scramSha256"),
+ @JsonSubTypes.Type(value = SecurityScheme.class, name = "scramSha512"),
+ @JsonSubTypes.Type(value = SecurityScheme.class, name = "gssapi"),
})
-public class SecurityScheme {
+@EqualsAndHashCode(callSuper = true)
+public class SecurityScheme extends ExtendableObject {
/**
* REQUIRED.
- *
+ *
* The type of the security scheme. Valid values are:
*
* userPassword
@@ -70,14 +79,13 @@ public class SecurityScheme {
* openIdConnect
*
*/
- @Nonnull
- @NonNull
+ @NotNull
private Type type;
/**
* A short description for security scheme. CommonMark syntax MAY be used for rich text representation.
*/
- @CheckForNull
+ @Nullable
private String description;
public enum Type {
@@ -99,7 +107,15 @@ public enum Type {
@JsonProperty("oauth2")
OAUTH2,
@JsonProperty("openIdConnect")
- OPENID_CONNECT
+ OPENID_CONNECT,
+ @JsonProperty("plain")
+ PLAIN,
+ @JsonProperty("scramSha256")
+ SCRAM_SHA256,
+ @JsonProperty("scramSha512")
+ SCRAM_SHA512,
+ @JsonProperty("gssapi")
+ GSSAPI
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/http/HttpApiKeySecurityScheme.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/http/HttpApiKeySecurityScheme.java
similarity index 60%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/http/HttpApiKeySecurityScheme.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/http/HttpApiKeySecurityScheme.java
index 682ba762..418098d7 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/http/HttpApiKeySecurityScheme.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/http/HttpApiKeySecurityScheme.java
@@ -1,16 +1,18 @@
-package com.asyncapi.v2.model.security_scheme.http;
+package com.asyncapi.v2.security_scheme.http;
-import com.asyncapi.v2.model.security_scheme.SecurityScheme;
+import com.asyncapi.v2.security_scheme.SecurityScheme;
import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
- * * @version 2.0.0
- * * SecurityScheme
+ * @version 2.6.0
+ * @see SecurityScheme
* @author Pavel Bodiachevskii
*/
@Data
@@ -21,25 +23,24 @@ public class HttpApiKeySecurityScheme extends SecurityScheme {
/**
* REQUIRED.
- *
+ *
* The name of the header, query or cookie parameter to be used.
*/
- @Nonnull
- @NonNull
+ @NotNull
private String name;
/**
* REQUIRED.
- *
+ *
* The location of the API key.
*/
- @CheckForNull
+ @Nullable
private ApiKeyLocation in;
@Builder(builderMethodName = "httpApiKeySecuritySchemeBuilder")
- public HttpApiKeySecurityScheme(@Nonnull @NonNull Type type,
+ public HttpApiKeySecurityScheme(@NotNull Type type,
@Nullable String description,
- @NonNull @Nonnull String name,
+ @NotNull String name,
@Nullable ApiKeyLocation in) {
super(type, description);
this.name = name;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/http/HttpSecurityScheme.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/http/HttpSecurityScheme.java
similarity index 61%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/http/HttpSecurityScheme.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/http/HttpSecurityScheme.java
index a0e7d943..3a779403 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/http/HttpSecurityScheme.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/http/HttpSecurityScheme.java
@@ -1,15 +1,17 @@
-package com.asyncapi.v2.model.security_scheme.http;
+package com.asyncapi.v2.security_scheme.http;
-import com.asyncapi.v2.model.security_scheme.SecurityScheme;
-import lombok.*;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import com.asyncapi.v2.security_scheme.SecurityScheme;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
- * @version 2.0.0
- * SecurityScheme
+ * @version 2.6.0
+ * @see SecurityScheme
* @author Pavel Bodiachevskii
*/
@Data
@@ -20,24 +22,23 @@ public class HttpSecurityScheme extends SecurityScheme {
/**
* REQUIRED.
- *
+ *
* The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235 .
*/
- @Nonnull
- @NonNull
+ @NotNull
private String scheme;
/**
* A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated
* by an authorization server, so this information is primarily for documentation purposes.
*/
- @CheckForNull
+ @Nullable
private String bearerFormat;
@Builder(builderMethodName = "httpSecuritySchemeBuilder")
- public HttpSecurityScheme(@Nonnull @NonNull Type type,
+ public HttpSecurityScheme(@NotNull Type type,
@Nullable String description,
- @NonNull @Nonnull String scheme,
+ @NotNull String scheme,
@Nullable String bearerFormat) {
super(type, description);
this.scheme = scheme;
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/OAuth2SecurityScheme.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/OAuth2SecurityScheme.java
new file mode 100644
index 00000000..e3543d35
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/OAuth2SecurityScheme.java
@@ -0,0 +1,39 @@
+package com.asyncapi.v2.security_scheme.oauth2;
+
+import com.asyncapi.v2.security_scheme.SecurityScheme;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @version 2.6.0
+ * @see SecurityScheme
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+public class OAuth2SecurityScheme extends SecurityScheme {
+
+ /**
+ * REQUIRED.
+ *
+ * An object containing configuration information for the flow types supported.
+ */
+ @NotNull
+ private OAuthFlows flows;
+
+ @Builder(builderMethodName = "oauth2SecuritySchemeBuilder")
+ public OAuth2SecurityScheme(@NotNull Type type,
+ @Nullable String description,
+ @NotNull OAuthFlows flows) {
+ super(type, description);
+ this.flows = flows;
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/OAuthFlows.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/OAuthFlows.java
new file mode 100644
index 00000000..835b636f
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/OAuthFlows.java
@@ -0,0 +1,55 @@
+package com.asyncapi.v2.security_scheme.oauth2;
+
+import com.asyncapi.v2.ExtendableObject;
+import com.asyncapi.v2.security_scheme.oauth2.flow.AuthorizationCodeOAuthFlow;
+import com.asyncapi.v2.security_scheme.oauth2.flow.ClientCredentialsOAuthFlow;
+import com.asyncapi.v2.security_scheme.oauth2.flow.ImplicitOAuthFlow;
+import com.asyncapi.v2.security_scheme.oauth2.flow.PasswordOAuthFlow;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Allows configuration of the supported OAuth Flows.
+ *
+ * This object MAY be extended with Specification Extensions .
+ *
+ * @version 2.6.0
+ * @see OAuth Flows Object
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class OAuthFlows extends ExtendableObject {
+
+ /**
+ * Configuration for the OAuth Implicit flow
+ */
+ @Nullable
+ private ImplicitOAuthFlow implicit;
+
+ /**
+ * Configuration for the OAuth Resource Owner Protected Credentials flow
+ */
+ @Nullable
+ private PasswordOAuthFlow password;
+
+ /**
+ * Configuration for the OAuth Client Credentials flow.
+ */
+ @Nullable
+ private ClientCredentialsOAuthFlow clientCredentials;
+
+ /**
+ * Configuration for the OAuth Authorization Code flow
+ */
+ @Nullable
+ private AuthorizationCodeOAuthFlow authorizationCode;
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/AuthorizationCodeOAuthFlow.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/AuthorizationCodeOAuthFlow.java
new file mode 100644
index 00000000..686a0bce
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/AuthorizationCodeOAuthFlow.java
@@ -0,0 +1,52 @@
+package com.asyncapi.v2.security_scheme.oauth2.flow;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * This object MAY be extended with Specification Extensions .
+ *
+ * @version 2.6.0
+ * @see OAuth Flow Object
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class AuthorizationCodeOAuthFlow extends OAuthFlow {
+
+ /**
+ * REQUIRED.
+ *
+ * The authorization URL to be used for this flow. This MUST be in the form of an absolute URL.
+ */
+ @NotNull
+ private String authorizationUrl;
+
+ /**
+ * REQUIRED.
+ *
+ * The token URL to be used for this flow. This MUST be in the form of an absolute URL.
+ */
+ @NotNull
+ private String tokenUrl;
+
+ @Builder(builderMethodName = "authorizationCodeOAuthFlowBuilder")
+ public AuthorizationCodeOAuthFlow(@Nullable String refreshUrl,
+ @NotNull Map scopes,
+ @NotNull String authorizationUrl,
+ @NotNull String tokenUrl) {
+ super(refreshUrl, scopes);
+ this.authorizationUrl = authorizationUrl;
+ this.tokenUrl = tokenUrl;
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/ClientCredentialsOAuthFlow.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/ClientCredentialsOAuthFlow.java
new file mode 100644
index 00000000..749d9ca6
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/ClientCredentialsOAuthFlow.java
@@ -0,0 +1,40 @@
+package com.asyncapi.v2.security_scheme.oauth2.flow;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * @version 2.6.0
+ * @see OAuth Flow Object
+ * @author Pavel Bodiachevskii
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class ClientCredentialsOAuthFlow extends OAuthFlow {
+
+ /**
+ * REQUIRED.
+ *
+ * The token URL to be used for this flow. This MUST be in the form of a URL.
+ */
+ @NotNull
+ private String tokenUrl;
+
+ @Builder(builderMethodName = "clientCredentialsOAuthFlowBuilder")
+ public ClientCredentialsOAuthFlow(@Nullable String refreshUrl,
+ @NotNull Map scopes,
+ @NotNull String tokenUrl) {
+ super(refreshUrl, scopes);
+ this.tokenUrl = tokenUrl;
+ }
+
+}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/ImplicitOAuthFlow.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/ImplicitOAuthFlow.java
similarity index 50%
rename from asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/ImplicitOAuthFlow.java
rename to asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/ImplicitOAuthFlow.java
index d88b0cba..704117b4 100644
--- a/asyncapi-core/src/main/java/com/asyncapi/v2/model/security_scheme/oauth2/flow/ImplicitOAuthFlow.java
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/ImplicitOAuthFlow.java
@@ -1,14 +1,18 @@
-package com.asyncapi.v2.model.security_scheme.oauth2.flow;
+package com.asyncapi.v2.security_scheme.oauth2.flow;
-import lombok.*;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import java.util.Map;
/**
- * @version 2.0.0
- * @see OAuth Flow Object
+ * @version 2.6.0
+ * @see OAuth Flow Object
* @author Pavel Bodiachevskii
*/
@Data
@@ -19,17 +23,16 @@ public class ImplicitOAuthFlow extends OAuthFlow {
/**
* REQUIRED.
- *
+ *
* The authorization URL to be used for this flow. This MUST be in the form of a URL
*/
- @Nonnull
- @NonNull
+ @NotNull
private String authorizationUrl;
@Builder(builderMethodName = "implicitOAuthFlowBuilder")
public ImplicitOAuthFlow(@Nullable String refreshUrl,
- @Nonnull @NonNull Map scopes,
- @Nonnull @NonNull String authorizationUrl) {
+ @NotNull Map scopes,
+ @NotNull String authorizationUrl) {
super(refreshUrl, scopes);
this.authorizationUrl = authorizationUrl;
}
diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/OAuthFlow.java b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/OAuthFlow.java
new file mode 100644
index 00000000..4fec68c3
--- /dev/null
+++ b/asyncapi-core/src/main/java/com/asyncapi/v2/security_scheme/oauth2/flow/OAuthFlow.java
@@ -0,0 +1,44 @@
+package com.asyncapi.v2.security_scheme.oauth2.flow;
+
+import com.asyncapi.v2.ExtendableObject;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Map;
+
+/**
+ * Configuration details for a supported OAuth Flow
+ *
+ * This object MAY be extended with