Properly handle mappings and import mappings after processOpts (#16216)

* make Java imports overridable

* fix for other dateLibraries

* complete core fix

* adapt test - step 1/2

* add unit test

* adapt test - step 2/2

* remove accidentally added file

* final small clean-up
This commit is contained in:
martin-mfg
2023-08-30 07:48:51 +02:00
committed by GitHub
parent 35f5852cc0
commit 20692aa891
9 changed files with 66 additions and 14 deletions

View File

@@ -19,7 +19,7 @@ import org.openapitools.client.Pair;
import org.openapitools.client.model.DataQuery;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.Instant;
import org.openapitools.client.model.Pet;
import org.openapitools.client.model.StringEnumRef;
import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter;
@@ -192,7 +192,7 @@ public class QueryApi {
* @return String
* @throws ApiException if fails to make API call
*/
public String testQueryDatetimeDateString(OffsetDateTime datetimeQuery, LocalDate dateQuery, String stringQuery) throws ApiException {
public String testQueryDatetimeDateString(Instant datetimeQuery, LocalDate dateQuery, String stringQuery) throws ApiException {
ApiResponse<String> localVarResponse = testQueryDatetimeDateStringWithHttpInfo(datetimeQuery, dateQuery, stringQuery);
return localVarResponse.getData();
}
@@ -206,7 +206,7 @@ public class QueryApi {
* @return ApiResponse&lt;String&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<String> testQueryDatetimeDateStringWithHttpInfo(OffsetDateTime datetimeQuery, LocalDate dateQuery, String stringQuery) throws ApiException {
public ApiResponse<String> testQueryDatetimeDateStringWithHttpInfo(Instant datetimeQuery, LocalDate dateQuery, String stringQuery) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = testQueryDatetimeDateStringRequestBuilder(datetimeQuery, dateQuery, stringQuery);
try {
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
@@ -243,7 +243,7 @@ public class QueryApi {
}
}
private HttpRequest.Builder testQueryDatetimeDateStringRequestBuilder(OffsetDateTime datetimeQuery, LocalDate dateQuery, String stringQuery) throws ApiException {
private HttpRequest.Builder testQueryDatetimeDateStringRequestBuilder(Instant datetimeQuery, LocalDate dateQuery, String stringQuery) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();

View File

@@ -24,7 +24,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.time.OffsetDateTime;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -49,7 +49,7 @@ public class DataQuery extends Query {
private String text;
public static final String JSON_PROPERTY_DATE = "date";
private OffsetDateTime date;
private Instant date;
public DataQuery() {
}
@@ -104,7 +104,7 @@ public class DataQuery extends Query {
}
public DataQuery date(OffsetDateTime date) {
public DataQuery date(Instant date) {
this.date = date;
return this;
}
@@ -117,14 +117,14 @@ public class DataQuery extends Query {
@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public OffsetDateTime getDate() {
public Instant getDate() {
return date;
}
@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDate(OffsetDateTime date) {
public void setDate(Instant date) {
this.date = date;
}