Skip to content

Excess parameters allowed in createClient endpoint calls #2329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task
GaddiSunshine opened this issue May 21, 2025 · 0 comments
Open
1 task

Excess parameters allowed in createClient endpoint calls #2329

GaddiSunshine opened this issue May 21, 2025 · 0 comments
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library

Comments

@GaddiSunshine
Copy link

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

@GaddiSunshine GaddiSunshine added bug Something isn't working openapi-fetch Relevant to the openapi-fetch library labels May 21, 2025
@GaddiSunshine GaddiSunshine changed the title Excess parameters allowed in api calls Excess parameters allowed in createClient endpoint calls May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library
Projects
None yet
Development

No branches or pull requests

1 participant