Skip to content

Excess parameters allowed in createClient endpoint calls #2329

Open
@GaddiSunshine

Description

@GaddiSunshine

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions