forked from loafle/openapi-generator-original
[JAVA] use query parameter apikey if present (#19334)
* Fix #16362 * Update samples * Undo formatting changes * Revert whitespace changes in samples * make it work --------- Co-authored-by: Jason Boileau <jason@boileau.dk> Co-authored-by: Jason Boileau <spraot@users.noreply.github.com>
This commit is contained in:
@@ -1267,10 +1267,6 @@ public class ApiClient {
|
||||
* @throws org.openapitools.client.ApiException If fail to serialize the request body object
|
||||
*/
|
||||
public Request buildRequest(String baseUrl, String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, ApiCallback callback) throws ApiException {
|
||||
// aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams
|
||||
List<Pair> allQueryParams = new ArrayList<Pair>(queryParams);
|
||||
allQueryParams.addAll(collectionQueryParams);
|
||||
|
||||
final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams);
|
||||
|
||||
// prepare HTTP request body
|
||||
@@ -1298,10 +1294,12 @@ public class ApiClient {
|
||||
reqBody = serialize(body, contentType);
|
||||
}
|
||||
|
||||
// update parameters with authentication settings
|
||||
updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url));
|
||||
List<Pair> updatedQueryParams = new ArrayList<>(queryParams);
|
||||
|
||||
final Request.Builder reqBuilder = new Request.Builder().url(url);
|
||||
// update parameters with authentication settings
|
||||
updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url));
|
||||
|
||||
final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams));
|
||||
processHeaderParams(headerParams, reqBuilder);
|
||||
processCookieParams(cookieParams, reqBuilder);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user