Skip to content

Commit

Permalink
[JAVA] Address [rawtypes] and [this-escape] warnings in generated API…
Browse files Browse the repository at this point in the history
… clients (#20466)

* Address [rawtypes] and [this-escape] warnings in generated API clients

* Commit updated sample files
  • Loading branch information
welandaz authored Jan 18, 2025
1 parent 98ccf95 commit fa3e38a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
* @param value The value of the parameter.
* @return A list of {@code Pair} objects.
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection value) {
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection<?> value) {
List<Pair> params = new ArrayList<Pair>();
// preconditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public class ApiClient {
asyncResponseInterceptor = null;
}

protected ObjectMapper createDefaultObjectMapper() {
public static ObjectMapper createDefaultObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Expand All @@ -199,11 +199,11 @@ public class ApiClient {
return mapper;
}

protected String getDefaultBaseUri() {
private String getDefaultBaseUri() {
return "{{{basePath}}}";
}

protected HttpClient.Builder createDefaultHttpClientBuilder() {
public static HttpClient.Builder createDefaultHttpClientBuilder() {
return HttpClient.newBuilder();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ public List<Pair> parameterToPair(String name, Object value) {
* @param value The value of the parameter.
* @return A list of {@code Pair} objects.
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection value) {
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection<?> value) {
List<Pair> params = new ArrayList<Pair>();

// preconditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri
asyncResponseInterceptor = null;
}

protected ObjectMapper createDefaultObjectMapper() {
public static ObjectMapper createDefaultObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Expand All @@ -206,11 +206,11 @@ protected ObjectMapper createDefaultObjectMapper() {
return mapper;
}

protected String getDefaultBaseUri() {
private String getDefaultBaseUri() {
return "http://localhost:3000";
}

protected HttpClient.Builder createDefaultHttpClientBuilder() {
public static HttpClient.Builder createDefaultHttpClientBuilder() {
return HttpClient.newBuilder();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ public List<Pair> parameterToPair(String name, Object value) {
* @param value The value of the parameter.
* @return A list of {@code Pair} objects.
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection value) {
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection<?> value) {
List<Pair> params = new ArrayList<Pair>();

// preconditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri
asyncResponseInterceptor = null;
}

protected ObjectMapper createDefaultObjectMapper() {
public static ObjectMapper createDefaultObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Expand All @@ -206,11 +206,11 @@ protected ObjectMapper createDefaultObjectMapper() {
return mapper;
}

protected String getDefaultBaseUri() {
private String getDefaultBaseUri() {
return "http://petstore.swagger.io:80/v2";
}

protected HttpClient.Builder createDefaultHttpClientBuilder() {
public static HttpClient.Builder createDefaultHttpClientBuilder() {
return HttpClient.newBuilder();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri
asyncResponseInterceptor = null;
}

protected ObjectMapper createDefaultObjectMapper() {
public static ObjectMapper createDefaultObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Expand All @@ -206,11 +206,11 @@ protected ObjectMapper createDefaultObjectMapper() {
return mapper;
}

protected String getDefaultBaseUri() {
private String getDefaultBaseUri() {
return "http://petstore.swagger.io/v2";
}

protected HttpClient.Builder createDefaultHttpClientBuilder() {
public static HttpClient.Builder createDefaultHttpClientBuilder() {
return HttpClient.newBuilder();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri
asyncResponseInterceptor = null;
}

protected ObjectMapper createDefaultObjectMapper() {
public static ObjectMapper createDefaultObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Expand All @@ -206,11 +206,11 @@ protected ObjectMapper createDefaultObjectMapper() {
return mapper;
}

protected String getDefaultBaseUri() {
private String getDefaultBaseUri() {
return "http://petstore.swagger.io:80/v2";
}

protected HttpClient.Builder createDefaultHttpClientBuilder() {
public static HttpClient.Builder createDefaultHttpClientBuilder() {
return HttpClient.newBuilder();
}

Expand Down

0 comments on commit fa3e38a

Please sign in to comment.