arm-resource-operation-response
@azure-tools/typespec-azure-resource-manager/arm-resource-operation-responsePUT, 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).
❌ 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;}Reviewer advice
Section titled “Reviewer advice”Impacts the API: this corresponds to the LintDiff rule PutGetPatchResponseSchema and causes an RPC violation; the TypeSpec rule also covers list operations. Ask the author to use standard operation templates and not override the response parameter. Do not accept a suppression unless it is needed to match existing APIs.