forked from loafle/openapi-generator-original
update Java jersey 1,2 to handle */*
This commit is contained in:
parent
182807ed9a
commit
fab49e80a8
@ -488,7 +488,7 @@ public class ApiClient {
|
|||||||
*/
|
*/
|
||||||
public boolean isJsonMime(String mime) {
|
public boolean isJsonMime(String mime) {
|
||||||
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
|
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("*/*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,9 +16,19 @@ To test class name in snake case
|
|||||||
### Example
|
### Example
|
||||||
```java
|
```java
|
||||||
// Import classes:
|
// Import classes:
|
||||||
|
//import io.swagger.client.ApiClient;
|
||||||
//import io.swagger.client.ApiException;
|
//import io.swagger.client.ApiException;
|
||||||
|
//import io.swagger.client.Configuration;
|
||||||
|
//import io.swagger.client.auth.*;
|
||||||
//import io.swagger.client.api.FakeClassnameTags123Api;
|
//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();
|
FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api();
|
||||||
Client body = new Client(); // Client | client model
|
Client body = new Client(); // Client | client model
|
||||||
@ -43,7 +53,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
No authorization required
|
[api_key_query](../README.md#api_key_query)
|
||||||
|
|
||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ public class ApiClient {
|
|||||||
// Setup authentications (key: authentication name, value: authentication).
|
// Setup authentications (key: authentication name, value: authentication).
|
||||||
authentications = new HashMap<String, Authentication>();
|
authentications = new HashMap<String, Authentication>();
|
||||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
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("http_basic_test", new HttpBasicAuth());
|
||||||
authentications.put("petstore_auth", new OAuth());
|
authentications.put("petstore_auth", new OAuth());
|
||||||
// Prevent the authentications from being modified.
|
// Prevent the authentications from being modified.
|
||||||
@ -481,7 +482,7 @@ public class ApiClient {
|
|||||||
*/
|
*/
|
||||||
public boolean isJsonMime(String mime) {
|
public boolean isJsonMime(String mime) {
|
||||||
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
|
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("*/*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,7 +85,7 @@ public class FakeClassnameTags123Api {
|
|||||||
};
|
};
|
||||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||||
|
|
||||||
String[] localVarAuthNames = new String[] { };
|
String[] localVarAuthNames = new String[] { "api_key_query" };
|
||||||
|
|
||||||
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
|
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
|
||||||
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||||
|
@ -247,7 +247,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<swagger-core-version>1.5.15</swagger-core-version>
|
<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_io_version>2.5</commons_io_version>
|
||||||
<commons_lang3_version>3.6</commons_lang3_version>
|
<commons_lang3_version>3.6</commons_lang3_version>
|
||||||
<jackson-version>2.6.4</jackson-version>
|
<jackson-version>2.6.4</jackson-version>
|
||||||
|
@ -434,12 +434,13 @@ public class ApiClient {
|
|||||||
* application/json; charset=UTF8
|
* application/json; charset=UTF8
|
||||||
* APPLICATION/JSON
|
* APPLICATION/JSON
|
||||||
* application/vnd.company+json
|
* application/vnd.company+json
|
||||||
|
* "* / *" is also default to JSON
|
||||||
* @param mime MIME
|
* @param mime MIME
|
||||||
* @return True if the MIME type is JSON
|
* @return True if the MIME type is JSON
|
||||||
*/
|
*/
|
||||||
public boolean isJsonMime(String mime) {
|
public boolean isJsonMime(String mime) {
|
||||||
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
|
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("*/*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +39,7 @@ public class Cat extends Animal {
|
|||||||
* @return declawed
|
* @return declawed
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
public Boolean getDeclawed() {
|
public Boolean isDeclawed() {
|
||||||
return declawed;
|
return declawed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ public class Order {
|
|||||||
* @return complete
|
* @return complete
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
public Boolean getComplete() {
|
public Boolean isComplete() {
|
||||||
return complete;
|
return complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,12 +435,13 @@ public class ApiClient {
|
|||||||
* application/json; charset=UTF8
|
* application/json; charset=UTF8
|
||||||
* APPLICATION/JSON
|
* APPLICATION/JSON
|
||||||
* application/vnd.company+json
|
* application/vnd.company+json
|
||||||
|
* "* / *" is also default to JSON
|
||||||
* @param mime MIME
|
* @param mime MIME
|
||||||
* @return True if the MIME type is JSON
|
* @return True if the MIME type is JSON
|
||||||
*/
|
*/
|
||||||
public boolean isJsonMime(String mime) {
|
public boolean isJsonMime(String mime) {
|
||||||
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
|
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("*/*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +39,7 @@ public class Cat extends Animal {
|
|||||||
* @return declawed
|
* @return declawed
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
public Boolean getDeclawed() {
|
public Boolean isDeclawed() {
|
||||||
return declawed;
|
return declawed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ public class Order {
|
|||||||
* @return complete
|
* @return complete
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
public Boolean getComplete() {
|
public Boolean isComplete() {
|
||||||
return complete;
|
return complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user