Skip to content

reorder-parameter-missing

Id
@azure-tools/typespec-client-generator-core/reorder-parameter-missing

Severity: error

This diagnostic is issued when reorderParameters omits a parameter that exists on the operation.

  • Area: Client customization transformations. Blocks reorderParameters because the transformed signature would omit an existing operation parameter.
  • Not affected: The original method parameter set remains intact.
@service
namespace MyService {
op myOp(a: string, b: string, c: string): void;
}
alias Modified = reorderParameters(MyService.myOp, #["c", "a"]); // missing parameter `b`

TCGC reports:

Parameter "b" from operation "myOp" is missing in reorder list.

Include every operation parameter exactly once in the reorder list.

@service
namespace MyService {
op myOp(a: string, b: string, c: string): void;
}
alias Modified = reorderParameters(MyService.myOp, #["c", "a", "b"]);