-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix(java): use Map for query parameters #484
Conversation
✅ Deploy Preview for api-clients-automation canceled.
|
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
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.
@millotp those 3 methods are not used anymore now, I wasn't sure if I should remove them so they are still here for now
headerParams.put("Accept", "application/json"); | ||
headerParams.put("Content-Type", "application/json"); |
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.
Those were in every methods so I've moved them here
// ensuring a default content type | ||
if (contentType == null) { | ||
contentType = "application/json"; | ||
} |
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.
Since we set it right above, it can't be null
@@ -149,6 +149,7 @@ export function create{{capitalizedApiName}}(options: CreateClientOptions{{#hasR | |||
{{/queryParams.0}} | |||
{{/bodyParams.0}} | |||
{{/allParams.0}} | |||
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. |
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.
This was missing in the JS client
7e4f3b2
to
a0b6c74
Compare
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.
Cool ! Looks perfect, you can definitely remove the unused methods in ApiClient.java
and the Pair.java
file (either with the custom generator or with openapi-generator-ignore
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.
Was the use of Pairs a choice from us or was it by default in the Java template ?
(I trust your judgment for this change since I didn't even know about this type in Java)
IIRC yes it was like this in the base template, we've iterate on that but after discussing with Pierre we thought it made more sense to make it match today's type |
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.
Love it !
🧭 What and Why
🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-471
Changes included:
While implementing the
requestOptions
for Java, I've found that the type of the Query Params were different than the current clients.This PR updates the type of the query params and their related utils/methods/tests.
Also in this PR:
requestOption
JSDoc description for the JS client to the template🧪 Test
CI :D