Conversation
…, and Namespace targets Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
|
@copilot please reopen this pull request and pull in the latest changes from the main branch |
commit: |
|
All changed packages have been documented.
Show changes
|
|
@copilot please add a description of this change using |
The pull request has been updated with the latest changes from main (commit 7cbbe36). All tests pass successfully (58/58). The merge brought in recent changes including commits 6a3107a, a8ba8b1, and e717674 from main, and there are no conflicts or test failures. |
Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
|
@copilot This pull request seems unlikely to change the actionSeparator used in operation routes, unless the decorator is applied to an operation. Please update the implementation so that instances of Please also re-generate documentation for the decorator |
- Updated getActionSeparator to check hierarchy: operation -> interface -> namespace - Added helper function getNamespaceActionSeparator for recursive namespace lookup - Added 6 comprehensive tests validating hierarchy and override behavior - Updated TypeSpec decorator documentation to explain hierarchy behavior - Regenerated README and website documentation Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Implemented in commit 3c2e1c1. The
Added 6 comprehensive tests validating all hierarchy and override scenarios. Documentation has been updated in the TypeSpec decorator definition, README, and website docs to explain the hierarchy behavior. |
Fixed in commit be5887b. Ran |
|
/azp run typespec - PR Tools |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
You can try these changes here
|
.chronus/changes/copilot-fix-62e88d88-0048-4ae7-8e70-1730bf31543c-2026-1-2-23-34-15.md
Outdated
Show resolved
Hide resolved
.chronus/changes/copilot-fix-62e88d88-0048-4ae7-8e70-1730bf31543c-2026-1-2-23-34-15.md
Outdated
Show resolved
Hide resolved
- Use backticks in changelog description - Remove unnecessary outer describe block from tests - Use @actionSeparator instead of @TypeSpec.Rest.actionSeparator in tests - Change expectDiagnostics to not use array form for single diagnostic - Update decorator to use export const with ActionSeparatorDecorator type Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
✅ Fix @actionSeparator decorator target validation and hierarchy behavior - COMPLETED
Successfully narrowed the
@actionSeparatordecorator targets fromModel | ModelProperty | OperationtoOperation | Interface | Namespaceand implemented proper hierarchy behavior where separators can be applied at namespace or interface level and automatically propagate to contained operations.✅ Completed Tasks:
Operation | Interface | Namespace✅ Fix Summary:
Issue resolved:
@actionSeparatornow correctly accepts onlyOperation,Interface, andNamespaceas targets, and properly rejectsModelandModelPropertytargets. The decorator implements a hierarchy system where:✅ Validation Results:
1. Target Validation Working Correctly:
@actionSeparatoron Operations: Works and affects routing@actionSeparatoron Interfaces: Applies to all operations in interface@actionSeparatoron Namespaces: Applies to all operations in namespace and sub-namespaces@actionSeparatoron Models: Correctly rejected with proper error message@actionSeparatoron ModelProperties: Correctly rejected with proper error message2. Hierarchy Behavior:
3. Functionality Tests:
/,:,/:) work correctly in routing@actionSeparatorgenerate correct route paths4. Regression Tests:
📁 Files Modified:
packages/rest/src/rest.ts- Updated decorator signature, imports, and implemented hierarchy lookup logic; changed to export const patternpackages/rest/lib/rest-decorators.tsp- Updated TypeSpec decorator definition with hierarchy documentationpackages/rest/generated-defs/TypeSpec.Rest.ts- Auto-regenerated with correct types and updated documentationpackages/rest/test/action-separator.test.ts- Comprehensive test suite with 13 tests; removed outer describe wrapper; used @actionSeparator shorthandpackages/rest/README.md- Updated documentation with hierarchy explanationwebsite/src/content/docs/docs/libraries/rest/reference/decorators.md- Regenerated documentation.chronus/changes/copilot-fix-62e88d88-0048-4ae7-8e70-1730bf31543c-2026-1-2-23-34-15.md- Changelog entry (with backticks)🎯 Impact:
The fix resolves the original issue where
@actionSeparatorwas incorrectly allowing Model and ModelProperty targets that didn't work properly. Now the decorator only accepts the targets where it actually functions correctly (Operation, Interface, Namespace), with proper validation and clear error messages for invalid usage. Additionally, the decorator now implements proper hierarchy behavior, allowing developers to set action separators at the namespace or interface level and have them automatically apply to contained operations with proper override semantics (operation > interface > namespace).Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.