spread-json-merge-patch-payload-not-supported
@azure-tools/typespec-java/spread-json-merge-patch-payload-not-supportedSeverity: warning
This diagnostic is issued when an operation spreads a JSON merge-patch body into method parameters.
Impact
Section titled “Impact”The body is kept as a model parameter because separate Java parameters cannot distinguish an omitted property from a property explicitly set to null.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”model WidgetPatch { name?: string | null;}
@patchop update(@header contentType: "application/merge-patch+json", ...WidgetPatch): void;Diagnostic Message
Section titled “Diagnostic Message”Spread JSON merge-patch payload is not supported.✅ How to Fix
Section titled “✅ How to Fix”Pass the patch model as the request body instead of spreading its properties.
@patchop update(@header contentType: "application/merge-patch+json", @body body: WidgetPatch): void;Suppression
Section titled “Suppression”This warning should not be suppressed because the generated method shape intentionally changes to preserve merge-patch semantics.