Skip to content

multiple-response-types

Id
@azure-tools/typespec-client-generator-core/multiple-response-types

Severity: warning

This diagnostic is issued when one operation has multiple distinct response body types across its successful responses. Some emitters cannot expose all of those response shapes in a single method return type.

  • Area: SDK method response modeling. Generation continues, but some emitters may be unable to represent every distinct response body type in one method return shape.
  • Not affected: The service can still declare multiple wire responses.

TCGC reports:

Multiple response types found in operation getWidget. Some emitters might not support returning all of these response types

Prefer a single response body model or redesign the responses so all successful response bodies share one SDK shape.

Suppress this warning only if the target emitter is known to handle the operation’s multiple response body types correctly.

#suppress "@azure-tools/typespec-client-generator-core/multiple-response-types" "emitter supports multiple response bodies"