Skip to content

[BUG] Typescript-fetch : The options parameter is gone. No way to pass options. #3402

@JFCote

Description

@JFCote

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

The new version of the typescript-fetch generator seems to have completely dropped the second parameters for each call that provided a way to pass options. For example, specific header or configuration.

As you can see in version 3.3.4 tag, there is always a second parameter to each calls.
https://github.com/OpenAPITools/openapi-generator/blob/v3.3.4/modules/openapi-generator/src/main/resources/typescript-fetch/api.mustache#L93

In the current master, there is no such call and I don't see any way to pass this information.

For example, in our application, we were always passing this:

{
    credentials: "include",
    headers: {
        'Cache-Control': 'no-cache, no-store'
    }
}

Is there another way to achieve the same thing using the new generator or should I create a new PR to add back this functionality?

openapi-generator version

4.X.X (master)

OpenAPI declaration file content or url

Any spec

Command line used for generation

Any typescript-fetch generation

Steps to reproduce

Generate a typescript-fetch client and notice the issue

Related issues/PRs

Didn't find anything related to this

Suggest a fix

Add the functionality back (have a second parameter everywhere)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions