Skip to content

reorder-parameter-not-found

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

Severity: error

This diagnostic is issued when reorderParameters includes a parameter name that does not exist on the operation.

  • Area: Client customization transformations. Blocks reorderParameters because the order list names a parameter that the operation does not have.
  • Not affected: Existing operation parameters and their wire metadata are unchanged.
@service
namespace MyService {
op myOp(a: string, b: string): void;
}
alias Modified = reorderParameters(MyService.myOp, #["a", "missing"]); // `missing` is not a parameter of `myOp`

TCGC reports:

Parameter "missing" specified in reorder list not found in operation "myOp".

Remove the unknown name from the reorder list or add the parameter before reordering.

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