Skip to content

[BUG] [typescript-angular] DELETE method - TS2554: Expected 1-2 arguments, but got 3 #10864

@constantant

Description

@constantant
Description

It generates a wrong way to call the HttpClient.delete method

openapi-generator version
5.3.1-SNAPSHOT
OpenAPI declaration file content or url
"/v1/project/{projectId}": {
  "delete": {
    "tags": [
      "Project"
    ],
    "parameters": [
      {
        "name": "projectId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      }
    ],
    "responses": {
      "200": {
        "description": "Success"
      }
    }
  }
}
Generation Details
return this.httpClient.delete<any>(`${this.configuration.basePath}/v1/project/${encodeURIComponent(String(projectId))}`,
    null, // <-- the issue
    {
        context: localVarHttpContext,
        responseType: <any>responseType_,
        withCredentials: this.configuration.withCredentials,
        headers: localVarHeaders,
        observe: observe,
        reportProgress: reportProgress
    }
);
Steps to reproduce

Generate from the DELETE method definition

Suggest a fix

In case of the DELETE method do not provide the body payload

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