Excess parameters allowed in createClient endpoint calls

Author: GaddiSunshineCreated May 21, 2025Updated Jul 30, 2026
Labelsbugopenapi-fetch

openapi-fetch version

0.13.5

Description

When using createClient from 'openapi-fetch' for endpoint calls, it provides the correct types for the endpoint being called and complains if parameters are missing. But it does not complain if excess parameters are sent.

Expected behavior: Image

Actual behavior: Image

Any extra parameter can be added at any nested level. And it is treated as expected.

The issue appears to be caused by the arbitrary [key: string] addition in the InitParam. Image

Is this the intended behavior for the package, or would it be preferable to enforce stricter type safety for the endpoint calls?

Reproduction

This is just out of the box usage with the api.

Expected result

Expected behavior would be to complain about excess parameters that are not expected by the api types. Image

Extra

Source: openapi-ts/openapi-typescript