Skip to content

fix: support trailing array decorator arguments - #1641

Open
Atharva15007 wants to merge 4 commits into
accordproject:mainfrom
Atharva15007:fix/1640-trailing-array-decorator-args
Open

Atharva15007 wants to merge 4 commits into
accordproject:mainfrom
Atharva15007:fix/1640-trailing-array-decorator-args

Conversation

@Atharva15007

@Atharva15007 Atharva15007 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Validate DateTime decorator arguments using the existing UTC date validation approach.
  • Add tests for valid and invalid DateTime values in both array and non-array decorator properties.

Flags

-NOne

Screenshots or Video

-N/A

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

Signed-off-by: Atharva15007 <datharva157@gmail.com>
@mira-accord-project

Copy link
Copy Markdown

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.

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.

🟡 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>
@Atharva15007

Atharva15007 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decorator validation: let a trailing array property take the remaining arguments

2 participants