Skip to content

Update produceevent.json #560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/src/main/resources/schema/events/eventref.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"description": "Maximum amount of time (ISO 8601 format) to wait for the result event. If not defined it should default to the actionExecutionTimeout"
},
"data": {
"type": "string",
"type": "object",
"existingJavaType": "com.fasterxml.jackson.databind.JsonNode",
"description": "Expression which selects parts of the states data output to become the data of the produced event."
},
"contextAttributes": {
Expand Down
5 changes: 3 additions & 2 deletions api/src/main/resources/schema/produce/produceevent.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"minLength": 1
},
"data": {
"type": "string",
"type": "object",
Copy link

Choose a reason for hiding this comment

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

According to the spec this can be either a string or an Object.
If this shouldn't be a string, can you update the description to reflect the change?

If object type, a custom object to become the data (payload) of produced event.

https://github.com/serverlessworkflow/specification/blob/0.8.x/specification.md#producedevent-definition

Copy link

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This schema is just an utility to make the generator work. In order the generator to work for both string and object, the generated POJO should return a JsonNode.

"existingJavaType": "com.fasterxml.jackson.databind.JsonNode",
"description": "Workflow expression which selects parts of the states data output to become the data of the produced event"
},
"contextAttributes": {
Expand All @@ -20,4 +21,4 @@
"required": [
"eventRef"
]
}
}