forked from loafle/openapi-generator-original
[Java] Play! framework + retrofit2 client exception converter, bug fixes (#6543)
* added exception converter * underscore removal fix * samples updated * added test * test whitespace
This commit is contained in:
parent
0a9e3782c5
commit
e2916fdc13
@ -3255,7 +3255,13 @@ public class DefaultCodegen {
|
|||||||
p = Pattern.compile("(_)(.)");
|
p = Pattern.compile("(_)(.)");
|
||||||
m = p.matcher(word);
|
m = p.matcher(word);
|
||||||
while (m.find()) {
|
while (m.find()) {
|
||||||
word = m.replaceFirst(m.group(2).toUpperCase());
|
String original = m.group(2);
|
||||||
|
String upperCase = original.toUpperCase();
|
||||||
|
if (original.equals(upperCase)) {
|
||||||
|
word = word.replaceFirst("_", "");
|
||||||
|
} else {
|
||||||
|
word = m.replaceFirst(upperCase);
|
||||||
|
}
|
||||||
m = p.matcher(word);
|
m = p.matcher(word);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,12 +9,23 @@ import java.lang.reflect.Type;
|
|||||||
import java.lang.reflect.WildcardType;
|
import java.lang.reflect.WildcardType;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionStage;
|
import java.util.concurrent.CompletionStage;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates {@link CallAdapter} instances that convert {@link Call} into {@link java.util.concurrent.CompletionStage}
|
* Creates {@link CallAdapter} instances that convert {@link Call} into {@link java.util.concurrent.CompletionStage}
|
||||||
*/
|
*/
|
||||||
public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
||||||
|
|
||||||
|
private Function<RuntimeException, RuntimeException> exceptionConverter = Function.identity();
|
||||||
|
|
||||||
|
public Play25CallAdapterFactory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play25CallAdapterFactory(
|
||||||
|
Function<RuntimeException, RuntimeException> exceptionConverter) {
|
||||||
|
this.exceptionConverter = exceptionConverter;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
|
public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
|
||||||
if (!(returnType instanceof ParameterizedType)) {
|
if (!(returnType instanceof ParameterizedType)) {
|
||||||
@ -49,7 +60,7 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
|||||||
includeResponse = true;
|
includeResponse = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ValueAdapter(resultType, includeResponse);
|
return new ValueAdapter(resultType, includeResponse, exceptionConverter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,10 +70,13 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
|||||||
|
|
||||||
private final Type responseType;
|
private final Type responseType;
|
||||||
private final boolean includeResponse;
|
private final boolean includeResponse;
|
||||||
|
private Function<RuntimeException, RuntimeException> exceptionConverter;
|
||||||
|
|
||||||
ValueAdapter(Type responseType, boolean includeResponse) {
|
ValueAdapter(Type responseType, boolean includeResponse,
|
||||||
|
Function<RuntimeException, RuntimeException> exceptionConverter) {
|
||||||
this.responseType = responseType;
|
this.responseType = responseType;
|
||||||
this.includeResponse = includeResponse;
|
this.includeResponse = includeResponse;
|
||||||
|
this.exceptionConverter = exceptionConverter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -85,7 +99,7 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
|||||||
promise.complete(response.body());
|
promise.complete(response.body());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
promise.completeExceptionally(new HttpException(response));
|
promise.completeExceptionally(exceptionConverter.apply(new HttpException(response)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,8 @@ public class CodegenTest {
|
|||||||
Assert.assertEquals(codegen.camelize(".foo"), "Foo");
|
Assert.assertEquals(codegen.camelize(".foo"), "Foo");
|
||||||
Assert.assertEquals(codegen.camelize(".foo.bar"), "FooBar");
|
Assert.assertEquals(codegen.camelize(".foo.bar"), "FooBar");
|
||||||
Assert.assertEquals(codegen.camelize("foo$bar"), "Foo$bar");
|
Assert.assertEquals(codegen.camelize("foo$bar"), "Foo$bar");
|
||||||
|
Assert.assertEquals(codegen.camelize("foo_$bar"), "Foo$bar");
|
||||||
|
|
||||||
Assert.assertEquals(codegen.camelize("foo_bar"), "FooBar");
|
Assert.assertEquals(codegen.camelize("foo_bar"), "FooBar");
|
||||||
Assert.assertEquals(codegen.camelize("foo_bar_baz"), "FooBarBaz");
|
Assert.assertEquals(codegen.camelize("foo_bar_baz"), "FooBarBaz");
|
||||||
Assert.assertEquals(codegen.camelize("foo/bar.baz"), "FooBarBaz");
|
Assert.assertEquals(codegen.camelize("foo/bar.baz"), "FooBarBaz");
|
||||||
|
@ -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
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import io.swagger.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
|
import io.swagger.client.model.Client;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import play.libs.F;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public interface AnotherFakeApi {
|
||||||
|
/**
|
||||||
|
* To test special tags
|
||||||
|
* To test special tags
|
||||||
|
* @param body client model (required)
|
||||||
|
* @return Call<Client>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PATCH("another-fake/dummy")
|
||||||
|
F.Promise<Response<Client>> testSpecialTags(
|
||||||
|
@retrofit2.http.Body Client body
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
||||||
|
|
@ -9,12 +9,23 @@ import java.lang.reflect.Type;
|
|||||||
import java.lang.reflect.WildcardType;
|
import java.lang.reflect.WildcardType;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionStage;
|
import java.util.concurrent.CompletionStage;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates {@link CallAdapter} instances that convert {@link Call} into {@link java.util.concurrent.CompletionStage}
|
* Creates {@link CallAdapter} instances that convert {@link Call} into {@link java.util.concurrent.CompletionStage}
|
||||||
*/
|
*/
|
||||||
public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
||||||
|
|
||||||
|
private Function<RuntimeException, RuntimeException> exceptionConverter = Function.identity();
|
||||||
|
|
||||||
|
public Play25CallAdapterFactory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Play25CallAdapterFactory(
|
||||||
|
Function<RuntimeException, RuntimeException> exceptionConverter) {
|
||||||
|
this.exceptionConverter = exceptionConverter;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
|
public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
|
||||||
if (!(returnType instanceof ParameterizedType)) {
|
if (!(returnType instanceof ParameterizedType)) {
|
||||||
@ -49,7 +60,7 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
|||||||
includeResponse = true;
|
includeResponse = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ValueAdapter(resultType, includeResponse);
|
return new ValueAdapter(resultType, includeResponse, exceptionConverter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,10 +70,13 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
|||||||
|
|
||||||
private final Type responseType;
|
private final Type responseType;
|
||||||
private final boolean includeResponse;
|
private final boolean includeResponse;
|
||||||
|
private Function<RuntimeException, RuntimeException> exceptionConverter;
|
||||||
|
|
||||||
ValueAdapter(Type responseType, boolean includeResponse) {
|
ValueAdapter(Type responseType, boolean includeResponse,
|
||||||
|
Function<RuntimeException, RuntimeException> exceptionConverter) {
|
||||||
this.responseType = responseType;
|
this.responseType = responseType;
|
||||||
this.includeResponse = includeResponse;
|
this.includeResponse = includeResponse;
|
||||||
|
this.exceptionConverter = exceptionConverter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -85,7 +99,7 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory {
|
|||||||
promise.complete(response.body());
|
promise.complete(response.body());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
promise.completeExceptionally(new HttpException(response));
|
promise.completeExceptionally(exceptionConverter.apply(new HttpException(response)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import io.swagger.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
|
import io.swagger.client.model.Client;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public interface AnotherFakeApi {
|
||||||
|
/**
|
||||||
|
* To test special tags
|
||||||
|
* To test special tags
|
||||||
|
* @param body client model (required)
|
||||||
|
* @return Call<Client>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PATCH("another-fake/dummy")
|
||||||
|
CompletionStage<Response<Client>> testSpecialTags(
|
||||||
|
@retrofit2.http.Body Client body
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import io.swagger.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
|
||||||
|
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
|
||||||
|
* To test special tags
|
||||||
|
* @param body client model (required)
|
||||||
|
* @return Call<Client>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PATCH("another-fake/dummy")
|
||||||
|
Call<Client> testSpecialTags(
|
||||||
|
@retrofit2.http.Body Client body
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import io.swagger.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
import rx.Observable;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
|
||||||
|
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
|
||||||
|
* To test special tags
|
||||||
|
* @param body client model (required)
|
||||||
|
* @return Call<Client>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PATCH("another-fake/dummy")
|
||||||
|
Observable<Client> testSpecialTags(
|
||||||
|
@retrofit2.http.Body Client body
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
package io.swagger.client.api;
|
||||||
|
|
||||||
|
import io.swagger.client.CollectionFormats.*;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
|
||||||
|
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
|
||||||
|
* To test special tags
|
||||||
|
* @param body client model (required)
|
||||||
|
* @return Call<Client>
|
||||||
|
*/
|
||||||
|
@Headers({
|
||||||
|
"Content-Type:application/json"
|
||||||
|
})
|
||||||
|
@PATCH("another-fake/dummy")
|
||||||
|
Observable<Client> testSpecialTags(
|
||||||
|
@retrofit2.http.Body Client body
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user