Skip to content
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

Url parameters are positioned, but can we change them to objects? #46

Open
gustawdaniel opened this issue Feb 26, 2024 · 0 comments
Open

Comments

@gustawdaniel
Copy link

If we have a lot of query parameters, we getting code like this:

sportApiFetch(
        CompetitionsApiFp({
          authorization: `Bearer ${token}`,
        }).getV2Competitions(
          undefined,
          undefined,
          areaId,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          undefined,
          sportId,
          undefined,
          undefined,
        ),
      );

There are problems when:

  • somebody add new param to openapi
  • we reading this code without autocompletion from IDE

I prefer to use objects to pass query parameters instead of positioned arguments, can we add flag that will change this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant