Skip to content

Commit 1e28a45

Browse files
committed
updated java resteasy sample
1 parent 10623e1 commit 1e28a45

Some content is hidden

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

53 files changed

+1287
-897
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/resteasy/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
@@ -221,6 +223,45 @@ Name | Type | Description | Notes
221223
- **Content-Type**: Not defined
222224
- **Accept**: application/xml, application/json
223225

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

320+
<a name="getRandomPet"></a>
321+
# **getRandomPet**
322+
> SinglePetResponse getRandomPet()
323+
324+
325+
326+
### Example
327+
```java
328+
// Import classes:
329+
//import io.swagger.client.ApiException;
330+
//import io.swagger.client.api.PetApi;
331+
332+
333+
PetApi apiInstance = new PetApi();
334+
try {
335+
SinglePetResponse result = apiInstance.getRandomPet();
336+
System.out.println(result);
337+
} catch (ApiException e) {
338+
System.err.println("Exception when calling PetApi#getRandomPet");
339+
e.printStackTrace();
340+
}
341+
```
342+
343+
### Parameters
344+
This endpoint does not need any parameter.
345+
346+
### Return type
347+
348+
[**SinglePetResponse**](SinglePetResponse.md)
349+
350+
### Authorization
351+
352+
No authorization required
353+
354+
### HTTP request headers
355+
356+
- **Content-Type**: Not defined
357+
- **Accept**: application/json
358+
279359
<a name="updatePet"></a>
280360
# **updatePet**
281361
> 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/resteasy/docs/StoreApi.md

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

9494
### Return type
9595

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

9898
### Authorization
9999

samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,11 @@ public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Objec
581581
}
582582
}
583583

584-
Invocation.Builder invocationBuilder = target.request().accept(accept);
584+
Invocation.Builder invocationBuilder = target.request();
585+
586+
if (accept != null) {
587+
invocationBuilder = invocationBuilder.accept(accept);
588+
}
585589

586590
for (String key : headerParams.keySet()) {
587591
String value = headerParams.get(key);

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

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
import javax.ws.rs.core.GenericType;
99

10+
import io.swagger.client.model.AllPetsResponse;
1011
import java.io.File;
1112
import io.swagger.client.model.ModelApiResponse;
1213
import io.swagger.client.model.Pet;
14+
import io.swagger.client.model.SinglePetResponse;
1315

1416
import java.util.ArrayList;
1517
import java.util.HashMap;
@@ -195,6 +197,40 @@ public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
195197
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
196198
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
197199
}
200+
/**
201+
*
202+
*
203+
* @return AllPetsResponse
204+
* @throws ApiException if fails to make API call
205+
*/
206+
public AllPetsResponse getAllPets() throws ApiException {
207+
Object localVarPostBody = null;
208+
// create path and map variables
209+
String localVarPath = "/allPets".replaceAll("\\{format\\}","json");
210+
211+
// query params
212+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
213+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
214+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
215+
216+
217+
218+
219+
final String[] localVarAccepts = {
220+
"application/json"
221+
};
222+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
223+
224+
final String[] localVarContentTypes = {
225+
226+
};
227+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
228+
229+
String[] localVarAuthNames = new String[] { };
230+
231+
GenericType<AllPetsResponse> localVarReturnType = new GenericType<AllPetsResponse>() {};
232+
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
233+
}
198234
/**
199235
* Find pet by ID
200236
* Returns a single pet
@@ -235,6 +271,40 @@ public Pet getPetById(Long petId) throws ApiException {
235271
GenericType<Pet> localVarReturnType = new GenericType<Pet>() {};
236272
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
237273
}
274+
/**
275+
*
276+
*
277+
* @return SinglePetResponse
278+
* @throws ApiException if fails to make API call
279+
*/
280+
public SinglePetResponse getRandomPet() throws ApiException {
281+
Object localVarPostBody = null;
282+
// create path and map variables
283+
String localVarPath = "/randomPet".replaceAll("\\{format\\}","json");
284+
285+
// query params
286+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
287+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
288+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
289+
290+
291+
292+
293+
final String[] localVarAccepts = {
294+
"application/json"
295+
};
296+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
297+
298+
final String[] localVarContentTypes = {
299+
300+
};
301+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
302+
303+
String[] localVarAuthNames = new String[] { };
304+
305+
GenericType<SinglePetResponse> localVarReturnType = new GenericType<SinglePetResponse>() {};
306+
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
307+
}
238308
/**
239309
* Update an existing pet
240310
*

samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,75 +13,79 @@
1313
package io.swagger.client.model;
1414

1515
import java.util.Objects;
16+
import java.util.Arrays;
1617
import com.fasterxml.jackson.annotation.JsonProperty;
1718
import com.fasterxml.jackson.annotation.JsonCreator;
1819
import com.fasterxml.jackson.annotation.JsonValue;
1920
import io.swagger.v3.oas.annotations.media.Schema;
2021
import java.util.HashMap;
2122
import java.util.List;
2223
import java.util.Map;
23-
2424
/**
2525
* AdditionalPropertiesClass
2626
*/
2727

28-
public class AdditionalPropertiesClass {
2928

29+
public class AdditionalPropertiesClass {
3030
@JsonProperty("map_property")
31-
3231
private Map<String, String> mapProperty = null;
3332

3433
@JsonProperty("map_of_map_property")
35-
3634
private Map<String, Map<String, String>> mapOfMapProperty = null;
35+
3736
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
3837
this.mapProperty = mapProperty;
3938
return this;
4039
}
4140

42-
4341
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
4442
if (this.mapProperty == null) {
4543
this.mapProperty = new HashMap<String, String>();
4644
}
4745
this.mapProperty.put(key, mapPropertyItem);
4846
return this;
4947
}
50-
/**
51-
* Get mapProperty
52-
* @return mapProperty
48+
49+
/**
50+
* Get mapProperty
51+
* @return mapProperty
5352
**/
5453
@Schema(description = "")
5554
public Map<String, String> getMapProperty() {
5655
return mapProperty;
5756
}
57+
5858
public void setMapProperty(Map<String, String> mapProperty) {
5959
this.mapProperty = mapProperty;
6060
}
61+
6162
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
6263
this.mapOfMapProperty = mapOfMapProperty;
6364
return this;
6465
}
6566

66-
6767
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
6868
if (this.mapOfMapProperty == null) {
6969
this.mapOfMapProperty = new HashMap<String, Map<String, String>>();
7070
}
7171
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
7272
return this;
7373
}
74-
/**
75-
* Get mapOfMapProperty
76-
* @return mapOfMapProperty
74+
75+
/**
76+
* Get mapOfMapProperty
77+
* @return mapOfMapProperty
7778
**/
7879
@Schema(description = "")
7980
public Map<String, Map<String, String>> getMapOfMapProperty() {
8081
return mapOfMapProperty;
8182
}
83+
8284
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
8385
this.mapOfMapProperty = mapOfMapProperty;
8486
}
87+
88+
8589
@Override
8690
public boolean equals(java.lang.Object o) {
8791
if (this == o) {
@@ -97,9 +101,10 @@ public boolean equals(java.lang.Object o) {
97101

98102
@Override
99103
public int hashCode() {
100-
return java.util.Objects.hash(mapProperty, mapOfMapProperty);
104+
return Objects.hash(mapProperty, mapOfMapProperty);
101105
}
102106

107+
103108
@Override
104109
public String toString() {
105110
StringBuilder sb = new StringBuilder();

0 commit comments

Comments
 (0)