January 2023
Release Notes January 2023 (2023-01-12)
Section titled āRelease Notes January 2023 (2023-01-12)āSee TypeSpec Core release notes
Breaking Changes
Section titled āBreaking ChangesāAzure.Core
operation customization has changed
Section titled ā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
Section titled ā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
Section titled āDeprecationsā@collectionFormat
decorator is deprecated
Section titled ā@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[];}