[BUG] [typescript-angular] DELETE method - TS2554: Expected 1-2 arguments, but got 3
See original GitHub issueDescription
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
Issue Analytics
- State:
- Created 2 years ago
- Reactions:19
- Comments:26 (6 by maintainers)
Top Results From Across the Web
Angular issue : error TS2554: Expected 0 arguments, but got 3
I know there is some issue with the constructor or with the class but i am not sure what's the issue. My recipe...
Read more >angular viewchild expected 2 arguments Code Example
error TS2554 : Expected 2 arguments, but got 1. In Angular 8, ViewChild takes 2 parameters In Angular 9 default value is static:...
Read more >Expected 0 arguments, but got 1 error in TypeScript | bobbyhadz
The error "Expected 0 arguments, but got 1" occurs when we pass an argument to a function that doesn't take any arguments.
Read more >Number of Arguments in a Service is not what Angular ...
I tried to construct a function in a service that calls an API via HTTP, and returns ... error TS2554: Expected 2-8 arguments,...
Read more >The starting point for learning TypeScript
TypeScript Documentation. Get Started. Quick introductions based on your background or preference. TS for the New Programmer · TypeScript for JS ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So just checking, a release with the proposed fixes isn’t out yet? Right? If so how can we circumvent this issue while using ng13 and openapi generator?
Isn’t the fix simply to use the options.body property instead (as suggested in #11172 )?
I’m actually in need of a body for DELETE.