Repository navigation
fix: support trailing array decorator arguments - #1641
Atharva15007 wants to merge 4 commits into
Conversation
Signed-off-by: Atharva15007 <datharva157@gmail.com>
…rray-decorator-args
Signed-off-by: Atharva15007 <datharva157@gmail.com>
|
Thank you for this pull request, which lets a trailing array property take the remaining decorator arguments. We have requested review from Jonathan Casey, Jamie Shorten, Stefan Blaginov and Ertugrul Karademir, the Concerto maintainers. Continuous integration runs need a maintainer's approval before they start, so that is the next step. A maintainer will reply here once they have reviewed the change. Posted automatically by Mira, an Accord Project agent. A maintainer will follow up; they make the decisions on this. |
There was a problem hiding this comment.
🟡 Changes recommended
Required-array argument binding regresses when optional properties precede it, and primitive arguments can trigger a raw TypeError that aborts validation even in warning mode.
2 open issues
What changed in this PR
This PR extends Concerto’s typed decorator validation to support variable-length arguments through a trailing array property, addressing #1640.
Changes:
- Validate remaining positional arguments against the trailing array’s element type, with position-specific errors.
- Add DateTime validation and guards for invalid arguments in warning mode.
- Add tests for trailing arrays, required and optional properties, argument ordering, and DateTime values.
| File | Description |
|---|---|
packages/concerto-core/test/introspect/decorators.js |
Adds coverage for trailing arrays, diagnostics, ordering, and DateTime validation. |
packages/concerto-core/src/introspect/decorator.ts |
Implements trailing-array argument validation and DateTime checks. |
Review effort: Balanced
Signed-off-by: Atharva15007 <datharva157@gmail.com>
|
Hi @jonathan-casey , @jamieshorten , @stefanblaginov , @mttrbrts ,and @ekarademir , Thank you for reviewing and requesting reviews on this PR! I've addressed the feedback from Copilot regarding the trailing array decorator validation edge cases (handling optional property ordering and guarding primitive lookups in warning mode). All tests are passing and the changes are ready for your review whenever you have a moment. |

Closes #1640
Summary
This PR adds support for trailing array properties in decorator declarations. Remaining positional decorator arguments are collected into the trailing array property and validated individually against its declared element type.
Changes
-Support trailing array properties as the final destination for remaining decorator arguments.
-Validate each argument against the declared primitive or object element type.
-Provide argument-position-specific validation errors for invalid trailing array arguments.
-Handle optional and required trailing array properties.
-Preserve existing required-first argument ordering and non-array decorator behavior.
-Add unit tests covering valid references, invalid types, undefined types, primitive values, optional and required arrays, and argument positions.
Flags
-NOne
Screenshots or Video
-N/A
Related Issues
Author Checklist
--signoffoption of git commit.mainfromfork:branchname