-
Notifications
You must be signed in to change notification settings - Fork 314
Allow @secret
decorator on Model, Union, and Enum types
#8546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: markcowl <[email protected]>
@secret
on any data type@secret
decorator on Model, Union, and Enum types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot You need to include the changes to:
- packages/compiler/generated-defs/TypeSpec.ts
in this PR - these changes should automatically occur when you build the compiler, because you made a change to a decorator description.
@copilot You need to include the changes to:
in this PR - these changes should automatically occur when you build the compiler, because you made a change to a decorator description. |
commit: |
@copilot
Please check that any changes indicated by executing |
... The
... The |
@copilot In addition, please run Also, please add a changelog indicating the package changes made as part of your pr in |
@copilot
Please check that any changes indicated by executing Also, please add a changelog indicating the package changes made as part of your pr in |
…ecorator widening Co-authored-by: markcowl <[email protected]>
Changes to
Formatting completed with Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
All requested changes were already completed in commit e1c6f4d. Running |
All changed packages have been documented.
Show changes
|
Issue is fixed in a separate PR |
✅ Complete: Widen @secret Decorator Target Types
Analysis
Based on the issue requirements and code exploration, I have successfully widened the target types for the
@secret
decorator fromScalar | ModelProperty
to includeModel
,Union
, andEnum
types, while maintaining existing functionality.✅ Implementation Completed
Changes Made
TypeSpec definition (
lib/std/decorators.tsp
):extern dec secret(target: string | ModelProperty)
toextern dec secret(target: Scalar | ModelProperty | Model | Union | Enum)
TypeScript type definition (
generated-defs/TypeSpec.ts
):SecretDecorator
type signature to accept the new target typesImplementation (
src/lib/decorators.ts
):validateTargetingAString
)Tests:
Documentation (
website/src/content/docs/docs/standard-library/built-in-decorators.md
):string | ModelProperty
toScalar | ModelProperty | Model | Union | Enum
Changelog (
.chronus/changes/
):✅ Verification Complete
Test Results
pnpm format
Examples Now Working
Summary
✅ Mission accomplished: The
@secret
decorator now accepts Model, Scalar, Union, and Enum types as requested in the issue, while maintaining full backward compatibility with existing string-based usage. The implementation follows TypeSpec conventions, passes all tests, includes all build-generated changes, and has proper changelog documentation.Additional instructions:
Fixes #8519
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.