fix inconsistent java naming (#6624)

This commit is contained in:
wing328
2017-10-06 11:03:15 +08:00
committed by GitHub
parent 86803c0c24
commit 2f98ade693
29 changed files with 1877 additions and 0 deletions

View File

@@ -13,6 +13,9 @@ import java.util.regex.Pattern;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Strings;
import io.swagger.codegen.CliOption;
@@ -42,6 +45,7 @@ import io.swagger.models.properties.StringProperty;
public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig {
static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class);
public static final String FULL_JAVA_UTIL = "fullJavaUtil";
public static final String DEFAULT_LIBRARY = "<default>";
public static final String DATE_LIBRARY = "dateLibrary";
@@ -492,6 +496,19 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return toApiName(name) + "Test";
}
@Override
public String toApiName(String name) {
if (name.length() == 0) {
return "DefaultApi";
}
return camelize(name) + "Api";
}
@Override
public String toApiFilename(String name) {
return toApiName(name);
}
@Override
public String toVarName(String name) {
// sanitize name
@@ -1239,4 +1256,15 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return "is" + getterAndSetterCapitalize(name);
}
@Override
public String sanitizeTag(String tag) {
tag = camelize(underscore(sanitizeName(tag)));
// tag starts with numbers
if (tag.matches("^\\d.*")) {
tag = "Class" + tag;
}
return tag;
}
}

View File

@@ -0,0 +1,30 @@
package io.swagger.client.api;
import io.swagger.client.ApiClient;
import io.swagger.client.EncodingUtils;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import feign.*;
public interface AnotherFakeApi extends ApiClient.Api {
/**
* To test special tags
* To test special tags
* @param body client model (required)
* @return Client
*/
@RequestLine("PATCH /another-fake/dummy")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
Client testSpecialTags(Client body);
}

View File

@@ -0,0 +1,40 @@
package io.swagger.client.api;
import io.swagger.client.ApiClient;
import io.swagger.client.model.Client;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
public class AnotherFakeApiTest {
private AnotherFakeApi api;
@Before
public void setup() {
api = new ApiClient().buildClient(AnotherFakeApi.class);
}
/**
* To test special tags
*
* To test special tags
*/
@Test
public void testSpecialTagsTest() {
Client body = null;
// Client response = api.testSpecialTags(body);
// TODO: test validations
}
}

View File

@@ -0,0 +1,54 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="testSpecialTags"></a>
# **testSpecialTags**
> Client testSpecialTags(body)
To test special tags
To test special tags
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.AnotherFakeApi;
AnotherFakeApi apiInstance = new AnotherFakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testSpecialTags(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,93 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import com.sun.jersey.api.client.GenericType;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.Configuration;
import io.swagger.client.model.*;
import io.swagger.client.Pair;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AnotherFakeApi {
private ApiClient apiClient;
public AnotherFakeApi() {
this(Configuration.getDefaultApiClient());
}
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test special tags
* To test special tags
* @param body client model (required)
* @return Client
* @throws ApiException if fails to make API call
*/
public Client testSpecialTags(Client body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags");
}
// create path and map variables
String localVarPath = "/another-fake/dummy";
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}

View File

@@ -0,0 +1,51 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
@Ignore
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();
/**
* To test special tags
*
* To test special tags
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testSpecialTagsTest() throws ApiException {
Client body = null;
Client response = api.testSpecialTags(body);
// TODO: test validations
}
}

View File

@@ -0,0 +1,54 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="testSpecialTags"></a>
# **testSpecialTags**
> Client testSpecialTags(body)
To test special tags
To test special tags
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.AnotherFakeApi;
AnotherFakeApi apiInstance = new AnotherFakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testSpecialTags(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,78 @@
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AnotherFakeApi {
private ApiClient apiClient;
public AnotherFakeApi() {
this(Configuration.getDefaultApiClient());
}
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test special tags
* To test special tags
* @param body client model (required)
* @return Client
* @throws ApiException if fails to make API call
*/
public Client testSpecialTags(Client body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags");
}
// create path and map variables
String localVarPath = "/another-fake/dummy";
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}

View File

