-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Improved AsyncAPI interface (#515)
* chore: Improved AsyncAPI interface Improved the creation of Messages. A 'Message' is now an interface that's implemented by 'MessageObject' and 'MessageReference'. This change allows to properly define a 'Message' and use it in a more transparent way. Added also different builders * chore: Improved AsyncAPI interface Improved the creation of Schemas. A 'Schemas' is now an interface that's implemented by 'SchemasObject' and 'SchemasReference'. This change allows to properly define a 'Schemas' and use it in a more transparent way. Added also different builders * chore: Improved AsyncAPI interface Improved the creation of Messages. A 'Message' is now an interface that's implemented by 'MessageObject' and 'MessageReference'. This change allows to properly define a 'Message' and use it in a more transparent way. Added also different builders * chore: Move 'net.javacrumbs.json-unit:json-unit-assertj' version to dependencies.gradle * chore: Improved AsyncAPI enums Added convenient methods to properly create the enums from their String representations. * fix: MessageBinding should be abstract * feat: Added missing SNS Binding Operation feat: Added missing SNS Binding Operation * fix: Fixed Operation Bindings fix: Fixed spotless
- Loading branch information
Showing
63 changed files
with
1,713 additions
and
694 deletions.
There are no files selected for viewing
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
28 changes: 16 additions & 12 deletions
28
...va/io/github/stavshamir/springwolf/asyncapi/v3/bindings/amqp/AMQPChannelExchangeType.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 |
---|---|---|
@@ -1,21 +1,25 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package io.github.stavshamir.springwolf.asyncapi.v3.bindings.amqp; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public enum AMQPChannelExchangeType { | ||
@JsonProperty("topic") | ||
TOPIC, | ||
TOPIC("topic"), | ||
DIRECT("direct"), | ||
FANOUT("fanout"), | ||
DEFAULT("default"), | ||
HEADERS("headers"); | ||
|
||
@JsonProperty("direct") | ||
DIRECT, | ||
public final String type; | ||
|
||
@JsonProperty("fanout") | ||
FANOUT, | ||
AMQPChannelExchangeType(String type) { | ||
this.type = type; | ||
} | ||
|
||
@JsonProperty("default") | ||
DEFAULT, | ||
public static AMQPChannelExchangeType fromString(String type) { | ||
return valueOf(type.toUpperCase()); | ||
} | ||
|
||
@JsonProperty("headers") | ||
HEADERS | ||
@Override | ||
public String toString() { | ||
return this.type; | ||
} | ||
} |
22 changes: 16 additions & 6 deletions
22
.../main/java/io/github/stavshamir/springwolf/asyncapi/v3/bindings/amqp/AMQPChannelType.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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package io.github.stavshamir.springwolf.asyncapi.v3.bindings.amqp; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public enum AMQPChannelType { | ||
@JsonProperty("queue") | ||
QUEUE, | ||
QUEUE("queue"), | ||
ROUTING_KEY("routingKey"); | ||
|
||
public final String type; | ||
|
||
AMQPChannelType(String type) { | ||
this.type = type; | ||
} | ||
|
||
public static AMQPChannelType fromString(String type) { | ||
return valueOf(type.toUpperCase()); | ||
} | ||
|
||
@JsonProperty("routingKey") | ||
ROUTING_KEY | ||
@Override | ||
public String toString() { | ||
return this.type; | ||
} | ||
} |
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
22 changes: 16 additions & 6 deletions
22
...thub/stavshamir/springwolf/asyncapi/v3/bindings/jms/JMSChannelBindingDestinationType.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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package io.github.stavshamir.springwolf.asyncapi.v3.bindings.jms; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public enum JMSChannelBindingDestinationType { | ||
@JsonProperty("queue") | ||
QUEUE, | ||
QUEUE("queue"), | ||
FIFO_QUEUE("fifo-queue"); | ||
|
||
public final String type; | ||
|
||
JMSChannelBindingDestinationType(String type) { | ||
this.type = type; | ||
} | ||
|
||
public static JMSChannelBindingDestinationType fromString(String type) { | ||
return valueOf(type.toUpperCase()); | ||
} | ||
|
||
@JsonProperty("fifo-queue") | ||
FIFO_QUEUE | ||
@Override | ||
public String toString() { | ||
return this.type; | ||
} | ||
} |
22 changes: 16 additions & 6 deletions
22
...thub/stavshamir/springwolf/asyncapi/v3/bindings/kafka/KafkaChannelTopicCleanupPolicy.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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package io.github.stavshamir.springwolf.asyncapi.v3.bindings.kafka; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public enum KafkaChannelTopicCleanupPolicy { | ||
@JsonProperty("compact") | ||
COMPACT, | ||
COMPACT("compact"), | ||
DELETE("delete"); | ||
|
||
public final String type; | ||
|
||
KafkaChannelTopicCleanupPolicy(String type) { | ||
this.type = type; | ||
} | ||
|
||
public static KafkaChannelTopicCleanupPolicy fromString(String type) { | ||
return valueOf(type.toUpperCase()); | ||
} | ||
|
||
@JsonProperty("delete") | ||
DELETE | ||
@Override | ||
public String toString() { | ||
return this.type; | ||
} | ||
} |
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
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
23 changes: 17 additions & 6 deletions
23
...ava/io/github/stavshamir/springwolf/asyncapi/v3/bindings/sns/SNSChannelBindingEffect.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 |
---|---|---|
@@ -1,11 +1,22 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package io.github.stavshamir.springwolf.asyncapi.v3.bindings.sns; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public enum SNSChannelBindingEffect { | ||
@JsonProperty("Allow") | ||
ALLOW, | ||
@JsonProperty("Deny") | ||
DENY | ||
ALLOW("Allow"), | ||
DENY("Deny"); | ||
|
||
public final String type; | ||
|
||
SNSChannelBindingEffect(String type) { | ||
this.type = type; | ||
} | ||
|
||
public static SNSChannelBindingEffect fromString(String type) { | ||
return valueOf(type.toUpperCase()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return this.type; | ||
} | ||
} |
Oops, something went wrong.