-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java] Play! framework + retrofit2 client exception converter, bug fi…
…xes (#6543) * added exception converter * underscore removal fix * samples updated * added test * test whitespace
- Loading branch information
Showing
19 changed files
with
671 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
37 changes: 37 additions & 0 deletions
37
...nt/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/AnotherFakeApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
); | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...etstore/java/retrofit2-play24/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...nt/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/AnotherFakeApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
); | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...etstore/java/retrofit2-play25/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} |
Oops, something went wrong.