mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 14:16:11 +00:00
Add tests for query parameters (array of integer/string) (#17686)
* add tests for query parameters in python client * update other samples * update samples
This commit is contained in:
@@ -289,6 +289,56 @@ paths:
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_form/explode_false/array_integer:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
operationId: test/query/style_form/explode_false/array_integer
|
||||
parameters:
|
||||
- explode: false
|
||||
in: query
|
||||
name: query_object
|
||||
required: false
|
||||
schema:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test query parameter(s)
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_form/explode_false/array_string:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
operationId: test/query/style_form/explode_false/array_string
|
||||
parameters:
|
||||
- explode: false
|
||||
in: query
|
||||
name: query_object
|
||||
required: false
|
||||
schema:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Successful operation
|
||||
summary: Test query parameter(s)
|
||||
tags:
|
||||
- query
|
||||
x-accepts: text/plain
|
||||
/query/style_form/explode_true/object:
|
||||
get:
|
||||
description: Test query parameter(s)
|
||||
|
||||
@@ -447,6 +447,160 @@ public interface QueryApi extends ApiClient.Api {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_false/array_integer?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryStyleFormExplodeFalseArrayInteger(@Param("queryObject") List<Integer> queryObject);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Similar to <code>testQueryStyleFormExplodeFalseArrayInteger</code> but it also returns the http response headers .
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_false/array_integer?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(@Param("queryObject") List<Integer> queryObject);
|
||||
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryStyleFormExplodeFalseArrayInteger</code> method,
|
||||
* but with the query parameters collected into a single Map parameter. This
|
||||
* is convenient for services with optional query parameters, especially when
|
||||
* used with the {@link TestQueryStyleFormExplodeFalseArrayIntegerQueryParams} class that allows for
|
||||
* building up this map in a fluent style.
|
||||
* @param queryParams Map of query parameters as name-value pairs
|
||||
* <p>The following elements may be specified in the query map:</p>
|
||||
* <ul>
|
||||
* <li>queryObject - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_false/array_integer?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryStyleFormExplodeFalseArrayInteger(@QueryMap(encoded=true) TestQueryStyleFormExplodeFalseArrayIntegerQueryParams queryParams);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryStyleFormExplodeFalseArrayInteger</code> that receives the query parameters as a map,
|
||||
* but this one also exposes the Http response headers
|
||||
* @param queryParams Map of query parameters as name-value pairs
|
||||
* <p>The following elements may be specified in the query map:</p>
|
||||
* <ul>
|
||||
* <li>queryObject - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_false/array_integer?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(@QueryMap(encoded=true) TestQueryStyleFormExplodeFalseArrayIntegerQueryParams queryParams);
|
||||
|
||||
|
||||
/**
|
||||
* A convenience class for generating query parameters for the
|
||||
* <code>testQueryStyleFormExplodeFalseArrayInteger</code> method in a fluent style.
|
||||
*/
|
||||
public static class TestQueryStyleFormExplodeFalseArrayIntegerQueryParams extends HashMap<String, Object> {
|
||||
public TestQueryStyleFormExplodeFalseArrayIntegerQueryParams queryObject(final List<Integer> value) {
|
||||
put("query_object", EncodingUtils.encodeCollection(value, "csv"));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_false/array_string?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryStyleFormExplodeFalseArrayString(@Param("queryObject") List<String> queryObject);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Similar to <code>testQueryStyleFormExplodeFalseArrayString</code> but it also returns the http response headers .
|
||||
* Test query parameter(s)
|
||||
* @param queryObject (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_false/array_string?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(@Param("queryObject") List<String> queryObject);
|
||||
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryStyleFormExplodeFalseArrayString</code> method,
|
||||
* but with the query parameters collected into a single Map parameter. This
|
||||
* is convenient for services with optional query parameters, especially when
|
||||
* used with the {@link TestQueryStyleFormExplodeFalseArrayStringQueryParams} class that allows for
|
||||
* building up this map in a fluent style.
|
||||
* @param queryParams Map of query parameters as name-value pairs
|
||||
* <p>The following elements may be specified in the query map:</p>
|
||||
* <ul>
|
||||
* <li>queryObject - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_false/array_string?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryStyleFormExplodeFalseArrayString(@QueryMap(encoded=true) TestQueryStyleFormExplodeFalseArrayStringQueryParams queryParams);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryStyleFormExplodeFalseArrayString</code> that receives the query parameters as a map,
|
||||
* but this one also exposes the Http response headers
|
||||
* @param queryParams Map of query parameters as name-value pairs
|
||||
* <p>The following elements may be specified in the query map:</p>
|
||||
* <ul>
|
||||
* <li>queryObject - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_form/explode_false/array_string?query_object={queryObject}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(@QueryMap(encoded=true) TestQueryStyleFormExplodeFalseArrayStringQueryParams queryParams);
|
||||
|
||||
|
||||
/**
|
||||
* A convenience class for generating query parameters for the
|
||||
* <code>testQueryStyleFormExplodeFalseArrayString</code> method in a fluent style.
|
||||
*/
|
||||
public static class TestQueryStyleFormExplodeFalseArrayStringQueryParams extends HashMap<String, Object> {
|
||||
public TestQueryStyleFormExplodeFalseArrayStringQueryParams queryObject(final List<String> value) {
|
||||
put("query_object", EncodingUtils.encodeCollection(value, "csv"));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
|
||||
Reference in New Issue
Block a user