invalid-mark-as-lro-target
@azure-tools/typespec-client-generator-core/invalid-mark-as-lro-targetSeverity: warning
This diagnostic is issued when @markAsLro is applied to an operation that does not return a non-error model response.
Impact
Section titled “Impact”- Area: Legacy LRO SDK metadata. Generation continues with the operation treated as a regular method because no model response is available for forced LRO metadata.
- Not affected: The service operation’s HTTP behavior and response type are unchanged.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@markAsLro@postop start(): string; // LRO marker requires a model responseDiagnostic Message
Section titled “Diagnostic Message”TCGC reports:
@markAsLro decorator can only be applied to operations that return a model. We will ignore this decorator.✅ How to Fix
Section titled “✅ How to Fix”Apply @markAsLro only to operations that return a model, or remove the decorator.
model StartResponse { id: string;}
@markAsLro@postop start(): StartResponse;Suppression
Section titled “Suppression”This diagnostic should not be suppressed. Fix the target so it is a valid long-running operation, or remove @markAsLro.