Revert supports for delete body in typescript-angular client#10976
Revert supports for delete body in typescript-angular client#10976macjohnny merged 4 commits intoOpenAPITools:masterfrom
Conversation
|
@topce see also discussion in the issue |
amakhrov
left a comment
There was a problem hiding this comment.
Instead of reverting - can we actually fix the generated code?
Perhaps it can be as simple as using lower level httpClient.request, instead of trying to adjust to inconsistent http client interface (I realize that inconsistency has a very good reason, though - the angular team didn't want to break all existing apps by making a backword incompatible change in .delete method :) )
|
We can. But I think we first need the spec to account for this (i couldn't generate any client when specifying a delete body because it produced an incorrect spec). |
|
Any updates on when this will be fixed? |
|
hit same issue, was working okay on 5.3.0 - looking for how to revert Angular CLI: 12.1.4 have exact issue as - #10864 so ran this command to go back to previous @openapitools/openapi-generator-cli from 2.4.23 to 2.4.13 then re-run the code gen but it still uses version in .openapi/generator/VERSION = 5.3.1 looking to just download the jar file and run the java without @openapitools/openapi-generator-cli as a work-around? so i made this - hope it helps while the patch/spec/issues are resolved. |
amakhrov
left a comment
There was a problem hiding this comment.
As it stands now, this is broken dead code.
Agree.
Sounds like reverting it is the minimal-effort approach to make the generator code compile again.
And after that we can consider properly supporting DELETE body (if someone is up to filing a corresponding PR).
@cghislai looks like there are some merge conflicts in this branch - would you be able to resolve those?
|
I'm facing the same issue with 5.3.x and 5.2.x. Do we know that the latest working version is? |
5.1.0 seems to be working properly |
|
@amakhrov rebased, conflict resolved. |
|
Hello guys, I'm not quite sure about the "requestBody" problem. My specification: and I'm still getting: error TS2554: Expected 1-2 arguments, but got 3. |
|
@macjohnny can we merge this? |
|
Hello guys, thanks. |
|
@gong4soft looks like the next upcoming release is 6.0.0: But zou can already use it by installing the 6.0.0-SNAPSHOT version |
|
@macjohnny is there a way to use it when you use the |
|
@mgol I don‘t think the npm package supports snapshot versions, but it would be a great contribution if you implemented that |
|
@mgol You can set {
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.0.0-20220330.230127-109",
"repository": {
"downloadUrl": "https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/openapi-generator-cli-${versionName}.jar"
}
}
} |
|
@KrickRay Thanks, that's very useful! Although, currently, all that's enough to resolve this issue is to set |
|
I'm thinking about filing a PR for this issue since I need to generate Why not always rely on the |
|
@angelaki I am not aware of anybody actively working on this, but #10976 (review) sums it up. |
|
@macjohnny so there's probably nothing wrong with relying totally on |
|
Would using |
|
@maxs-rose Nope, actually all the HttpClient methods are just overloads for the request-method, e.g. https://github.com/angular/angular/blob/main/packages/common/http/src/client.ts#L2565. Is someone knowing the OpenAPICodeGen code able & willing to quickly fix this? I've never contributed to this project and imho it seams pretty easy if you just know what & where to do. |
|
Interesting. I believe you would want to end it the templates it uses to generate the angular code I know I have made a few edits to one of them, a long time ago, then you can tell the generator to use your edited templates. Unfortunately I can't remember how you actually tell the generator to use the custom templates. |
|
@maxs-rose wow, this looks pretty cryptic to me ... I was hoping that I'd just need to replace some post / put / ... by the corresponding request-method. I haven't event found the HttpClient calls... |
|
Yea it's a bit wild, thankfully when I did have to make a change for work it was something obvious. I believe the |
|
Oh wow. Now I know why noone is willing / able to make this small fix. I still don't get why |
|
Its probably better to move this into its own issue/discussion |
Fixes #10975
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(5.3.0),6.0.x