Skip to content

[Fix #1280] Support both casting to JsonNode and Collection#1281

Merged
fjtirado merged 1 commit intoserverlessworkflow:mainfrom
fjtirado:Fix_#1280
Mar 30, 2026
Merged

[Fix #1280] Support both casting to JsonNode and Collection#1281
fjtirado merged 1 commit intoserverlessworkflow:mainfrom
fjtirado:Fix_#1280

Conversation

@fjtirado
Copy link
Copy Markdown
Collaborator

Fix #1280

Copilot AI review requested due to automatic review settings March 30, 2026 15:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for treating WorkflowModelCollection results as either a Jackson ArrayNode/JsonNode or as a Java Collection, enabling outputAs(...) lambdas to accept either shape when using listen(..., toOne(...)).

Changes:

  • Extend JacksonModelCollection.as(Class<T>) to return this when Collection.class is requested.
  • Add a new experimental/test Maven module with a runtime-style test covering outputAs with Collection and with ArrayNode.
  • Register the new test module in experimental/pom.xml.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollection.java Enables as(Collection.class) casting for model collections.
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/Review.java Test record used as emitted/consumed payload.
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncEventFilterTest.java New test exercising outputAs with Collection and ArrayNode for listen(...toOne...).
experimental/test/pom.xml New Maven module descriptor for the experimental tests.
experimental/pom.xml Adds the new test module to the experimental reactor build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…llection

Signed-off-by: fjtirado <ftirados@redhat.com>
Copilot AI review requested due to automatic review settings March 30, 2026 15:53
@fjtirado fjtirado merged commit 20873ad into serverlessworkflow:main Mar 30, 2026
5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +16 to +20
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mockito-core is declared as a test dependency here but isn't used by any tests in this module, which adds unnecessary dependency weight and can slow down builds. Please remove it (or add a test that actually needs it).

Suggested change
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Experimental] Increase flexibility of posible output classses for outputAs after a listen one

3 participants