-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: properly support multiple types
Some of the AsyncAPI fields support more than an object type. Previously this problem was "solved" accepting any `Object` but this approach required castings or directly losing the generic validations in any consumer code. Here we propose to define an interface for each field type. For example `MessageBindingValue` interface can be implemented both by the `Message` and the `Reference` models. Note this PR is WIP to discuss the approach before making it more generic.
- Loading branch information
Carlos Tasada
committed
Jun 26, 2023
1 parent
23cb885
commit b3d6fb7
Showing
35 changed files
with
188 additions
and
45 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/ChannelBindingValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define ChannelBinding compatible objects. | ||
*/ | ||
public interface ChannelBindingValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/CorrelationIdValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define CorrelationId compatible objects. | ||
*/ | ||
public interface CorrelationIdValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/MessageBindingValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define MessageBinding compatible objects. | ||
*/ | ||
public interface MessageBindingValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/MessageTraitValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define MessageTrait compatible objects. | ||
*/ | ||
public interface MessageTraitValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/MessageValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define Message compatible objects. | ||
*/ | ||
public interface MessageValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/OperationBindingValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define OperationBinding compatible objects. | ||
*/ | ||
public interface OperationBindingValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/OperationTraitValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define OperationTrait compatible objects. | ||
*/ | ||
public interface OperationTraitValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/ParameterValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define Message compatible objects. | ||
*/ | ||
public interface ParameterValue { | ||
} |
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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define Schema compatible objects. | ||
*/ | ||
public interface SchemaValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/SecuritySchemeValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define SecurityScheme compatible objects. | ||
*/ | ||
public interface SecuritySchemeValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/ServerBindingValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define ServerBinding compatible objects. | ||
*/ | ||
public interface ServerBindingValue { | ||
} |
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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define Server compatible objects. | ||
*/ | ||
public interface ServerValue { | ||
} |
7 changes: 7 additions & 0 deletions
7
asyncapi-core/src/main/java/com/asyncapi/v2/ServerVariableValue.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,7 @@ | ||
package com.asyncapi.v2; | ||
|
||
/** | ||
* Interface to define ServerVariable compatible objects. | ||
*/ | ||
public interface ServerVariableValue { | ||
} |
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
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
Oops, something went wrong.