You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removed implicitOptionality: true from the @patch decorator on the following operation templates:,> ,> - ArmTagsPatchAsync,> - ArmResourcePatchAsync,> - ArmTagsPatchSync,> - ArmResourcePatchSync,> - ResourceUpdateSync.update (in ResourceUpdateSync interface),> ,> Previously, these templates used @patch(#{ implicitOptionality: true }) which caused all properties in the PATCH request body to be implicitly treated as optional, regardless of how they were declared in the model. This behavior is now removed — properties will retain their declared optionality.,> ,> #### Migration,> ,> If you use these ARM operation templates, the PATCH body will no longer implicitly make all properties optional. In most cases, ARM resources already use ResourceUpdateModel<Resource, Properties> which produces the correct optional property envelope — if so, no changes are needed.,> ,> If you have a custom patch body that relied on implicit optionality, explicitly mark properties as optional:,> ,> Before (implicit optionality made all properties optional automatically):,> ,> tsp,> model MyResourceProperties {,> displayName: string;,> config: MyConfig;,> },> ,> ,> After (explicitly declare optional properties for update):,> ,> tsp,> model MyResourceUpdateProperties {,> displayName?: string;,> config?: MyConfig;,> },> ,> ,> Or continue using ResourceUpdateModel<Resource, Properties> which already handles this transformation for standard ARM resource patterns.
Removed implicitOptionality: true from the @patch decorator on the following operation templates:,> ,> - ResourceCreateOrUpdate,> - LongRunningResourceCreateOrUpdate,> - ResourceUpdate,> ,> Previously, these templates used @patch(#{ implicitOptionality: true }) which caused all properties in the PATCH request body to be implicitly treated as optional, regardless of how they were declared in the model. This behavior is now removed — properties will retain their declared optionality.,> ,> #### Migration,> ,> If your service relies on all properties being optional in the PATCH body, you need to explicitly mark them as optional in your model:,> ,> Before (implicit optionality made all properties optional automatically):,> ,> tsp,> model Widget {,> name: string;,> color: string;,> },> ,> ,> After (explicitly declare optional properties):,> ,> tsp,> model WidgetUpdate {,> name?: string;,> color?: string;,> },> ,> ,> Alternatively, you can use the ResourceUpdateModel template or OptionalProperties utility to derive an all-optional version of your model for PATCH operations. If you were already using ResourceUpdateModel<Resource> or manually defining optional properties in your update model, no changes are needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int:azure-specsRun integration tests against azure-rest-api-specslib:azure-coreIssues for @azure-tools/typespec-azure-core librarylib:azure-http-specsFor issues/prs related to the @azure-tools/typespec-azure-http-specs packagelib:azure-resource-managerIssues for @azure-tools/typespec-azure-core library
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.