update Java jersey 1,2 to handle */*

This commit is contained in:
wing328 2017-07-31 13:26:56 +08:00
parent 182807ed9a
commit fab49e80a8
11 changed files with 24 additions and 11 deletions

View File

@ -488,7 +488,7 @@ public class ApiClient {
*/
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json"));
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
/**

View File

@ -16,9 +16,19 @@ To test class name in snake case
### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.FakeClassnameTags123Api;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key_query
ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
api_key_query.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key_query.setApiKeyPrefix("Token");
FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api();
Client body = new Client(); // Client | client model
@ -43,7 +53,7 @@ Name | Type | Description | Notes
### Authorization
No authorization required
[api_key_query](../README.md#api_key_query)
### HTTP request headers

View File

@ -95,6 +95,7 @@ public class ApiClient {
// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
authentications.put("http_basic_test", new HttpBasicAuth());
authentications.put("petstore_auth", new OAuth());
// Prevent the authentications from being modified.
@ -481,7 +482,7 @@ public class ApiClient {
*/
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json"));
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
/**

View File

@ -85,7 +85,7 @@ public class FakeClassnameTags123Api {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
String[] localVarAuthNames = new String[] { "api_key_query" };
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);

View File

@ -247,7 +247,7 @@
</dependencies>
<properties>
<swagger-core-version>1.5.15</swagger-core-version>
<jersey-version>2.25.1</jersey-version>
<jersey-version>2.6</jersey-version>
<commons_io_version>2.5</commons_io_version>
<commons_lang3_version>3.6</commons_lang3_version>
<jackson-version>2.6.4</jackson-version>

View File

@ -434,12 +434,13 @@ public class ApiClient {
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* "* / *" is also default to JSON
* @param mime MIME
* @return True if the MIME type is JSON
*/
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json"));
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
/**

View File

@ -39,7 +39,7 @@ public class Cat extends Animal {
* @return declawed
**/
@ApiModelProperty(value = "")
public Boolean getDeclawed() {
public Boolean isDeclawed() {
return declawed;
}

View File

@ -181,7 +181,7 @@ public class Order {
* @return complete
**/
@ApiModelProperty(value = "")
public Boolean getComplete() {
public Boolean isComplete() {
return complete;
}

View File

@ -435,12 +435,13 @@ public class ApiClient {
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* "* / *" is also default to JSON
* @param mime MIME
* @return True if the MIME type is JSON
*/
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equalsIgnoreCase("application/json-patch+json"));
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
/**

View File

@ -39,7 +39,7 @@ public class Cat extends Animal {
* @return declawed
**/
@ApiModelProperty(value = "")
public Boolean getDeclawed() {
public Boolean isDeclawed() {
return declawed;
}

View File

@ -181,7 +181,7 @@ public class Order {
* @return complete
**/
@ApiModelProperty(value = "")
public Boolean getComplete() {
public Boolean isComplete() {
return complete;
}