Skip to content

Commit 0d78895

Browse files
committed
updated java-petstore-jersey2-java6 sample
1 parent c4c3f46 commit 0d78895

36 files changed

+184
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.0-SNAPSHOT
1+
3.0.3-SNAPSHOT

samples/client/petstore/java/jersey2-java6/docs/FakeApi.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
250250
### Example
251251
```java
252252
// Import classes:
253+
//import io.swagger.client.ApiClient;
253254
//import io.swagger.client.ApiException;
255+
//import io.swagger.client.Configuration;
256+
//import io.swagger.client.auth.*;
254257
//import io.swagger.client.api.FakeApi;
255258

259+
ApiClient defaultClient = Configuration.getDefaultApiClient();
260+
// Configure HTTP basic authorization: http_basic_test
261+
HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
262+
http_basic_test.setUsername("YOUR USERNAME");
263+
http_basic_test.setPassword("YOUR PASSWORD");
256264

257265
FakeApi apiInstance = new FakeApi();
258266
Object body = null; // Object |

samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,19 @@ To test class name in snake case
1515
### Example
1616
```java
1717
// Import classes:
18+
//import io.swagger.client.ApiClient;
1819
//import io.swagger.client.ApiException;
20+
//import io.swagger.client.Configuration;
21+
//import io.swagger.client.auth.*;
1922
//import io.swagger.client.api.FakeClassnameTags123Api;
2023

24+
ApiClient defaultClient = Configuration.getDefaultApiClient();
25+
26+
// Configure API key authorization: api_key_query
27+
ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
28+
api_key_query.setApiKey("YOUR API KEY");
29+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
30+
//api_key_query.setApiKeyPrefix("Token");
2131

2232
FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api();
2333
Client body = new Client(); // Client | client model

samples/client/petstore/java/jersey2-java6/docs/PetApi.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@ Add a new pet to the store
2222
### Example
2323
```java
2424
// Import classes:
25+
//import io.swagger.client.ApiClient;
2526
//import io.swagger.client.ApiException;
27+
//import io.swagger.client.Configuration;
28+
//import io.swagger.client.auth.*;
2629
//import io.swagger.client.api.PetApi;
2730

31+
ApiClient defaultClient = Configuration.getDefaultApiClient();
32+
33+
// Configure OAuth2 access token for authorization: petstore_auth
34+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
35+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
2836

2937
PetApi apiInstance = new PetApi();
3038
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
@@ -64,9 +72,17 @@ Deletes a pet
6472
### Example
6573
```java
6674
// Import classes:
75+
//import io.swagger.client.ApiClient;
6776
//import io.swagger.client.ApiException;
77+
//import io.swagger.client.Configuration;
78+
//import io.swagger.client.auth.*;
6879
//import io.swagger.client.api.PetApi;
6980

81+
ApiClient defaultClient = Configuration.getDefaultApiClient();
82+
83+
// Configure OAuth2 access token for authorization: petstore_auth
84+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
85+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
7086

7187
PetApi apiInstance = new PetApi();
7288
Integer petId = 56; // Integer | Pet id to delete
@@ -110,9 +126,17 @@ Multiple status values can be provided with comma separated strings
110126
### Example
111127
```java
112128
// Import classes:
129+
//import io.swagger.client.ApiClient;
113130
//import io.swagger.client.ApiException;
131+
//import io.swagger.client.Configuration;
132+
//import io.swagger.client.auth.*;
114133
//import io.swagger.client.api.PetApi;
115134

135+
ApiClient defaultClient = Configuration.getDefaultApiClient();
136+
137+
// Configure OAuth2 access token for authorization: petstore_auth
138+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
139+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
116140

117141
PetApi apiInstance = new PetApi();
118142
List<String> status = Arrays.asList("status_example"); // List<String> | Status values that need to be considered for filter
@@ -155,9 +179,17 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
155179
### Example
156180
```java
157181
// Import classes:
182+
//import io.swagger.client.ApiClient;
158183
//import io.swagger.client.ApiException;
184+
//import io.swagger.client.Configuration;
185+
//import io.swagger.client.auth.*;
159186
//import io.swagger.client.api.PetApi;
160187

188+
ApiClient defaultClient = Configuration.getDefaultApiClient();
189+
190+
// Configure OAuth2 access token for authorization: petstore_auth
191+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
192+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
161193

