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: |
|
❌ There is undocummented changes. Run The following packages have changes but are not 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. |
|
@copilot the PR is failing due to formatting and because building the @tpespec/rest package makes changes to generated typespec definitions. Please run pnpm format to fix the formatting of all files and ensure that all changes are included in the PR after performing 'pnpm build' on the @typespec/rest package. |
- Run pnpm format to fix whitespace formatting - Regenerate TypeSpec.Rest.ts with updated decorator documentation - All changes properly formatted and ready for CI Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Fixed in commit be5887b. Ran |
✅ 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 (formatted)packages/rest/lib/rest-decorators.tsp- Updated TypeSpec decorator definition with hierarchy documentation (formatted)packages/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 including hierarchy tests (formatted)packages/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🎯 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.