Skip to content

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

@gustawdaniel

Description

@gustawdaniel

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions