mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-20 00:17:05 +00:00
Codegen parameter for query json serialization (#21718)
* Add endpoints with query parameters that require Json-serialization * Add property for query json-serialization * Update samples * Adjust indentation for specification
This commit is contained in:
committed by
GitHub
parent
6ff9e67bad
commit
8874df4702
@@ -831,4 +831,89 @@ public interface QueryApi extends ApiClient.Api {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param jsonSerializedObjectRefStringQuery (optional)
|
||||
* @param jsonSerializedObjectArrayRefStringQuery (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_jsonSerialization/object?json_serialized_object_ref_string_query={jsonSerializedObjectRefStringQuery}&json_serialized_object_array_ref_string_query={jsonSerializedObjectArrayRefStringQuery}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryStyleJsonSerializationObject(@Param("jsonSerializedObjectRefStringQuery") @javax.annotation.Nullable Pet jsonSerializedObjectRefStringQuery, @Param("jsonSerializedObjectArrayRefStringQuery") @javax.annotation.Nullable List<Pet> jsonSerializedObjectArrayRefStringQuery);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Similar to <code>testQueryStyleJsonSerializationObject</code> but it also returns the http response headers .
|
||||
* Test query parameter(s)
|
||||
* @param jsonSerializedObjectRefStringQuery (optional)
|
||||
* @param jsonSerializedObjectArrayRefStringQuery (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("GET /query/style_jsonSerialization/object?json_serialized_object_ref_string_query={jsonSerializedObjectRefStringQuery}&json_serialized_object_array_ref_string_query={jsonSerializedObjectArrayRefStringQuery}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryStyleJsonSerializationObjectWithHttpInfo(@Param("jsonSerializedObjectRefStringQuery") @javax.annotation.Nullable Pet jsonSerializedObjectRefStringQuery, @Param("jsonSerializedObjectArrayRefStringQuery") @javax.annotation.Nullable List<Pet> jsonSerializedObjectArrayRefStringQuery);
|
||||
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryStyleJsonSerializationObject</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 TestQueryStyleJsonSerializationObjectQueryParams} 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>jsonSerializedObjectRefStringQuery - (optional)</li>
|
||||
* <li>jsonSerializedObjectArrayRefStringQuery - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_jsonSerialization/object?json_serialized_object_ref_string_query={jsonSerializedObjectRefStringQuery}&json_serialized_object_array_ref_string_query={jsonSerializedObjectArrayRefStringQuery}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryStyleJsonSerializationObject(@QueryMap(encoded=true) TestQueryStyleJsonSerializationObjectQueryParams queryParams);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryStyleJsonSerializationObject</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>jsonSerializedObjectRefStringQuery - (optional)</li>
|
||||
* <li>jsonSerializedObjectArrayRefStringQuery - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/style_jsonSerialization/object?json_serialized_object_ref_string_query={jsonSerializedObjectRefStringQuery}&json_serialized_object_array_ref_string_query={jsonSerializedObjectArrayRefStringQuery}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryStyleJsonSerializationObjectWithHttpInfo(@QueryMap(encoded=true) TestQueryStyleJsonSerializationObjectQueryParams queryParams);
|
||||
|
||||
|
||||
/**
|
||||
* A convenience class for generating query parameters for the
|
||||
* <code>testQueryStyleJsonSerializationObject</code> method in a fluent style.
|
||||
*/
|
||||
public static class TestQueryStyleJsonSerializationObjectQueryParams extends HashMap<String, Object> {
|
||||
public TestQueryStyleJsonSerializationObjectQueryParams jsonSerializedObjectRefStringQuery(@javax.annotation.Nullable final Pet value) {
|
||||
put("json_serialized_object_ref_string_query", EncodingUtils.encode(value));
|
||||
return this;
|
||||
}
|
||||
public TestQueryStyleJsonSerializationObjectQueryParams jsonSerializedObjectArrayRefStringQuery(@javax.annotation.Nullable final List<Pet> value) {
|
||||
put("json_serialized_object_array_ref_string_query", EncodingUtils.encodeCollection(value, "csv"));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user