@@ -0,0 +1,51 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
@Ignore
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();
/**
* To test special tags
*
* To test special tags
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testSpecialTagsTest() throws ApiException {
Client body = null;
Client response = api.testSpecialTags(body);
// TODO: test validations
}
}

View File

@@ -0,0 +1,54 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="testSpecialTags"></a>
# **testSpecialTags**
> Client testSpecialTags(body)
To test special tags
To test special tags
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.AnotherFakeApi;
AnotherFakeApi apiInstance = new AnotherFakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testSpecialTags(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,78 @@
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AnotherFakeApi {
private ApiClient apiClient;
public AnotherFakeApi() {
this(Configuration.getDefaultApiClient());
}
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test special tags
* To test special tags
* @param body client model (required)
* @return Client
* @throws ApiException if fails to make API call
*/
public Client testSpecialTags(Client body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags");
}
// create path and map variables
String localVarPath = "/another-fake/dummy";
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}

View File

@@ -0,0 +1,51 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
@Ignore
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();
/**
* To test special tags
*
* To test special tags
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testSpecialTagsTest() throws ApiException {
Client body = null;
Client response = api.testSpecialTags(body);
// TODO: test validations
}
}

View File

@@ -0,0 +1,54 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="testSpecialTags"></a>
# **testSpecialTags**
> Client testSpecialTags(body)
To test special tags
To test special tags
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.AnotherFakeApi;
AnotherFakeApi apiInstance = new AnotherFakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testSpecialTags(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,78 @@
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AnotherFakeApi {
private ApiClient apiClient;
public AnotherFakeApi() {
this(Configuration.getDefaultApiClient());
}
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test special tags
* To test special tags
* @param body client model (required)
* @return Client
* @throws ApiException if fails to make API call
*/
public Client testSpecialTags(Client body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags");
}
// create path and map variables
String localVarPath = "/another-fake/dummy";
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType<Client> localVarReturnType = new GenericType<Client>() {};
return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}

View File

