Skip to content

[Fix #1163] Allow inline arrays in for.in property#1170

Open
ricardozanini wants to merge 2 commits into
open-workflow-specification:mainfrom
ricardozanini:fix/1163-for-in-array
Open

[Fix #1163] Allow inline arrays in for.in property#1170
ricardozanini wants to merge 2 commits into
open-workflow-specification:mainfrom
ricardozanini:fix/1163-for-in-array

Conversation

@ricardozanini

Copy link
Copy Markdown
Collaborator

Summary

  • The for.in property now accepts either a runtime expression (string) or an inline array of objects
  • This makes the schema more flexible for cases where the collection is known at definition time, without requiring a runtime expression
  • Array items are constrained to type: object as proposed in the issue

Changes

  • schema/workflow.yaml: Changed for.in from type: string to oneOf accepting a string or an array of objects
  • dsl-reference.md: Updated for.in type documentation to string | array
  • examples/for-inline-array.yaml: New example demonstrating inline array usage

Test plan

  • All 130 existing validation tests pass
  • New example validates against the updated schema

Fixes #1163

…property

The for.in property now accepts either a runtime expression (string)
or an inline array of objects, making the schema more flexible for
cases where the collection is known at definition time.

Signed-off-by: Ricardo Zanini <[email protected]>
Copilot AI review requested due to automatic review settings July 23, 2026 18:57
@ricardozanini
ricardozanini requested a review from cdavernas as a code owner July 23, 2026 18:57

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

Updates the workflow schema and documentation to let for.in accept either a string expression or an inline, definition-time array—addressing #1163’s request to hardcode collections directly in workflow definitions.

Changes:

  • Updated schema/workflow.yaml so for.in accepts string or array (with items: { type: object }).
  • Updated dsl-reference.md to reflect the expanded for.in type.
  • Added examples/for-inline-array.yaml demonstrating inline array iteration.

Reviewed changes

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

File Description
schema/workflow.yaml Expands for.in from a single string type to a oneOf supporting string or inline array of objects.
dsl-reference.md Updates the reference table row for for.in to document the new accepted types.
examples/for-inline-array.yaml Adds a concrete example of using an inline array for for.in.

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

Comment thread schema/workflow.yaml
Comment thread dsl-reference.md Outdated
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings July 23, 2026 19:28

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

Comment thread schema/workflow.yaml
@ricardozanini

ricardozanini commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Regarding the suggestion to use $ref: '#/$defs/runtimeExpression' instead of plain type: string for the expression branch:

The plain type: string is intentional. The existing for.in field was type: string before this change, and existing CTK tests and examples use shorthand expressions like .pets and .colors (without the ${ } wrapper). These don't match the runtimeExpression pattern ^\s*\$\{.+\}\s*$.

The runtimeExpression ref is only used in schema locations where oneOf disambiguation against other string types (like uriTemplate) requires it. Here, the oneOf already discriminates by type (string vs array), so there's no ambiguity to resolve. Switching to runtimeExpression would break all existing for.in usages in loose evaluation mode.

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.

In property in for task should allow hardcoded arrays

2 participants