[Fix #1333] Fixing WorkflowModelCollection serialization/deserialization#1334
Merged
fjtirado merged 1 commit intoserverlessworkflow:mainfrom Apr 22, 2026
Merged
[Fix #1333] Fixing WorkflowModelCollection serialization/deserialization#1334fjtirado merged 1 commit intoserverlessworkflow:mainfrom
fjtirado merged 1 commit intoserverlessworkflow:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes #1333 by ensuring WorkflowModelCollection implementations are marshalled/unmarshalled as models (custom objects) rather than as raw collections, preventing type loss and potential ClassCastException when consumers expect a WorkflowModel.
Changes:
- Register new collection-specific
CustomObjectMarshallerimplementations for both Jackson and experimental Java model collections. - Add Jackson serializer/deserializer so
JacksonModelCollectionis represented as a JSON array (not an object wrapper). - Update core
writeObjectlogic to treat anyWorkflowModelasType.CUSTOM, ensuring model collections don’t fall through toType.COLLECTION.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| impl/model/src/main/resources/META-INF/services/io.serverlessworkflow.impl.marshaller.CustomObjectMarshaller | Registers Jackson collection marshaller via ServiceLoader. |
| impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollectionSerializer.java | Serializes JacksonModelCollection as its underlying array node. |
| impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollectionDeserializer.java | Deserializes JSON into JacksonModelCollection (currently has a constructor/type mismatch bug). |
| impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollectionMarshaller.java | Adds a Jackson-based CustomObjectMarshaller for JacksonModelCollection. |
| impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollection.java | Adds Jackson (de)serialization annotations and exposes node for serializer access. |
| impl/core/src/main/java/io/serverlessworkflow/impl/marshaller/AbstractOutputBuffer.java | Forces WorkflowModel instances (including collections) to be written as Type.CUSTOM. |
| experimental/model/src/main/resources/META-INF/services/io.serverlessworkflow.impl.marshaller.CustomObjectMarshaller | Registers experimental Java collection marshaller via ServiceLoader. |
| experimental/model/src/main/java/io/serverlessworkflow/impl/model/func/JavaModelCollectionMarshaller.java | Adds CustomObjectMarshaller for JavaModelCollection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ation/deserialization Signed-off-by: fjtirado <ftirados@redhat.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #1333