Skip to content

Commit 8640682

Browse files
committed
add new files for java petstore
1 parent 7ec3835 commit 8640682

File tree

14 files changed

+1128
-0
lines changed

14 files changed

+1128
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# EnumClass
3+
4+
## Enum
5+
6+
* `{values=[_abc, -efg, (xyz)], enumVars=[{name=_ABC, value="_abc"}, {name=_EFG, value="-efg"}, {name=_XYZ_, value="(xyz)"}]}`
7+
8+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
# EnumTest
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
8+
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
9+
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
10+
11+
12+
<a name="EnumStringEnum"></a>
13+
## Enum: EnumStringEnum
14+
Name | Value
15+
---- | -----
16+
UPPER | &quot;UPPER&quot;
17+
LOWER | &quot;lower&quot;
18+
19+
20+
<a name="EnumIntegerEnum"></a>
21+
## Enum: EnumIntegerEnum
22+
Name | Value
23+
---- | -----
24+
NUMBER_1 | 1
25+
NUMBER_MINUS_1 | -1
26+
27+
28+
<a name="EnumNumberEnum"></a>
29+
## Enum: EnumNumberEnum
30+
Name | Value
31+
---- | -----
32+
NUMBER_1_DOT_1 | 1.1
33+
NUMBER_MINUS_1_DOT_2 | -1.2
34+
35+
36+
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# FakeApi
2+
3+
All URIs are relative to *http://petstore.swagger.io/v2*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters
8+
9+
10+
<a name="testEndpointParameters"></a>
11+
# **testEndpointParameters**
12+
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
13+
14+
Fake endpoint for testing various parameters
15+
16+
Fake endpoint for testing various parameters
17+
18+
### Example
19+
```java
20+
// Import classes:
21+
//import io.swagger.client.ApiException;
22+
//import io.swagger.client.api.FakeApi;
23+
24+
25+
FakeApi apiInstance = new FakeApi();
26+
String number = "number_example"; // String | None
27+
Double _double = 3.4D; // Double | None
28+
String string = "string_example"; // String | None
29+
byte[] _byte = B; // byte[] | None
30+
Integer integer = 56; // Integer | None
31+
Integer int32 = 56; // Integer | None
32+
Long int64 = 789L; // Long | None
33+
Float _float = 3.4F; // Float | None
34+
byte[] binary = B; // byte[] | None
35+
Date date = new Date(); // Date | None
36+
Date dateTime = new Date(); // Date | None
37+
String password = "password_example"; // String | None
38+
try {
39+
apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
40+
} catch (ApiException e) {
41+
System.err.println("Exception when calling FakeApi#testEndpointParameters");
42+
e.printStackTrace();
43+
}
44+
```
45+
46+
### Parameters
47+
48+
Name | Type | Description | Notes
49+
------------- | ------------- | ------------- | -------------
50+
**number** | **String**| None |
51+
**_double** | **Double**| None |
52+
**string** | **String**| None |
53+
**_byte** | **byte[]**| None |
54+
**integer** | **Integer**| None | [optional]
55+
**int32** | **Integer**| None | [optional]
56+
**int64** | **Long**| None | [optional]
57+
**_float** | **Float**| None | [optional]
58+
**binary** | **byte[]**| None | [optional]
59+
**date** | **Date**| None | [optional]
60+
**dateTime** | **Date**| None | [optional]
61+
**password** | **String**| None | [optional]
62+
63+
### Return type
64+
65+
null (empty response body)
66+
67+
### Authorization
68+
69+
No authorization required
70+
71+
### HTTP request headers
72+
73+
- **Content-Type**: Not defined
74+
- **Accept**: application/xml, application/json
75+
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
package io.swagger.client.api;
2+
3+
import com.sun.jersey.api.client.GenericType;
4+
5+
import io.swagger.client.ApiException;
6+
import io.swagger.client.ApiClient;
7+
import io.swagger.client.Configuration;
8+
import io.swagger.client.Pair;
9+
10+
import java.util.Date;
11+
12+
import java.util.ArrayList;
13+
import java.util.HashMap;
14+
import java.util.List;
15+
import java.util.Map;
16+
17+
18+
public class FakeApi {
19+
private ApiClient apiClient;
20+
21+
public FakeApi() {
22+
this(Configuration.getDefaultApiClient());
23+
}
24+
25+
public FakeApi(ApiClient apiClient) {
26+
this.apiClient = apiClient;
27+
}
28+
29+
public ApiClient getApiClient() {
30+
return apiClient;
31+
}
32+
33+
public void setApiClient(ApiClient apiClient) {
34+
this.apiClient = apiClient;
35+
}
36+
37+
/**
38+
* Fake endpoint for testing various parameters
39+
* Fake endpoint for testing various parameters
40+
* @param number None (required)
41+
* @param _double None (required)
42+
* @param string None (required)
43+
* @param _byte None (required)
44+
* @param integer None (optional)
45+
* @param int32 None (optional)
46+
* @param int64 None (optional)
47+
* @param _float None (optional)
48+
* @param binary None (optional)
49+
* @param date None (optional)
50+
* @param dateTime None (optional)
51+
* @param password None (optional)
52+
* @throws ApiException if fails to make API call
53+
*/
54+
public void testEndpointParameters(String number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException {
55+
Object localVarPostBody = null;
56+
57+
// verify the required parameter 'number' is set
58+
if (number == null) {
59+
throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters");
60+
}
61+
62+
// verify the required parameter '_double' is set
63+
if (_double == null) {
64+
throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters");
65+
}
66+
67+
// verify the required parameter 'string' is set
68+
if (string == null) {
69+
throw new ApiException(400, "Missing the required parameter 'string' when calling testEndpointParameters");
70+
}
71+
72+
// verify the required parameter '_byte' is set
73+
if (_byte == null) {
74+
throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters");
75+
}
76+
77+
// create path and map variables
78+
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
79+
80+
// query params
81+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
82+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
83+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
84+
85+
86+
87+
if (integer != null)
88+
localVarFormParams.put("integer", integer);
89+
if (int32 != null)
90+
localVarFormParams.put("int32", int32);
91+
if (int64 != null)
92+
localVarFormParams.put("int64", int64);
93+
if (number != null)
94+
localVarFormParams.put("number", number);
95+
if (_float != null)
96+
localVarFormParams.put("float", _float);
97+
if (_double != null)
98+
localVarFormParams.put("double", _double);
99+
if (string != null)
100+
localVarFormParams.put("string", string);
101+
if (_byte != null)
102+
localVarFormParams.put("byte", _byte);
103+
if (binary != null)
104+
localVarFormParams.put("binary", binary);
105+
if (date != null)
106+
localVarFormParams.put("date", date);
107+
if (dateTime != null)
108+
localVarFormParams.put("dateTime", dateTime);
109+
if (password != null)
110+
localVarFormParams.put("password", password);
111+
112+
final String[] localVarAccepts = {
113+
"application/xml", "application/json"
114+
};
115+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
116+
117+
final String[] localVarContentTypes = {
118+
119+
};
120+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
121+
122+
String[] localVarAuthNames = new String[] { };
123+
124+
125+
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
126+
}
127+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package io.swagger.client.api;
2+
3+
import io.swagger.client.ApiClient;
4+
5+
import java.util.Date;
6+
7+
import java.util.ArrayList;
8+
import java.util.HashMap;
9+
import java.util.List;
10+
import java.util.Map;
11+
import feign.*;
12+
13+
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00")
14+
public interface FakeApi extends ApiClient.Api {
15+
16+
17+
/**
18+
* Fake endpoint for testing various parameters
19+
* Fake endpoint for testing various parameters
20+
* @param number None (required)
21+
* @param _double None (required)
22+
* @param string None (required)
23+
* @param _byte None (required)
24+
* @param integer None (optional)
25+
* @param int32 None (optional)
26+
* @param int64 None (optional)
27+
* @param _float None (optional)
28+
* @param binary None (optional)
29+
* @param date None (optional)
30+
* @param dateTime None (optional)
31+
* @param password None (optional)
32+
* @return void
33+
*/
34+
@RequestLine("POST /fake")
35+
@Headers({
36+
"Content-type: application/x-www-form-urlencoded",
37+
"Accepts: application/json",
38+
})
39+
void testEndpointParameters(@Param("number") String number, @Param("_double") Double _double, @Param("string") String string, @Param("_byte") byte[] _byte, @Param("integer") Integer integer, @Param("int32") Integer int32, @Param("int64") Long int64, @Param("_float") Float _float, @Param("binary") byte[] binary, @Param("date") Date date, @Param("dateTime") Date dateTime, @Param("password") String password);
40+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# EnumClass
3+
4+
## Enum
5+
6+
7+
* `_ABC` (value: `&quot;_abc&quot;`)
8+
9+
* `_EFG` (value: `&quot;-efg&quot;`)
10+
11+
* `_XYZ_` (value: `&quot;(xyz)&quot;`)
12+
13+
14+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
# EnumTest
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
8+
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
9+
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
10+
11+
12+
<a name="EnumStringEnum"></a>
13+
## Enum: EnumStringEnum
14+
Name | Value
15+
---- | -----
16+
UPPER | &quot;UPPER&quot;
17+
LOWER | &quot;lower&quot;
18+
19+
20+
<a name="EnumIntegerEnum"></a>
21+
## Enum: EnumIntegerEnum
22+
Name | Value
23+
---- | -----
24+
NUMBER_1 | 1
25+
NUMBER_MINUS_1 | -1
26+
27+
28+
<a name="EnumNumberEnum"></a>
29+
## Enum: EnumNumberEnum
30+
Name | Value
31+
---- | -----
32+
NUMBER_1_DOT_1 | 1.1
33+
NUMBER_MINUS_1_DOT_2 | -1.2
34+
35+
36+

0 commit comments

Comments
 (0)