Skip to content

[Fix #1271] Improving CustomObjectMarshaller resolution - #1272

Merged
fjtirado merged 1 commit into
open-workflow-specification:mainfrom
fjtirado:Fix_#1271
Mar 26, 2026
Merged

fjtirado merged 1 commit into
open-workflow-specification:mainfrom
fjtirado:Fix_#1271

Conversation

@fjtirado

Copy link
Copy Markdown
Collaborator

Fix #1271

Copilot AI review requested due to automatic review settings March 26, 2026 11:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses #1271 by making CustomObjectMarshaller selection deterministic when multiple marshallers are applicable, aiming to choose the “closest” match in the class hierarchy (e.g., prefer Employee over Person/Object for Student extends Employee).

Changes:

  • Adds a Student test type (subclassing Employee) to reproduce the ambiguous-resolution case.
  • Updates MarshallingUtilsTest to assert the expected marshaller is chosen for Student.
  • Refactors MarshallingUtils.getCustomMarshaller to consider class “distance” (and adds a cache).

Reviewed changes

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

File Description
impl/core/src/main/java/io/serverlessworkflow/impl/marshaller/MarshallingUtils.java Updates marshaller resolution logic and introduces caching for resolved marshallers.
impl/core/src/test/java/io/serverlessworkflow/impl/marshaller/MarshallingUtilsTest.java Expands test coverage to include Student and adjusts priorities/order expectations.
impl/core/src/test/java/io/serverlessworkflow/impl/marshaller/Student.java Adds a subclass used to validate “closest match” marshaller selection.

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

Copilot AI review requested due to automatic review settings March 26, 2026 11:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 4 comments.


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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 4 comments.


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

@fjtirado
fjtirado marked this pull request as draft March 26, 2026 11:57
@fjtirado
fjtirado force-pushed the Fix_#1271 branch 2 times, most recently from e015f79 to 751857e Compare March 26, 2026 12:58
@fjtirado
fjtirado marked this pull request as ready for review March 26, 2026 12:58
Copilot AI review requested due to automatic review settings March 26, 2026 12:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 7 out of 7 changed files in this pull request and generated 4 comments.


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

@ricardozanini ricardozanini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 7 out of 7 changed files in this pull request and generated 1 comment.


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

…er resolution

Signed-off-by: fjtirado <ftirados@redhat.com>
@fjtirado
fjtirado merged commit 315ea30 into open-workflow-specification:main Mar 26, 2026
3 checks passed
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.

Improve CustomObjectMarshaller resolution

3 participants