Skip to content

Commit 10623e1

Browse files
committed
updated java resttemplate with xml sample
1 parent e156f12 commit 10623e1

Some content is hidden

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

59 files changed

+1622
-1152
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/resttemplate-withXml/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/resttemplate-withXml/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/resttemplate-withXml/src/main/java/io/swagger/client/api/AnimalApi.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ public void addAnimal(Animal body) throws RestClientException {
6565

6666
final String[] accepts = { };
6767
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
68-
final String[] contentTypes = { };
68+
final String[] contentTypes = {
69+
"application/json", "application/xml"
70+
};
6971
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
7072

7173
String[] authNames = new String[] { };
@@ -133,7 +135,9 @@ public Animal getAnimalById(Long animalId) throws RestClientException {
133135
final HttpHeaders headerParams = new HttpHeaders();
134136
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
135137

136-
final String[] accepts = { };
138+
final String[] accepts = {
139+
"application/xml", "application/json"
140+
};
137141
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
138142
final String[] contentTypes = { };
139143
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
@@ -166,7 +170,9 @@ public void updateAnimal(Animal body) throws RestClientException {
166170

167171
final String[] accepts = { };
168172
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
169-
final String[] contentTypes = { };
173+
final String[] contentTypes = {
174+
"application/json", "application/xml"
175+
};
170176
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
171177

172178
String[] authNames = new String[] { };
@@ -204,7 +210,9 @@ public void updateAnimalWithForm(Long animalId, String name, String status) thro
204210

205211
final String[] accepts = { };
206212
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
207-
final String[] contentTypes = { };
213+
final String[] contentTypes = {
214+
"application/x-www-form-urlencoded"
215+
};
208216
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
209217

210218
String[] authNames = new String[] { };

samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/AnotherFakeApi.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ public Client testSpecialTags(Client body) throws RestClientException {
6464
final HttpHeaders headerParams = new HttpHeaders();
6565
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
6666

67-
final String[] accepts = { };
67+
final String[] accepts = {
68+
"application/json"
69+
};
6870
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
69-
final String[] contentTypes = { };
71+
final String[] contentTypes = {
72+
"application/json"
73+
};
7074
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
7175

7276
String[] authNames = new String[] { };

samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/api/DogApi.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ public void addDog(Dog body) throws RestClientException {
6565

6666
final String[] accepts = { };
6767
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
68-
final String[] contentTypes = { };
68+
final String[] contentTypes = {
69+
"application/json", "application/xml"
70+
};
6971
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
7072

7173
String[] authNames = new String[] { };
@@ -133,7 +135,9 @@ public Dog getDogById(Long dogId) throws RestClientException {
133135
final HttpHeaders headerParams = new HttpHeaders();
134136
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
135137

136-
final String[] accepts = { };
138+
final String[] accepts = {
139+
"application/xml", "application/json"
140+
};
137141
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
138142
final String[] contentTypes = { };
139143
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
@@ -166,7 +170,9 @@ public void updateDog(Dog body) throws RestClientException {
166170

167171
final String[] accepts = { };
168172
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
169-
final String[] contentTypes = { };
173+
final String[] contentTypes = {
174+
"application/json", "application/xml"
175+
};
170176
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
171177

172178
String[] authNames = new String[] { };
@@ -204,7 +210,9 @@ public void updateDogWithForm(Long animalId, String name, String status) throws
204210

205211
final String[] accepts = { };
206212
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
207-
final String[] contentTypes = { };
213+
final String[] contentTypes = {
214+
"application/x-www-form-urlencoded"
215+
};
208216
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
209217

210218
String[] authNames = new String[] { };

0 commit comments

Comments
 (0)