Skip to content

Commit 6255b6e

Browse files
committed
updated java retrofit2rx and retrofit2rx2 samples
1 parent fb12e18 commit 6255b6e

File tree

108 files changed

+2482
-1548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2482
-1548
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.6-SNAPSHOT
1+
3.0.11-SNAPSHOT
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# AllPetsResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# OneOfAllPetsResponseItems
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# OneOfSinglePetResponsePet
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------

samples/client/petstore/java/retrofit2rx/docs/PetApi.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Method | HTTP request | Description
88
[**deletePet**](PetApi.md#deletePet) | **DELETE** pet/{petId} | Deletes a pet
99
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** pet/findByStatus | Finds Pets by status
1010
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** pet/findByTags | Finds Pets by tags
11+
[**getAllPets**](PetApi.md#getAllPets) | **GET** allPets |
1112
[**getPetById**](PetApi.md#getPetById) | **GET** pet/{petId} | Find pet by ID
13+
[**getRandomPet**](PetApi.md#getRandomPet) | **GET** randomPet |
1214
[**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet
1315
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data
1416
[**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image
@@ -223,6 +225,45 @@ Name | Type | Description | Notes
223225
- **Content-Type**: Not defined
224226
- **Accept**: application/xml, application/json
225227

228+
<a name="getAllPets"></a>
229+
# **getAllPets**
230+
> AllPetsResponse getAllPets()
231+
232+
233+
234+
### Example
235+
```java
236+
// Import classes:
237+
//import io.swagger.client.ApiException;
238+
//import io.swagger.client.api.PetApi;
239+
240+
241+
PetApi apiInstance = new PetApi();
242+
try {
243+
AllPetsResponse result = apiInstance.getAllPets();
244+
System.out.println(result);
245+
} catch (ApiException e) {
246+
System.err.println("Exception when calling PetApi#getAllPets");
247+
e.printStackTrace();
248+
}
249+
```
250+
251+
### Parameters
252+
This endpoint does not need any parameter.
253+
254+
### Return type
255+
256+
[**AllPetsResponse**](AllPetsResponse.md)
257+
258+
### Authorization
259+
260+
No authorization required
261+
262+
### HTTP request headers
263+
264+
- **Content-Type**: Not defined
265+
- **Accept**: application/json
266+
226267
<a name="getPetById"></a>
227268
# **getPetById**
228269
> Pet getPetById(petId)
@@ -278,6 +319,45 @@ Name | Type | Description | Notes
278319
- **Content-Type**: Not defined
279320
- **Accept**: application/xml, application/json
280321

322+
<a name="getRandomPet"></a>
323+
# **getRandomPet**
324+
> SinglePetResponse getRandomPet()
325+
326+
327+
328+
### Example
329+
```java
330+
// Import classes:
331+
//import io.swagger.client.ApiException;
332+
//import io.swagger.client.api.PetApi;
333+
334+
335+
PetApi apiInstance = new PetApi();
336+
try {
337+
SinglePetResponse result = apiInstance.getRandomPet();
338+
System.out.println(result);
339+
} catch (ApiException e) {
340+
System.err.println("Exception when calling PetApi#getRandomPet");
341+
e.printStackTrace();
342+
}
343+
```
344+
345+
### Parameters
346+
This endpoint does not need any parameter.
347+
348+
### Return type
349+
350+
[**SinglePetResponse**](SinglePetResponse.md)
351+
352+
### Authorization
353+
354+
No authorization required
355+
356+
### HTTP request headers
357+
358+
- **Content-Type**: Not defined
359+
- **Accept**: application/json
360+
281361
<a name="updatePet"></a>
282362
# **updatePet**
283363
> Void updatePet(body)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SinglePetResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**pet** | [**OneOfSinglePetResponsePet**](OneOfSinglePetResponsePet.md) | | [optional]

samples/client/petstore/java/retrofit2rx/docs/StoreApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ This endpoint does not need any parameter.
9494

9595
### Return type
9696

97-
[**Map&lt;String, Integer&gt;**](Map.md)
97+
**Map&lt;String, Integer&gt;**
9898

9999
### Authorization
100100

samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Observable<Void> testEndpointParameters(
118118
*/
119119
@GET("fake")
120120
Observable<Void> testEnumParameters(
121-
@retrofit2.http.Header("enum_header_string_array") List<String> enumHeaderStringArray , @retrofit2.http.Header("enum_header_string") String enumHeaderString , @retrofit2.http.Path("enum_query_string_array") List<String> enumQueryStringArray , @retrofit2.http.Path("enum_query_string") String enumQueryString , @retrofit2.http.Path("enum_query_integer") Integer enumQueryInteger
121+
@retrofit2.http.Header("enum_header_string_array") List<String> enumHeaderStringArray , @retrofit2.http.Header("enum_header_string") String enumHeaderString , @retrofit2.http.Query("enum_query_string_array") List<String> enumQueryStringArray , @retrofit2.http.Query("enum_query_string") String enumQueryString , @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger
122122
);
123123

124124
/**

samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
import okhttp3.RequestBody;
99
import okhttp3.ResponseBody;
1010

11+
import io.swagger.client.model.AllPetsResponse;
1112
import java.io.File;
1213
import io.swagger.client.model.ModelApiResponse;
1314
import io.swagger.client.model.Pet;
15+
import io.swagger.client.model.SinglePetResponse;
1416

1517
import java.util.ArrayList;
1618
import java.util.HashMap;
@@ -52,7 +54,7 @@ Observable<Void> deletePet(
5254
*/
5355
@GET("pet/findByStatus")
5456
Observable<List<Pet>> findPetsByStatus(
55-
@retrofit2.http.Path("status") List<String> status
57+
@retrofit2.http.Query("status") List<String> status
5658
);
5759

5860
/**
@@ -63,9 +65,18 @@ Observable<List<Pet>> findPetsByStatus(
6365
*/
6466
@GET("pet/findByTags")
6567
Observable<List<Pet>> findPetsByTags(
66-
@retrofit2.http.Path("tags") List<String> tags
68+
@retrofit2.http.Query("tags") List<String> tags
6769
);
6870

71+
/**
72+
*
73+
*
74+
* @return Call&lt;AllPetsResponse&gt;
75+
*/
76+
@GET("allPets")
77+
Observable<AllPetsResponse> getAllPets();
78+
79+
6980
/**
7081
* Find pet by ID
7182
* Returns a single pet
@@ -77,6 +88,15 @@ Observable<Pet> getPetById(
7788
@retrofit2.http.Path("petId") Long petId
7889
);
7990

91+
/**
92+
*
93+
*
94+
* @return Call&lt;SinglePetResponse&gt;
95+
*/
96+
@GET("randomPet")
97+
Observable<SinglePetResponse> getRandomPet();
98+
99+
80100
/**
81101
* Update an existing pet
82102
*
@@ -116,7 +136,7 @@ Observable<Void> updatePetWithForm(
116136
@retrofit2.http.Multipart
117137
@POST("pet/{petId}/uploadImage")
118138
Observable<ModelApiResponse> uploadFile(
119-
@retrofit2.http.Path("petId") Long petId , @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file") File file
139+
@retrofit2.http.Path("petId") Long petId , @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file
120140
);
121141

122142
}

samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Observable<User> getUserByName(
8989
*/
9090
@GET("user/login")
9191
Observable<String> loginUser(
92-
@retrofit2.http.Path("username") String username , @retrofit2.http.Path("password") String password
92+
@retrofit2.http.Query("username") String username , @retrofit2.http.Query("password") String password
9393
);
9494

9595
/**

0 commit comments

Comments
 (0)