diff --git a/README.md b/README.md index db0a567e..66ff100d 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,27 @@ Hints: - [Springwolf Core](https://github.com/springwolf/springwolf-core) - Automated documentation for async APIs built with Spring Boot - [AsyncAPI Quarkus](https://github.com/quarkiverse/quarkus-asyncapi) - Generates AsyncAPIRegistry and configuration classes for Quarkus +## Known open specifications to check compatibility with: +- [x] [adeo-kafka-request-reply-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/adeo-kafka-request-reply-asyncapi.yml) +- [x] [anyof-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/anyof-asyncapi.yml) +- [x] [application-headers-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/application-headers-asyncapi.yml) +- [x] [correlation-id-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/correlation-id-asyncapi.yml) +- [x] [gitter-streaming-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/gitter-streaming-asyncapi.yml) +- [x] [kraken-websocket-request-reply-message-filter-in-reply-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/kraken-websocket-request-reply-message-filter-in-reply-asyncapi.yml) +- [x] [kraken-websocket-request-reply-multiple-channels-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/kraken-websocket-request-reply-multiple-channels-asyncapi.yml) +- [x] [mercure-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/mercure-asyncapi.yml) +- [x] [not-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/not-asyncapi.yml) +- [x] [oneof-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/oneof-asyncapi.yml) +- [x] [operation-security-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/operation-security-asyncapi.yml) +- [x] [rpc-client-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/rpc-client-asyncapi.yml) +- [x] [rpc-server-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/rpc-server-asyncapi.yml) +- [x] [simple-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/simple-asyncapi.yml) +- [x] [slack-rtm-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/slack-rtm-asyncapi.yml) +- [x] [streetlights-kafka-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/streetlights-kafka-asyncapi.yml) +- [x] [streetlights-mqtt-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/streetlights-mqtt-asyncapi.yml) +- [x] [streetlights-operation-security-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/streetlights-operation-security-asyncapi.yml) +- [x] [websocket-gemini-asyncapi.yml](https://github.com/asyncapi/spec/blob/master/examples/websocket-gemini-asyncapi.yml) + ## Contributors section ### Build @@ -30,7 +51,14 @@ Hints: If you are using SDKMAN! use [env](https://sdkman.io/usage#env) to prepare environment ```shell -sdk env +sdk env install +``` + +### Install locally + +Each build is GPG signed. To avoid this, and to not configure GPG locally, you can use this command: +```shell + mvn clean install -Dgpg.skip ``` ### Publish new release diff --git a/asyncapi-core/README.md b/asyncapi-core/README.md index 369ac2b0..e1c491c3 100644 --- a/asyncapi-core/README.md +++ b/asyncapi-core/README.md @@ -14,7 +14,7 @@ which allows to use it in null-safety languages like `kotlin` without extra head com.asyncapi asyncapi-core - 1.0.0-EAP + 1.0.0-EAP-2 ``` diff --git a/asyncapi-core/pom.xml b/asyncapi-core/pom.xml index bd67c4fb..76314cda 100644 --- a/asyncapi-core/pom.xml +++ b/asyncapi-core/pom.xml @@ -6,7 +6,7 @@ asyncapi com.asyncapi - 1.0.0-EAP-2 + 1.0.0-EAP-3-SNAPSHOT 4.0.0 @@ -51,6 +51,11 @@ jackson-dataformat-yaml test + + javax.validation + validation-api + 2.0.1.Final + 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/Reference.java similarity index 92% rename from asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/Reference.java rename to asyncapi-core/src/main/java/com/asyncapi/v2/Reference.java index c5ef3856..d7b447b2 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/model/Reference.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/Reference.java @@ -1,9 +1,8 @@ -package com.asyncapi.v2._6_0.model; +package com.asyncapi.v2; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Data; -import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import org.jetbrains.annotations.NotNull; @@ -23,7 +22,6 @@ * @author Pavel Bodiachevskii */ @Data -@EqualsAndHashCode @NoArgsConstructor @AllArgsConstructor public class Reference { @@ -35,6 +33,6 @@ public class Reference { */ @NotNull @JsonProperty(value = "$ref") - private String ref; + private String ref = ""; } diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/ChannelParametersDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/ChannelParametersDeserializer.java index b568deac..c702a0ca 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/ChannelParametersDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/ChannelParametersDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.channel; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2._0_0.model.channel.Parameter; import com.asyncapi.v2.jackson.MapOfReferencesOrObjectsDeserializer; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageCorrelationIdDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageCorrelationIdDeserializer.java index eef11f8c..b5dbd0ff 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageCorrelationIdDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageCorrelationIdDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.channel.message; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2._0_0.model.channel.message.CorrelationId; import com.asyncapi.v2.jackson.ReferenceOrObjectDeserializer; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageHeadersDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageHeadersDeserializer.java index ede8eeb3..e7b62788 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageHeadersDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageHeadersDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.channel.message; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2.schema.Schema; import com.asyncapi.v2.jackson.ReferenceOrObjectDeserializer; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageTraitsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageTraitsDeserializer.java index 5d54e6cb..e80a6148 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageTraitsDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/message/MessageTraitsDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.channel.message; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2._0_0.model.channel.message.MessageTrait; import com.asyncapi.v2.jackson.ListOfReferencesOrObjectsDeserializer; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/operation/OperationMessageDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/operation/OperationMessageDeserializer.java index cf118584..8f59c963 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/operation/OperationMessageDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/operation/OperationMessageDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.channel.operation; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2._0_0.model.channel.message.Message; import com.asyncapi.v2.jackson.ReferenceOrObjectDeserializer; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/operation/OperationTraitsDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/operation/OperationTraitsDeserializer.java index 024d0883..185e271f 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/operation/OperationTraitsDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/channel/operation/OperationTraitsDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.channel.operation; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2._0_0.model.channel.operation.OperationTrait; import com.asyncapi.v2.jackson.ListOfReferencesOrObjectsDeserializer; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsMessagesDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsMessagesDeserializer.java index b171ff8e..06783ee3 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsMessagesDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsMessagesDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.component; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2._0_0.model.channel.message.Message; import com.asyncapi.v2.jackson.MapOfReferencesOrObjectsDeserializer; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsParametersDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsParametersDeserializer.java index acc7407b..1471ce0c 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsParametersDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsParametersDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.component; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2._0_0.model.channel.Parameter; import com.asyncapi.v2.jackson.MapOfReferencesOrObjectsDeserializer; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsSchemasDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsSchemasDeserializer.java index 3fcd691e..168d7dd1 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsSchemasDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsSchemasDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.component; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2.schema.Schema; import com.asyncapi.v2.jackson.MapOfReferencesOrObjectsDeserializer; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsSecuritySchemesDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsSecuritySchemesDeserializer.java index 6ae2323f..91c7d16e 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsSecuritySchemesDeserializer.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/jackson/model/component/ComponentsSecuritySchemesDeserializer.java @@ -1,6 +1,6 @@ package com.asyncapi.v2._0_0.jackson.model.component; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2.jackson.MapOfReferencesOrObjectsDeserializer; import com.asyncapi.v2.security_scheme.SecurityScheme; diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/AsyncAPI.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/AsyncAPI.java index 59d02084..790ef520 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/AsyncAPI.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/AsyncAPI.java @@ -13,6 +13,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -33,25 +34,26 @@ 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.0.0"; + @Builder.Default + private final String asyncapi = "2.0.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. */ @@ -62,7 +64,7 @@ public class AsyncAPI extends ExtendableObject { * 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 @@ -70,11 +72,12 @@ public class AsyncAPI extends ExtendableObject { /** * Required. - * + *

* Provides metadata about the API. The metadata can be used by the clients if needed. */ @NotNull - private Info info; + @Builder.Default + private Info info = new Info(); /** * Provides connection details of servers. @@ -84,15 +87,16 @@ public class AsyncAPI extends ExtendableObject { /** * 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; + @Builder.Default + private Map channels = new HashMap<>(); /** * An element to hold various schemas for the specification. diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/ExternalDocumentation.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/ExternalDocumentation.java index 9d907ea7..271780a7 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/ExternalDocumentation.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/ExternalDocumentation.java @@ -31,10 +31,11 @@ public class ExternalDocumentation extends ExtendableObject { /** * Required. - * + *

* The URL for the target documentation. Value MUST be in the format of a URL. */ @NotNull - private String url; + @Builder.Default + private String url = ""; } diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/Tag.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/Tag.java index 7c22b4a1..536a3d2a 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/Tag.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/Tag.java @@ -27,7 +27,8 @@ public class Tag extends ExtendableObject { * Required. The name of the tag. */ @NotNull - private String name; + @Builder.Default + private String name = ""; /** * A short description for the tag. CommonMark syntax can be used for rich text representation. diff --git a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/channel/ChannelItem.java b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/channel/ChannelItem.java index 4aec38b0..369c4980 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/channel/ChannelItem.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v2/_0_0/model/channel/ChannelItem.java @@ -2,7 +2,7 @@ import com.asyncapi.v2.ExtendableObject; import com.asyncapi.v2._0_0.jackson.model.channel.ChannelParametersDeserializer; -import com.asyncapi.v2._0_0.model.Reference; +import com.asyncapi.v2.Reference; import com.asyncapi.v2._0_0.model.channel.operation.Operation; import com.asyncapi.v2.binding.channel.ChannelBinding; import com.asyncapi.v2.jackson.binding.channel.ChannelBindingsDeserializer; @@ -64,9 +64,9 @@ public class ChannelItem extends ExtendableObject { /** * 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). - * + *

* This map MUST contain all the parameters used in the parent channel name. - * + *

* MUST BE: *