Skip to content

Commit

Permalink
feat(bindings): use parents in serde
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Apr 30, 2024
1 parent 8e2c30e commit f5028f5
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.asyncapi.bindings.jms.JMSChannelBinding;
import com.asyncapi.bindings.kafka.KafkaChannelBinding;
import com.asyncapi.bindings.mercure.MercureChannelBinding;
import com.asyncapi.bindings.mqtt.v0._1_0.channel.MQTTChannelBinding;
import com.asyncapi.bindings.mqtt.MQTTChannelBinding;
import com.asyncapi.bindings.mqtt5.MQTT5ChannelBinding;
import com.asyncapi.bindings.nats.NATSChannelBinding;
import com.asyncapi.bindings.pulsar.PulsarChannelBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.asyncapi.bindings.jms.JMSMessageBinding;
import com.asyncapi.bindings.kafka.KafkaMessageBinding;
import com.asyncapi.bindings.mercure.MercureMessageBinding;
import com.asyncapi.bindings.mqtt.v0._1_0.message.MQTTMessageBinding;
import com.asyncapi.bindings.mqtt.MQTTMessageBinding;
import com.asyncapi.bindings.mqtt5.MQTT5MessageBinding;
import com.asyncapi.bindings.nats.NATSMessageBinding;
import com.asyncapi.bindings.pulsar.PulsarMessageBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.asyncapi.bindings.jms.JMSOperationBinding;
import com.asyncapi.bindings.kafka.KafkaOperationBinding;
import com.asyncapi.bindings.mercure.MercureOperationBinding;
import com.asyncapi.bindings.mqtt.v0._1_0.operation.MQTTOperationBinding;
import com.asyncapi.bindings.mqtt.MQTTOperationBinding;
import com.asyncapi.bindings.mqtt5.MQTT5OperationBinding;
import com.asyncapi.bindings.nats.NATSOperationBinding;
import com.asyncapi.bindings.pulsar.PulsarOperationBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.asyncapi.bindings.jms.JMSServerBinding;
import com.asyncapi.bindings.kafka.KafkaServerBinding;
import com.asyncapi.bindings.mercure.MercureServerBinding;
import com.asyncapi.bindings.mqtt.v0._1_0.server.MQTTServerBinding;
import com.asyncapi.bindings.mqtt.MQTTServerBinding;
import com.asyncapi.bindings.mqtt5.MQTT5ServerBinding;
import com.asyncapi.bindings.nats.NATSServerBinding;
import com.asyncapi.bindings.pulsar.PulsarServerBinding;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.asyncapi.bindings.mqtt;

import com.asyncapi.bindings.ChannelBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;

/**
* This class MUST NOT contain any properties. Its name is reserved for future use.
Expand All @@ -11,4 +14,18 @@
* @see <a href="https://github.com/asyncapi/bindings/tree/master/mqtt#channel-binding-object">MQTT channel binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.mqtt.v0._1_0.channel.MQTTChannelBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.mqtt.v0._1_0.channel.MQTTChannelBinding.class, names = {
"0.1.0",
"latest"
}),
})
@EqualsAndHashCode(callSuper = true)
public abstract class MQTTChannelBinding extends ChannelBinding {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.asyncapi.bindings.mqtt;

import com.asyncapi.bindings.MessageBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;

/**
* Describes MQTT message binding.
Expand All @@ -11,4 +14,18 @@
* @see <a href="https://github.com/asyncapi/bindings/tree/master/mqtt#message-binding-object">MQTT message binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.mqtt.v0._1_0.message.MQTTMessageBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.mqtt.v0._1_0.message.MQTTMessageBinding.class, names = {
"0.1.0",
"latest"
}),
})
@EqualsAndHashCode(callSuper = true)
public abstract class MQTTMessageBinding extends MessageBinding {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.asyncapi.bindings.mqtt;

import com.asyncapi.bindings.OperationBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;

/**
* Describes MQTT operation binding.
Expand All @@ -11,4 +14,18 @@
* @see <a href="https://github.com/asyncapi/bindings/tree/master/mqtt#operation-binding-object">MQTT operation binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.mqtt.v0._1_0.operation.MQTTOperationBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.mqtt.v0._1_0.operation.MQTTOperationBinding.class, names = {
"0.1.0",
"latest"
}),
})
@EqualsAndHashCode(callSuper = true)
public abstract class MQTTOperationBinding extends OperationBinding {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.asyncapi.bindings.mqtt;

import com.asyncapi.bindings.ServerBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;

/**
* Describes MQTT server binding.
Expand All @@ -11,4 +14,18 @@
* @see <a href="https://github.com/asyncapi/bindings/tree/master/mqtt#server-binding-object">MQTT server binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.mqtt.v0._1_0.server.MQTTServerBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.mqtt.v0._1_0.server.MQTTServerBinding.class, names = {
"0.1.0",
"latest"
}),
})
@EqualsAndHashCode(callSuper = true)
public abstract class MQTTServerBinding extends ServerBinding {}

0 comments on commit f5028f5

Please sign in to comment.