Skip to content

override-parameters-mismatch

Id
@azure-tools/typespec-client-generator-core/override-parameters-mismatch

Severity: error

This diagnostic is issued when an @override operation does not preserve required parameters from the original operation, or a realized path parameter loses its @path role.

  • Area: Client method override signatures. Blocks an override that cannot be mapped back to the original service operation’s required parameters.
  • Not affected: The original operation remains available with its declared parameters.
@service
namespace MyService {
op create(name: string, location: string): void;
}
op createOverride(name: string): void; // missing required parameter `location`
@@override(MyService.create, createOverride);

TCGC reports:

Method "create" has different parameters definition from the override operation. Please check the parameter defined in the override operation: "location".

Update the override operation so required parameters are present with compatible definitions and path parameters remain path parameters unless intentionally moved with @clientLocation:

op createOverride(name: string, location: string): void;
@@override(MyService.create, createOverride);