-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from asyncapi/release/1.0.0-RC2
build: 1.0.0-RC2
- Loading branch information
Showing
3,365 changed files
with
58,162 additions
and
56,853 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
java=8.0.362-amzn | ||
maven=3.9.0 | ||
java=21.0.2-amzn | ||
maven=3.9.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
asyncapi-core/src/main/java/com/asyncapi/bindings/BindingsMapDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.asyncapi.bindings; | ||
|
||
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 bindings map. | ||
* | ||
* @author Pavel Bodiachevskii | ||
* @since 1.0.0-RC2 | ||
*/ | ||
public abstract class BindingsMapDeserializer extends JsonDeserializer<Map<String, Object>> { | ||
|
||
public abstract Object chooseKnownPojo(String bindingKey, JsonNode binding, ObjectCodec objectCodec) throws IOException; | ||
|
||
@Override | ||
public Map<String, Object> deserialize( | ||
JsonParser p, | ||
DeserializationContext ctxt | ||
) throws IOException, JsonProcessingException { | ||
ObjectCodec objectCodec = p.getCodec(); | ||
JsonNode node = objectCodec.readTree(p); | ||
|
||
Map<String, Object> bindings = new HashMap<>(); | ||
|
||
node.fieldNames().forEachRemaining( | ||
fieldName -> { | ||
try { | ||
bindings.put(fieldName, chooseKnownPojo(fieldName, node.get(fieldName), objectCodec)); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
); | ||
|
||
return bindings; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
asyncapi-core/src/main/java/com/asyncapi/bindings/ChannelBinding.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.asyncapi.bindings; | ||
|
||
import com.asyncapi.schemas.asyncapi.ExtendableObject; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Describes protocol-specific definition for a channel. | ||
* <p> | ||
* This object MAY be extended with {@link ExtendableObject}. | ||
* | ||
* @see <a href="https://www.asyncapi.com/docs/reference/specification/v3.0.0#specificationExtensions">Specification Extensions</a> | ||
* @see <a href="https://www.asyncapi.com/docs/reference/specification/v3.0.0#channelBindingsObject">Channel Binding</a> | ||
* @author Pavel Bodiachevskii | ||
* @since 1.0.0-RC2 | ||
*/ | ||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
public class ChannelBinding extends ExtendableObject { | ||
|
||
/** | ||
* The version of this binding. | ||
* <p> | ||
* If omitted, 'latest' <b>MUST</b> be assumed. | ||
*/ | ||
@Nullable | ||
@JsonProperty("bindingVersion") | ||
private String bindingVersion; | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
asyncapi-core/src/main/java/com/asyncapi/bindings/ChannelBindingsDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package com.asyncapi.bindings; | ||
|
||
import com.asyncapi.bindings.amqp.AMQPChannelBinding; | ||
import com.asyncapi.bindings.amqp1.AMQP1ChannelBinding; | ||
import com.asyncapi.bindings.anypointmq.AnypointMQChannelBinding; | ||
import com.asyncapi.bindings.googlepubsub.GooglePubSubChannelBinding; | ||
import com.asyncapi.bindings.http.HTTPChannelBinding; | ||
import com.asyncapi.bindings.ibmmq.IBMMQChannelBinding; | ||
import com.asyncapi.bindings.jms.JMSChannelBinding; | ||
import com.asyncapi.bindings.kafka.KafkaChannelBinding; | ||
import com.asyncapi.bindings.mercure.MercureChannelBinding; | ||
import com.asyncapi.bindings.mqtt.MQTTChannelBinding; | ||
import com.asyncapi.bindings.mqtt5.MQTT5ChannelBinding; | ||
import com.asyncapi.bindings.nats.NATSChannelBinding; | ||
import com.asyncapi.bindings.pulsar.PulsarChannelBinding; | ||
import com.asyncapi.bindings.redis.RedisChannelBinding; | ||
import com.asyncapi.bindings.sns.SNSChannelBinding; | ||
import com.asyncapi.bindings.solace.SolaceChannelBinding; | ||
import com.asyncapi.bindings.sqs.SQSChannelBinding; | ||
import com.asyncapi.bindings.stomp.STOMPChannelBinding; | ||
import com.asyncapi.bindings.websockets.WebSocketsChannelBinding; | ||
import com.asyncapi.schemas.asyncapi.Reference; | ||
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 | ||
* @since 1.0.0-RC2 | ||
*/ | ||
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; | ||
} | ||
} | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
asyncapi-core/src/main/java/com/asyncapi/bindings/MessageBinding.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.asyncapi.bindings; | ||
|
||
import com.asyncapi.schemas.asyncapi.ExtendableObject; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Describes AsyncAPI message binding. | ||
* <p> | ||
* This object MAY be extended with {@link ExtendableObject}. | ||
* | ||
* @see <a href="https://www.asyncapi.com/docs/reference/specification/v3.0.0#specificationExtensions">Specification Extensions</a> | ||
* @see <a href="https://www.asyncapi.com/docs/reference/specification/v3.0.0#messageBindingsObject">Message Binding</a> | ||
* @author Pavel Bodiachevskii | ||
* @since 1.0.0-RC2 | ||
*/ | ||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
public class MessageBinding extends ExtendableObject { | ||
|
||
/** | ||
* The version of this binding. | ||
* <p> | ||
* If omitted, 'latest' <b>MUST</b> be assumed. | ||
*/ | ||
@Nullable | ||
@JsonProperty("bindingVersion") | ||
private String bindingVersion; | ||
|
||
} |
Oops, something went wrong.