0.41.0 March 2024
Release Notes Version 0.41.0 - March 2024
Section titled “Release Notes Version 0.41.0 - March 2024”See TypeSpec Core 0.55 release notes
Breaking Changes
Section titled “Breaking Changes”@azure-tools/typespec-client-generator-core
Section titled “@azure-tools/typespec-client-generator-core”API breaking changes:
- #451 adjust generated discriminator property sequence to prevent potential breaking change
- #459 enums are always fixed after we switch to use union to represent extensible enum
- #444 SdkUnionType, SdkEnumType, and SdkModelType will now always have a
.nameproperty..isGeneratedNameis now a boolean that expresses whether the.namewas generated or described in the tsp - #524 deprecate getParameterMapping and make .bodyParam on SdkHttpOperation a single optional param instead of list
- #536 git status
- #515 change responses from a record to a mapping of status code, range, or default
Deprecations
Section titled “Deprecations”@azure-tools/typespec-azure-resource-manager
Section titled “@azure-tools/typespec-azure-resource-manager”-
#407 Deprecate
ResourceIdentifierin favor of newAzure.Core.armResourceIdentifiermyId: ResourceIdentifier;myId: Azure.Core.armResourceIdentifier;If you where not using any types from
Azure.Corepreviously you might need to add@useDependency(Azure.Core.Versions.v1_0_Preview_2on your version enum members.
@azure-tools/typespec-client-generator-core
Section titled “@azure-tools/typespec-client-generator-core”- #560 add deprecation for
getResponseMapping()on method, switch to.resultPathonSdkServiceMethodResponseinstead - #504 deprecate
.armonSdkClientType. Instead, you should access.armon yourSdkContext - #381 deprecating isErrorOrChildOfError. Users should directly use isErrorModel from the standard TypeSpec library
- #445 Users should call
.nameinstead of.nameInClientonSdkModelPropertyTypes - #447 move nullability onto params and responses. Add nullableValues on SdkArrayType and SdkDictionaryType
- #503 Deprecate
.isErroron anSdkModelType. WithSdkPackage, you should not need to know that a model is used as an error. - #511 Remove support for unused
.overloadsand.overloadingonSdkMethod
Features
Section titled “Features”@azure-tools/typespec-autorest
Section titled “@azure-tools/typespec-autorest”- #407 Add support for new
Azure.Core.armResourceIdentifierscalar
@azure-tools/typespec-azure-core
Section titled “@azure-tools/typespec-azure-core”- #407 Adding new
armResourceIdentifierscalar to represent an Arm ID - #505 Enable
no-closed-literallinter rule by default inallruleset - #467 Enable
no-enumrule by default inallruleset
@azure-tools/typespec-azure-portal-core
Section titled “@azure-tools/typespec-azure-portal-core”- #386 put more validation and remove browse.argQuery from proxyResource usage
@azure-tools/typespec-azure-resource-manager
Section titled “@azure-tools/typespec-azure-resource-manager”- 376
RetryAfterheader was moved to be in the defaultLroHeadersfor LRO operations. If you were overriding theLroHeaderstemplate parmater previously you might need to add& Azure.Core.FoundationsRetryAfterHeader - #495 Made
delegatedIdentityClientIdoptionalCustomerManagedKeyEncryptionto align with the common types definition. - #514 Add
lro-location-headerrule. - #369 Add
arm-put-operation-response-codesandarm-post-operation-response-codesrules. - #359 ARM: add
arm-resource-name-patternrule to allow disabling LintDiffResourceNamePatternrule
@azure-tools/typespec-client-generator-core
Section titled “@azure-tools/typespec-client-generator-core”- #384 return Versions enum as part of getAllModels
- #538 When no server url is passed, we still set serverUrl to
{endpoint}and make one templateArg forendpoint. This way, emitters can always look at a combination of serverUrl and templateArguments to get the full picture - #395 add a cached getHttpOperation helper function
- #402 add
discriminatorPropertyref to discriminated model - #474 create SdkEndpointType to encapsulate templating and url
- #413 Add
@accessand@usagesupport for named union - #502 add UsageFlags.MultipartFormData to represent whether a model is used as form data
- #551 add
isGeneratedNametoSdkModelPropertyTypes - #455 We’ve added Usage.JsonMergePatch. Usage.Input continues to refer to all inputs, Usage.JsonMergePatch is set if a model is explicitly set as JSON merge patch input body
- #572 Workaround for arm provider method parameter
- #573 support scalar doc
- #393 give a nonredundant name for templated instance model
- #513 all clients now have an initialization property. whether the initialization property is public or not determines whether an end-user should instantiate that client
Bug Fixes
Section titled “Bug Fixes”@azure-tools/typespec-autorest
Section titled “@azure-tools/typespec-autorest”- #414 updating autorest to emit response headers in lexicographic order
- #512 Fix: Discriminated inheritance wasn’t resolving the
x-ms-discriminator-valuewhen it had an intermediate model.
@azure-tools/typespec-azure-core
Section titled “@azure-tools/typespec-azure-core”- #392 Fix
@lroStatusnot detecting default states correctly when using union - #498
no-enumrule codefix now convert to named variant when the enum had not values (e.g.enum E {a, b}) - #549 Remove readOnly from nextLink in templates (#418)
- #462 Update
property-name-conflictlinter rule to stop looking and recommending@projectedNamein favor of@clientName
@azure-tools/typespec-azure-resource-manager
Section titled “@azure-tools/typespec-azure-resource-manager”- #410 Fixing ArmDeleteLroResponse missing Retry-After header
@azure-tools/typespec-client-generator-core
Section titled “@azure-tools/typespec-client-generator-core”- #556 ensure apiVersion parameter is always generated with name
apiVersion - #563 filter out
TypeSpec.ARMmodels as well fromsdkPackage.models - #434 Fix wrong client cache for package clients calculation
- #561 fix template naming for enums
- #508 fix wrong usage calculation for enum value model property
- #517 fix wrong union
generatedNameflag and refine templated model naming - #389 rollback change of union as enum with hierarchy
- #412 prevent carry over for
@clientName - #569 don’t recursively set
MultipartFormDatausage for models that are properties on aMultipartFormDatamodel - #572 Set spread model with none usage
- #501 rename UsageFlags.Versioning to UsageFlags.ApiVersionEnum