arm-resource-operation-response
@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response[RPC 008]: PUT, GET, PATCH & LIST must return the same resource schema.
Operations on a resource such as read, create, update, and list must all return the resource type itself (or a collection of the resource type for list operations).
Impact
Section titled “Impact”- Area: API
The resource operation returns a response schema that violates the RPC contract.
LintDiff Equivalent
Section titled “LintDiff Equivalent”This rule corresponds to the LintDiff rule PutGetPatchResponseSchema (the TypeSpec rule also covers list).
❌ Incorrect
Section titled “❌ Incorrect”@armResourceOperationsinterface FooResources { // Returns BarResource instead of FooResource @get @armResourceRead(FooResource) get(...ResourceInstanceParameters<FooResource>): ArmResponse<BarResource> | ErrorResponse;}✅ Correct
Section titled “✅ Correct”@armResourceOperationsinterface FooResources { @get @armResourceRead(FooResource) get(...ResourceInstanceParameters<FooResource>): ArmResponse<FooResource> | ErrorResponse;}Suppression
Section titled “Suppression”Suppress only when required to match an existing API; otherwise use the standard operation templates and do not override the response parameter.