mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 16:26:10 +00:00
[python-nextgen] better datetime support in parameters (#14621)
* add allowStringInDateTimeParameters option * add tests * add files * add tests for datetime query parameters * fix file anme * trigger build * fix pytest * install test requirement * trigger build * break build * add new files * fix Locale.ROOT * update doc
This commit is contained in:
@@ -5,6 +5,8 @@ import org.openapitools.client.EncodingUtils;
|
||||
import org.openapitools.client.model.ApiResponse;
|
||||
|
||||
import org.openapitools.client.model.DataQuery;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter;
|
||||
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
|
||||
@@ -19,6 +21,99 @@ import feign.*;
|
||||
public interface QueryApi extends ApiClient.Api {
|
||||
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* @param datetimeQuery (optional)
|
||||
* @param dateQuery (optional)
|
||||
* @param stringQuery (optional)
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/datetime/date/string?datetime_query={datetimeQuery}&date_query={dateQuery}&string_query={stringQuery}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryDatetimeDateString(@Param("datetimeQuery") OffsetDateTime datetimeQuery, @Param("dateQuery") LocalDate dateQuery, @Param("stringQuery") String stringQuery);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Similar to <code>testQueryDatetimeDateString</code> but it also returns the http response headers .
|
||||
* Test query parameter(s)
|
||||
* @param datetimeQuery (optional)
|
||||
* @param dateQuery (optional)
|
||||
* @param stringQuery (optional)
|
||||
* @return A ApiResponse that wraps the response boyd and the http headers.
|
||||
*/
|
||||
@RequestLine("GET /query/datetime/date/string?datetime_query={datetimeQuery}&date_query={dateQuery}&string_query={stringQuery}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryDatetimeDateStringWithHttpInfo(@Param("datetimeQuery") OffsetDateTime datetimeQuery, @Param("dateQuery") LocalDate dateQuery, @Param("stringQuery") String stringQuery);
|
||||
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryDatetimeDateString</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 TestQueryDatetimeDateStringQueryParams} 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>datetimeQuery - (optional)</li>
|
||||
* <li>dateQuery - (optional)</li>
|
||||
* <li>stringQuery - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/datetime/date/string?datetime_query={datetimeQuery}&date_query={dateQuery}&string_query={stringQuery}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryDatetimeDateString(@QueryMap(encoded=true) TestQueryDatetimeDateStringQueryParams queryParams);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
* Note, this is equivalent to the other <code>testQueryDatetimeDateString</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>datetimeQuery - (optional)</li>
|
||||
* <li>dateQuery - (optional)</li>
|
||||
* <li>stringQuery - (optional)</li>
|
||||
* </ul>
|
||||
* @return String
|
||||
*/
|
||||
@RequestLine("GET /query/datetime/date/string?datetime_query={datetimeQuery}&date_query={dateQuery}&string_query={stringQuery}")
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryDatetimeDateStringWithHttpInfo(@QueryMap(encoded=true) TestQueryDatetimeDateStringQueryParams queryParams);
|
||||
|
||||
|
||||
/**
|
||||
* A convenience class for generating query parameters for the
|
||||
* <code>testQueryDatetimeDateString</code> method in a fluent style.
|
||||
*/
|
||||
public static class TestQueryDatetimeDateStringQueryParams extends HashMap<String, Object> {
|
||||
public TestQueryDatetimeDateStringQueryParams datetimeQuery(final OffsetDateTime value) {
|
||||
put("datetime_query", EncodingUtils.encode(value));
|
||||
return this;
|
||||
}
|
||||
public TestQueryDatetimeDateStringQueryParams dateQuery(final LocalDate value) {
|
||||
put("date_query", EncodingUtils.encode(value));
|
||||
return this;
|
||||
}
|
||||
public TestQueryDatetimeDateStringQueryParams stringQuery(final String value) {
|
||||
put("string_query", EncodingUtils.encode(value));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
* Test query parameter(s)
|
||||
|
||||
Reference in New Issue
Block a user