-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQ][typescript-angular]: support for object as query parameters #4407
[REQ][typescript-angular]: support for object as query parameters #4407
Conversation
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
Thanks for your PR |
modules/openapi-generator/src/main/resources/typescript-angular/encoder.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache
Show resolved
Hide resolved
BTW, travis dies with 'A tuple type element list cannot be empty' but my local build with maven has not reported a problem. I'm not sure how to reproduce the error locally. |
9df82cf
to
da8c203
Compare
I have updated and merge-squashed my PR with an appropriate author email. No 'real' changes. |
modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache
Outdated
Show resolved
Hide resolved
da8c203
to
4a96e2d
Compare
@macjohnny: Thank you for accepting my contribution. |
modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache
Show resolved
Hide resolved
please merge the current master into your branch and update the samples again |
Introduced a typo before I run out of time yesterday. All fixed now. |
"version": "1.0.0", | ||
"description": "OpenAPI client for @openapitools/typescript-angular-petstore", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Not done on purpose. Sorry!
@aanno2 can you please merge the current master and update the samples? |
@aanno2 Thanks for this pull request. Just run into the issue myself. All set for next release? |
Would love for this to get merged soon... 🙏 😉 |
@aanno2 please resolve the merge conflicts and merge the latest master into this branch. Let me know if you need help on this. |
…/builds/with-npm/package.json
…ot/builds/with-npm/tsconfig.json
7102035
to
e461319
Compare
@wing328: As requested, I have rebased the PR onto the current master branch. |
@aanno2 can you please fix the build error:
|
private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { | ||
if (typeof value === "object") { | ||
if (Array.isArray(value)) { | ||
(value as []).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(value as []).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); | |
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for helping out. I just applied your suggestion.
please re-generate the samples |
@macjohnny. Has this been released in a version yet? I was legit looking into fixing this but found this or and am super happy haha |
Yes, it is in the latest version. |
looks like this was merged to 4.3.0, but the latest available on npm is 4.2.3 https://www.npmjs.com/package/@openapitools/openapi-generator-cli. Is there a way I can use the fix ? |
Are you sure? I thought that the milestone on the right was an at-a-glance indicator and it says 4.2.3. Also, if I recall correctly then I've used this feature from the current npm version. Where are you seeing 4.3.0? |
I clicked on this link #5174 that daniel-frank posted a few comments back and it mentioned 4.3. I am currently using 4.2.3 I have the Pagination object in my Java code as a query param and this is the TS I get
Maybe I'm missing something This is the command I'm running
Thanks for the help |
I think it would be best to open a new issue to query this and include your 'openapi.json'. Hopefully, someone can point out the issue. |
fixes #4404
@macjohnny: Thank you for review
I've updated the PR and hope it will be more in-line with what is expected.
PR checklist
@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @nicokoenig @topce @akehir
issue by @aanno2