162194
PetApi apiInstance = new PetApi();
163195
List<String> tags = Arrays.asList("tags_example"); // List<String> | Tags to filter by
@@ -200,9 +232,19 @@ Returns a single pet
200232
### Example
201233
```java
202234
// Import classes:
235+
//import io.swagger.client.ApiClient;
203236
//import io.swagger.client.ApiException;
237+
//import io.swagger.client.Configuration;
238+
//import io.swagger.client.auth.*;
204239
//import io.swagger.client.api.PetApi;
205240

241+
ApiClient defaultClient = Configuration.getDefaultApiClient();
242+
243+
// Configure API key authorization: api_key
244+
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
245+
api_key.setApiKey("YOUR API KEY");
246+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
247+
//api_key.setApiKeyPrefix("Token");
206248

207249
PetApi apiInstance = new PetApi();
208250
Integer petId = 56; // Integer | ID of pet to return
@@ -243,9 +285,17 @@ Update an existing pet
243285
### Example
244286
```java
245287
// Import classes:
288+
//import io.swagger.client.ApiClient;
246289
//import io.swagger.client.ApiException;
290+
//import io.swagger.client.Configuration;
291+
//import io.swagger.client.auth.*;
247292
//import io.swagger.client.api.PetApi;
248293

294+
ApiClient defaultClient = Configuration.getDefaultApiClient();
295+
296+
// Configure OAuth2 access token for authorization: petstore_auth
297+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
298+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
249299

250300
PetApi apiInstance = new PetApi();
251301
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
@@ -285,9 +335,17 @@ Updates a pet in the store with form data
285335
### Example
286336
```java
287337
// Import classes:
338+
//import io.swagger.client.ApiClient;
288339
//import io.swagger.client.ApiException;
340+
//import io.swagger.client.Configuration;
341+
//import io.swagger.client.auth.*;
289342
//import io.swagger.client.api.PetApi;
290343

344+
ApiClient defaultClient = Configuration.getDefaultApiClient();
345+
346+
// Configure OAuth2 access token for authorization: petstore_auth
347+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
348+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
291349

292350
PetApi apiInstance = new PetApi();
293351
Integer petId = 56; // Integer | ID of pet that needs to be updated
@@ -331,9 +389,17 @@ uploads an image
331389
### Example
332390
```java
333391
// Import classes:
392+
//import io.swagger.client.ApiClient;
334393
//import io.swagger.client.ApiException;
394+
//import io.swagger.client.Configuration;
395+
//import io.swagger.client.auth.*;
335396
//import io.swagger.client.api.PetApi;
336397

398+
ApiClient defaultClient = Configuration.getDefaultApiClient();
399+
400+
// Configure OAuth2 access token for authorization: petstore_auth
401+
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
402+
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
337403

338404
PetApi apiInstance = new PetApi();
339405
Integer petId = 56; // Integer | ID of pet to update

samples/client/petstore/java/jersey2-java6/docs/StoreApi.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,19 @@ Returns a map of status codes to quantities
6464
### Example
6565
```java
6666
// Import classes:
67+
//import io.swagger.client.ApiClient;
6768
//import io.swagger.client.ApiException;
69+
//import io.swagger.client.Configuration;
70+
//import io.swagger.client.auth.*;
6871
//import io.swagger.client.api.StoreApi;
6972

73+
ApiClient defaultClient = Configuration.getDefaultApiClient();
74+
75+
// Configure API key authorization: api_key
76+
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
77+
api_key.setApiKey("YOUR API KEY");
78+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
79+
//api_key.setApiKeyPrefix("Token");
7080

7181
StoreApi apiInstance = new StoreApi();
7282
try {

samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public void testEnumParameters(Object body, List<String> enumHeaderStringArray,
272272
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
273273
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
274274

275-
localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string_array", enumQueryStringArray));
275+
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray));
276276
localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString));
277277
localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger));
278278

samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
134134
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
135135
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
136136

137-
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
137+
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status));
138138

139139

140140

@@ -176,7 +176,7 @@ public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
176176
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
177177
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
178178

179-
localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", tags));
179+
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "tags", tags));
180180

181181

182182

samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@
2828
public class AdditionalPropertiesClass {
2929

3030
@JsonProperty("map_property")
31+
3132
private Map<String, String> mapProperty = null;
3233

3334
@JsonProperty("map_of_map_property")
35+
3436
private Map<String, Map<String, String>> mapOfMapProperty = null;
3537
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
3638
this.mapProperty = mapProperty;

samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Animal.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@
3232
public class Animal {
3333

3434
@JsonProperty("className")
35+
3536
private String className = null;
3637

3738
@JsonProperty("color")
39+
3840
private String color = "red";
3941
public Animal className(String className) {
4042
this.className = className;

samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
public class ArrayOfArrayOfNumberOnly {
2929

3030
@JsonProperty("ArrayArrayNumber")
31+
3132
private List<List<BigDecimal>> arrayArrayNumber = null;
3233
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
3334
this.arrayArrayNumber = arrayArrayNumber;

0 commit comments

Comments
 (0)