reorder-parameter-duplicate
@azure-tools/typespec-client-generator-core/reorder-parameter-duplicateSeverity: error
This diagnostic is issued when reorderParameters lists the same parameter name more than once.
Impact
Section titled “Impact”- Area: Client customization transformations. Blocks
reorderParametersbecause a duplicated name would make the generated method parameter order ambiguous. - Not affected: The operation’s actual parameters are unchanged.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@servicenamespace MyService { op myOp(a: string, b: string): void;}
alias Modified = reorderParameters(MyService.myOp, #["a", "a"]); // `a` appears twiceDiagnostic Message
Section titled “Diagnostic Message”TCGC reports:
Parameter "a" appears more than once in the reorder list for operation "myOp".✅ How to Fix
Section titled “✅ How to Fix”Include each parameter exactly once in the reorder list.
@servicenamespace MyService { op myOp(a: string, b: string): void;}
alias Modified = reorderParameters(MyService.myOp, #["b", "a"]);