Decorators
TypeSpec.Versioning
@added
Identifies when the target was added.
Target
Model | ModelProperty | Operation | Enum | EnumMember | Union | UnionVariant | Scalar | Interface
Parameters
Name | Type | Description |
---|---|---|
version | EnumMember | The version that the target was added in. |
Examples
@madeOptional
Identifies when a target was made optional.
Target
ModelProperty
Parameters
Name | Type | Description |
---|---|---|
version | EnumMember | The version that the target was made optional in. |
Examples
@madeRequired
Identifies when a target was made required.
Target
ModelProperty
Parameters
Name | Type | Description |
---|---|---|
version | EnumMember | The version that the target was made required in. |
Examples
@removed
Identifies when the target was removed.
Target
Model | ModelProperty | Operation | Enum | EnumMember | Union | UnionVariant | Scalar | Interface
Parameters
Name | Type | Description |
---|---|---|
version | EnumMember | The version that the target was removed in. |
Examples
@renamedFrom
Identifies when the target has been renamed.
Target
Model | ModelProperty | Operation | Enum | EnumMember | Union | UnionVariant | Scalar | Interface
Parameters
Name | Type | Description |
---|---|---|
version | EnumMember | The version that the target was renamed in. |
oldName | valueof string | The previous name of the target. |
Examples
@returnTypeChangedFrom
Identifies when the target type changed.
Target
Operation
Parameters
Name | Type | Description |
---|---|---|
version | EnumMember | The version that the target type changed in. |
oldType | unknown | The previous type of the target. |
@typeChangedFrom
Identifies when the target type changed.
Target
ModelProperty
Parameters
Name | Type | Description |
---|---|---|
version | EnumMember | The version that the target type changed in. |
oldType | unknown | The previous type of the target. |
@useDependency
Identifies that a namespace or a given versioning enum member relies upon a versioned package.
Target
EnumMember | Namespace
Parameters
Name | Type | Description |
---|---|---|
versionRecords | EnumMember[] | The dependent library version(s) for the target namespace or version. |
Examples
Select a single version of MyLib
to use
Select which version of the library match to which version of the service.
@versioned
Identifies that the decorated namespace is versioned by the provided enum.
Target
Namespace
Parameters
Name | Type | Description |
---|---|---|
versions | Enum | The enum that describes the supported versions. |