forked from springwolf/springwolf-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for a new `@AsyncMessage` annotation. This annotation can be used as a method parameter annotation on the same method the `@AsyncPublisher` or `@AsyncListener` annotations are used. This new `@AsyncMessage` annotation allows to enrich the AsyncAPI Operation Message with all the supported fields. The Message payload documentation stays in the Swagger `@Schema` annotation. This new `@AsyncMessage` annotation is intended to enrich the missing values. A special case is the description, which is available in both. Any value defined in `@AsyncMessage` has higher priority than any other default value.
- Loading branch information
Carlos Tasada
committed
Jun 26, 2023
1 parent
61352d7
commit c00d77f
Showing
10 changed files
with
195 additions
and
9 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
42 changes: 42 additions & 0 deletions
42
...avshamir/springwolf/asyncapi/scanners/channels/operationdata/annotation/AsyncMessage.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,42 @@ | ||
package io.github.stavshamir.springwolf.asyncapi.scanners.channels.operationdata.annotation; | ||
|
||
import io.github.stavshamir.springwolf.asyncapi.types.channel.operation.message.Message; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import static io.github.stavshamir.springwolf.asyncapi.types.channel.operation.message.Message.DEFAULT_SCHEMA_FORMAT; | ||
|
||
/** | ||
* Annotation is mapped to {@link Message} | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.PARAMETER}) | ||
public @interface AsyncMessage { | ||
/** | ||
* Mapped to {@link Message#getDescription()} | ||
*/ | ||
String description() default ""; | ||
|
||
/** | ||
* Mapped to {@link Message#getMessageId()} | ||
*/ | ||
String messageId() default ""; | ||
|
||
/** | ||
* Mapped to {@link Message#getName()} | ||
*/ | ||
String name() default ""; | ||
|
||
/** | ||
* Mapped to {@link Message#getSchemaFormat()} | ||
*/ | ||
String schemaFormat() default DEFAULT_SCHEMA_FORMAT; | ||
|
||
/** | ||
* Mapped to {@link Message#getTitle()} | ||
*/ | ||
String title() default ""; | ||
} |
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