Skip to main content
Version: Latest (Core: 0.57.x, Azure: 0.43.x)

Release Notes January 2023 (2023-01-12)

danger

This release contains breaking changes

See TypeSpec Core release notes

Breaking Changes​

Azure.Core operation customization has changed​

Prior to the January 2023 release, Azure.Core lifecycle operations were customized using a TCustom template parameter which expected a parameters and/or response property which indicates the customizations to be applied for that operation.

In this release, we have changed to a new Service Traits design which is more flexible and enables customizations for individual operations as well as all operations across an entire service specification.

Documentation and additional details can be found in this page of the Azure.Core documentation:

https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step09

Migrating to the new model​

If you have previously been customizing operation parameters using the parameters field of TCustom, you should now use either QueryParametersTrait or RequestHeadersTrait. If you were customizing response headers with the response field of TCustom, you should now use ResponseHeadersTrait for customization.

The documentation link above explains how to use these trait types.

Deprecations​

caution

Deprecated items will be removed in 2 release cycles.

@collectionFormat decorator is deprecated​

The @collectionFormat decorator in @azure-tools/typespec-autorest is deprecated in favor of a new 'format' option in the @query and @header decorators. Note that "csv" is the new default format for representing array types in headers, while "multi" is the default format for representing array types in query parameters.

For example

model Widget {
@collectionFormat("multi")
@query
colors: string[];

@collectionFormat("csv")
@header("x-ms-flanges")
flanges: string[];
}

should be changed to

model Widget {
@query({
format: "multi",
})
colors: string[];

@header({
name: "x-ms-flanges",
format: "csv",
})
flanges: string[];
}

or, taking advantage of the default format for headers and query parameters

model Widget {
@query colors: string[];
@header("x-ms-flanges") flanges: string[];
}