@@ -0,0 +1,51 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
@Ignore
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();
/**
* To test special tags
*
* To test special tags
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testSpecialTagsTest() throws ApiException {
Client body = null;
Client response = api.testSpecialTags(body);
// TODO: test validations
}
}

View File

@@ -0,0 +1,54 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="testSpecialTags"></a>
# **testSpecialTags**
> Client testSpecialTags(body)
To test special tags
To test special tags
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.AnotherFakeApi;
AnotherFakeApi apiInstance = new AnotherFakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testSpecialTags(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,183 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.ApiCallback;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.ProgressRequestBody;
import io.swagger.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.swagger.client.model.Client;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AnotherFakeApi {
private ApiClient apiClient;
public AnotherFakeApi() {
this(Configuration.getDefaultApiClient());
}
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for testSpecialTags
* @param body client model (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/another-fake/dummy";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling testSpecialTags(Async)");
}
com.squareup.okhttp.Call call = testSpecialTagsCall(body, progressListener, progressRequestListener);
return call;
}
/**
* To test special tags
* To test special tags
* @param body client model (required)
* @return Client
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Client testSpecialTags(Client body) throws ApiException {
ApiResponse<Client> resp = testSpecialTagsWithHttpInfo(body);
return resp.getData();
}
/**
* To test special tags
* To test special tags
* @param body client model (required)
* @return ApiResponse&lt;Client&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Client> testSpecialTagsWithHttpInfo(Client body) throws ApiException {
com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, null, null);
Type localVarReturnType = new TypeToken<Client>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* To test special tags (asynchronously)
* To test special tags
* @param body client model (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call testSpecialTagsAsync(Client body, final ApiCallback<Client> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Client>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}

View File

@@ -0,0 +1,51 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
@Ignore
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();
/**
* To test special tags
*
* To test special tags
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testSpecialTagsTest() throws ApiException {
Client body = null;
Client response = api.testSpecialTags(body);
// TODO: test validations
}
}

View File

@@ -0,0 +1,54 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="testSpecialTags"></a>
# **testSpecialTags**
> Client testSpecialTags(body)
To test special tags
To test special tags
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.AnotherFakeApi;
AnotherFakeApi apiInstance = new AnotherFakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testSpecialTags(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,183 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.ApiCallback;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import io.swagger.client.ProgressRequestBody;
import io.swagger.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.swagger.client.model.Client;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AnotherFakeApi {
private ApiClient apiClient;
public AnotherFakeApi() {
this(Configuration.getDefaultApiClient());
}
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Build call for testSpecialTags
* @param body client model (required)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public com.squareup.okhttp.Call testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/another-fake/dummy";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
@Override
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}
String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
@SuppressWarnings("rawtypes")
private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling testSpecialTags(Async)");
}
com.squareup.okhttp.Call call = testSpecialTagsCall(body, progressListener, progressRequestListener);
return call;
}
/**
* To test special tags
* To test special tags
* @param body client model (required)
* @return Client
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public Client testSpecialTags(Client body) throws ApiException {
ApiResponse<Client> resp = testSpecialTagsWithHttpInfo(body);
return resp.getData();
}
/**
* To test special tags
* To test special tags
* @param body client model (required)
* @return ApiResponse&lt;Client&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<Client> testSpecialTagsWithHttpInfo(Client body) throws ApiException {
com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, null, null);
Type localVarReturnType = new TypeToken<Client>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}
/**
* To test special tags (asynchronously)
* To test special tags
* @param body client model (required)
* @param callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public com.squareup.okhttp.Call testSpecialTagsAsync(Client body, final ApiCallback<Client> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}
com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<Client>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}

View File

@@ -0,0 +1,51 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
@Ignore
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();
/**
* To test special tags
*
* To test special tags
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testSpecialTagsTest() throws ApiException {
Client body = null;
Client response = api.testSpecialTags(body);
// TODO: test validations
}
}

View File

@@ -0,0 +1,54 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="testSpecialTags"></a>
# **testSpecialTags**
> Client testSpecialTags(body)
To test special tags
To test special tags
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.AnotherFakeApi;
AnotherFakeApi apiInstance = new AnotherFakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testSpecialTags(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,84 @@
package io.swagger.client.api;
import io.swagger.client.ApiClient;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@Component("io.swagger.client.api.AnotherFakeApi")
public class AnotherFakeApi {
private ApiClient apiClient;
public AnotherFakeApi() {
this(new ApiClient());
}
@Autowired
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test special tags
* To test special tags
* <p><b>200</b> - successful operation
* @param body client model
* @return Client
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Client testSpecialTags(Client body) throws RestClientException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testSpecialTags");
}
String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString();
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
final String[] accepts = {
"application/json"
};
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { };
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
}

View File

@@ -0,0 +1,50 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
@Ignore
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();
/**
* To test special tags
*
* To test special tags
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testSpecialTagsTest() {
Client body = null;
Client response = api.testSpecialTags(body);
// TODO: test validations
}
}

View File

@@ -0,0 +1,54 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="testSpecialTags"></a>
# **testSpecialTags**
> Client testSpecialTags(body)
To test special tags
To test special tags
### Example
```java
// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.AnotherFakeApi;
AnotherFakeApi apiInstance = new AnotherFakeApi();
Client body = new Client(); // Client | client model
try {
Client result = apiInstance.testSpecialTags(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@@ -0,0 +1,84 @@
package io.swagger.client.api;
import io.swagger.client.ApiClient;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@Component("io.swagger.client.api.AnotherFakeApi")
public class AnotherFakeApi {
private ApiClient apiClient;
public AnotherFakeApi() {
this(new ApiClient());
}
@Autowired
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* To test special tags
* To test special tags
* <p><b>200</b> - successful operation
* @param body client model
* @return Client
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public Client testSpecialTags(Client body) throws RestClientException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testSpecialTags");
}
String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString();
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
final String[] accepts = {
"application/json"
};
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { };
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
}

View File

@@ -0,0 +1,50 @@
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.api;
import io.swagger.client.model.Client;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
@Ignore
public class AnotherFakeApiTest {
private final AnotherFakeApi api = new AnotherFakeApi();
/**
* To test special tags
*
* To test special tags
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void testSpecialTagsTest() {
Client body = null;
Client response = api.testSpecialTags(body);
// TODO: test validations
}
}

View File

@@ -0,0 +1,41 @@
package io.swagger.client.api;
import io.swagger.client.CollectionFormats.*;
import retrofit.Callback;
import retrofit.http.*;
import retrofit.mime.*;
import io.swagger.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface AnotherFakeApi {
/**
* To test special tags
* Sync method
* To test special tags
* @param body client model (required)
* @return Client
*/
@PATCH("/another-fake/dummy")
Client testSpecialTags(
@retrofit.http.Body Client body
);
/**
* To test special tags
* Async method
* @param body client model (required)
* @param cb callback method
*/
@PATCH("/another-fake/dummy")
void testSpecialTags(
@retrofit.http.Body Client body, Callback<Client> cb
);
}

View File

@@ -0,0 +1,39 @@
package io.swagger.client.api;
import io.swagger.client.ApiClient;
import io.swagger.client.model.Client;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for AnotherFakeApi
*/
public class AnotherFakeApiTest {
private AnotherFakeApi api;
@Before
public void setup() {
api = new ApiClient().createService(AnotherFakeApi.class);
}
/**
* To test special tags
*
* To test special tags
*/
@Test
public void testSpecialTagsTest() {
Client body = null;
// Client response = api.testSpecialTags(body);
// TODO: test validations
}
}