Skip to content

Commit

Permalink
Merge pull request #210 from asyncapi/feat/update-validation-api
Browse files Browse the repository at this point in the history
javax.validation has been replaced with jakarta.validation
  • Loading branch information
Pakisan authored Jan 9, 2025
2 parents 90a0b6f + 20fe849 commit 36a3344
Show file tree
Hide file tree
Showing 43 changed files with 85 additions and 85 deletions.
6 changes: 3 additions & 3 deletions asyncapi-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AMQPChannelBinding extends com.asyncapi.bindings.amqp.AMQPChannelBi
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "is", required = true, defaultValue = "routingKey")
@JsonPropertyDescription("Defines what type of channel is it. Can be either queue or routingKey (default).")
private AMQPChannelType is = AMQPChannelType.ROUTING_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AMQPChannelExchangeProperties {
* The name of the exchange. It MUST NOT exceed 255 characters long.
*/
@Nullable
@javax.validation.constraints.Size(
@jakarta.validation.constraints.Size(
max = 255,
message = "Exchange name must not exceed 255 characters long."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AMQPChannelQueueProperties {
* The name of the queue. It MUST NOT exceed 255 characters long.
*/
@Nullable
@javax.validation.constraints.Size(
@jakarta.validation.constraints.Size(
max = 255,
message = "Queue name must not exceed 255 characters long."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AMQPOperationBinding extends com.asyncapi.bindings.amqp.AMQPOperati
* Applies to: publish, subscribe
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 0,
message = "TTL (Time-To-Live) for the message must be greater than or equal to zero"
)
Expand Down Expand Up @@ -81,11 +81,11 @@ public class AMQPOperationBinding extends com.asyncapi.bindings.amqp.AMQPOperati
* Applies to: publish, subscribe
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 1,
message = "Delivery mode of the message must be either 1 (transient) or 2 (persistent)"
)
@javax.validation.constraints.Max(
@jakarta.validation.constraints.Max(
value = 2,
message = "Delivery mode of the message must be either 1 (transient) or 2 (persistent)"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AMQPChannelBinding extends com.asyncapi.bindings.amqp.AMQPChannelBi
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "is", required = true, defaultValue = "routingKey")
@JsonPropertyDescription("Defines what type of channel is it. Can be either queue or routingKey (default).")
private AMQPChannelType is = AMQPChannelType.ROUTING_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AMQPChannelExchangeProperties {
* The name of the exchange. It MUST NOT exceed 255 characters long.
*/
@Nullable
@javax.validation.constraints.Size(
@jakarta.validation.constraints.Size(
max = 255,
message = "Exchange name must not exceed 255 characters long."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AMQPChannelQueueProperties {
* The name of the queue. It MUST NOT exceed 255 characters long.
*/
@Nullable
@javax.validation.constraints.Size(
@jakarta.validation.constraints.Size(
max = 255,
message = "Queue name must not exceed 255 characters long."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AMQPOperationBinding extends com.asyncapi.bindings.amqp.AMQPOperati
* Applies to: publish, subscribe
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 0,
message = "TTL (Time-To-Live) for the message must be greater than or equal to zero"
)
Expand Down Expand Up @@ -81,11 +81,11 @@ public class AMQPOperationBinding extends com.asyncapi.bindings.amqp.AMQPOperati
* Applies to: publish, subscribe
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 1,
message = "Delivery mode of the message must be either 1 (transient) or 2 (persistent)"
)
@javax.validation.constraints.Max(
@jakarta.validation.constraints.Max(
value = 2,
message = "Delivery mode of the message must be either 1 (transient) or 2 (persistent)"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AMQPChannelBinding extends com.asyncapi.bindings.amqp.AMQPChannelBi
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "is", required = true, defaultValue = "routingKey")
@JsonPropertyDescription("Defines what type of channel is it. Can be either queue or routingKey (default).")
private AMQPChannelType is = AMQPChannelType.ROUTING_KEY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AMQPChannelExchangeProperties {
* The name of the exchange. It MUST NOT exceed 255 characters long.
*/
@Nullable
@javax.validation.constraints.Size(
@jakarta.validation.constraints.Size(
max = 255,
message = "Exchange name must not exceed 255 characters long."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AMQPChannelQueueProperties {
* The name of the queue. It MUST NOT exceed 255 characters long.
*/
@Nullable
@javax.validation.constraints.Size(
@jakarta.validation.constraints.Size(
max = 255,
message = "Queue name must not exceed 255 characters long."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AMQPOperationBinding extends com.asyncapi.bindings.amqp.AMQPOperati
* Applies to: publish, subscribe
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 0,
message = "TTL (Time-To-Live) for the message must be greater than or equal to zero"
)
Expand Down Expand Up @@ -81,11 +81,11 @@ public class AMQPOperationBinding extends com.asyncapi.bindings.amqp.AMQPOperati
* Applies to: publish, subscribe
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 1,
message = "Delivery mode of the message must be either 1 (transient) or 2 (persistent)"
)
@javax.validation.constraints.Max(
@jakarta.validation.constraints.Max(
value = 2,
message = "Delivery mode of the message must be either 1 (transient) or 2 (persistent)"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class GooglePubSubChannelBinding extends com.asyncapi.bindings.googlepubs
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "topic", required = true)
@JsonPropertyDescription("The Google Cloud Pub/Sub Topic name.")
private String topic = "";
Expand Down Expand Up @@ -71,7 +71,7 @@ public class GooglePubSubChannelBinding extends com.asyncapi.bindings.googlepubs
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "schemaSettings", required = true)
@JsonPropertyDescription("Settings for validating messages published against a schema")
private GooglePubSubChannelSchemaSettings schemaSettings = new GooglePubSubChannelSchemaSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class GooglePubSubChannelSchemaSettings {
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "encoding", required = true)
@JsonPropertyDescription("The encoding of the message (Must be one of the possible https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#encoding values.)")
private String encoding = "";
Expand All @@ -60,7 +60,7 @@ public class GooglePubSubChannelSchemaSettings {
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "name", required = true)
@JsonPropertyDescription("The name of the schema that messages published should be validated against (The format is projects/{project}/schemas/{schema}.)")
private String name = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class GooglePubSubMessageSchemaDefinition {
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "name", required = true)
@JsonPropertyDescription("The name of the schema")
private String name = "";
Expand All @@ -47,7 +47,7 @@ public class GooglePubSubMessageSchemaDefinition {
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "type", required = true)
@JsonPropertyDescription("The type of the schema")
private GooglePubSubMessageSchemaDefinitionType type = GooglePubSubMessageSchemaDefinitionType.PROTOBUF;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class GooglePubSubChannelBinding extends com.asyncapi.bindings.googlepubs
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "schemaSettings", required = true)
@JsonPropertyDescription("Settings for validating messages published against a schema")
private GooglePubSubChannelSchemaSettings schemaSettings = new GooglePubSubChannelSchemaSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class GooglePubSubChannelSchemaSettings {
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "encoding", required = true)
@JsonPropertyDescription("The encoding of the message (Must be one of the possible https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#encoding values.)")
private String encoding = "";
Expand All @@ -60,7 +60,7 @@ public class GooglePubSubChannelSchemaSettings {
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "name", required = true)
@JsonPropertyDescription("The name of the schema that messages published should be validated against (The format is projects/{project}/schemas/{schema}.)")
private String name = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class GooglePubSubMessageSchemaDefinition {
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "name", required = true)
@JsonPropertyDescription("The name of the schema")
private String name = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class HTTPOperationBinding extends com.asyncapi.bindings.http.HTTPOperati
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@jakarta.validation.constraints.NotNull
@JsonProperty(value = "type", required = true)
@JsonPropertyDescription("Type of operation. Its value MUST be either request or response.")
private HTTPOperationType type = HTTPOperationType.REQUEST;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public class IBMMQChannelBinding extends com.asyncapi.bindings.ibmmq.IBMMQChanne
* MUST be 0-104,857,600 bytes (100 MB).
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 0,
message = "Maximum length of the physical message (in bytes) must be greater or equals to 0"
)
@javax.validation.constraints.Max(
@jakarta.validation.constraints.Max(
value = 104857600,
message = "Maximum length of the physical message (in bytes) must be lower or equals to 104857600"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class IBMMQChannelQueueProperties {
* A value MUST be specified. MUST NOT exceed 48 characters in length. MUST be a valid IBM MQ queue name
*/
@NotNull
@javax.validation.constraints.NotNull
@javax.validation.constraints.Size(
@jakarta.validation.constraints.NotNull
@jakarta.validation.constraints.Size(
max = 48,
message = "Name of the IBM MQ queue must be less or equals to 48"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class IBMMQChannelTopicProperties {
* MUST NOT exceed 10240 characters in length. MAY coexist with topic.objectName
*/
@Nullable
@javax.validation.constraints.Max(
@jakarta.validation.constraints.Max(
value = 10240,
message = "Maximum length of topic string must be lower or equals to 10240"
)
Expand All @@ -51,7 +51,7 @@ public class IBMMQChannelTopicProperties {
* MUST NOT exceed 48 characters in length. MAY coexist with topic.string
*/
@Nullable
@javax.validation.constraints.Max(
@jakarta.validation.constraints.Max(
value = 48,
message = "Maximum length of topic name must be lower or equals to 48"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class IBMMQMessageBinding extends com.asyncapi.bindings.ibmmq.IBMMQMessag
*/
@Nullable
@Builder.Default
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 0,
message = "Expiry must be greater or equals to 0"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ public class IBMMQServerBinding extends com.asyncapi.bindings.ibmmq.IBMMQServerB
* MUST be 0-999999
*/
@Builder.Default
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 0,
message = "Heart beat interval must be greater or equals to 0"
)
@javax.validation.constraints.Max(
@jakarta.validation.constraints.Max(
value = 999999,
message = "Heart beat interval must be less or equals to 999999"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class KafkaChannelBinding extends com.asyncapi.bindings.kafka.KafkaChanne
* MUST be positive.
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 1,
message = "Number of partitions must be greater or equals to 1"
)
Expand All @@ -55,7 +55,7 @@ public class KafkaChannelBinding extends com.asyncapi.bindings.kafka.KafkaChanne
* MUST be positive.
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 1,
message = "Number of replicas must be greater or equals to 1"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class KafkaChannelBinding extends com.asyncapi.bindings.kafka.KafkaChanne
* MUST be positive.
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 1,
message = "Number of partitions must be greater or equals to 1"
)
Expand All @@ -53,7 +53,7 @@ public class KafkaChannelBinding extends com.asyncapi.bindings.kafka.KafkaChanne
* MUST be positive.
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 1,
message = "Number of replicas must be greater or equals to 1"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class KafkaChannelTopicConfiguration {
* The <a href="https://kafka.apache.org/documentation/#topicconfigs_retention.ms">retention.ms</a> configuration option.
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = -1,
message = "retention.ms must be greater or equals to -1"
)
Expand All @@ -48,7 +48,7 @@ public class KafkaChannelTopicConfiguration {
* The <a href="https://kafka.apache.org/documentation/#topicconfigs_retention.bytes">retention.bytes</a> configuration option.
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = -1,
message = "retention.bytes must be greater or equals to -1"
)
Expand All @@ -60,7 +60,7 @@ public class KafkaChannelTopicConfiguration {
* The <a href="https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms">delete.retention.ms</a> configuration option.
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 0,
message = "delete.retention.ms must be greater or equals to 0"
)
Expand All @@ -72,7 +72,7 @@ public class KafkaChannelTopicConfiguration {
* The <a href="https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes">max.message.bytes</a> configuration option.
*/
@Nullable
@javax.validation.constraints.Min(
@jakarta.validation.constraints.Min(
value = 0,
message = "max.message.bytes must be greater or equals to 0"
)
Expand Down
Loading

0 comments on commit 36a3344

Please sign in to comment.