Skip to content

remove-parameter-not-found

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

Severity: error

This diagnostic is issued when removeParameter is called with a selector that does not match any parameter on the operation.

  • Area: Client customization transformations. Blocks removeParameter from producing the intended customized signature because the selector does not match an operation parameter.
  • Not affected: The original operation parameter list is unchanged.
@service
namespace MyService {
op myOp(existingParam?: string): void;
}
alias Modified = removeParameter(MyService.myOp, "missingParam"); // `missingParam` is not a parameter of `myOp`

TCGC reports:

Parameter "missingParam" not found in operation "myOp".

Use the exact name or model property reference for an existing operation parameter.

@service
namespace MyService {
op myOp(existingParam?: string): void;
}
alias Modified = removeParameter(MyService.myOp, "existingParam");