Skip to content

[BUG] [typescript-fetch] initOverrides added in 5.2.1 breaking change #10258

@mikkovor

Description

@mikkovor
Description

The new initOverrides? optional parameter added in 5.2.1 is not working for us at least

openapi-generator version

5.2.1

Script that we use is simply:

npx @openapitools/openapi-generator-cli generate -i swagger.json -g typescript-fetch -o .\src\api

All of the generated Raw methods have this:

const response = await this.request({
            ...
        }, initOverrides);

but the actual request looks like this:

 protected async request(context: RequestOpts): Promise<Response> {
    const { url, init } = this.createFetchParams(context);
    const response = await this.fetchApi(url, init);
    if (response.status >= 200 && response.status < 300) {
      return response;
    }
    throw response;
  }

and the interface like this:

export interface RequestOpts {
  path: string;
  method: HTTPMethod;
  headers: HTTPHeaders;
  query?: HTTPQuery;
  body?: HTTPBody;
}

So I don't know where initOverrides should fit in there exactly?

Related issues/PRs

I guess this is where it was added?

#10050

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions