-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# EnumClass | ||
|
||
## Enum | ||
|
||
* `{values=[_abc, -efg, (xyz)], enumVars=[{name=_ABC, value="_abc"}, {name=_EFG, value="-efg"}, {name=_XYZ_, value="(xyz)"}]}` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
# EnumTest | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | ||
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | ||
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | ||
|
||
|
||
<a name="EnumStringEnum"></a> | ||
## Enum: EnumStringEnum | ||
Name | Value | ||
---- | ----- | ||
UPPER | "UPPER" | ||
LOWER | "lower" | ||
|
||
|
||
<a name="EnumIntegerEnum"></a> | ||
## Enum: EnumIntegerEnum | ||
Name | Value | ||
---- | ----- | ||
NUMBER_1 | 1 | ||
NUMBER_MINUS_1 | -1 | ||
|
||
|
||
<a name="EnumNumberEnum"></a> | ||
## Enum: EnumNumberEnum | ||
Name | Value | ||
---- | ----- | ||
NUMBER_1_DOT_1 | 1.1 | ||
NUMBER_MINUS_1_DOT_2 | -1.2 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# FakeApi | ||
|
||
All URIs are relative to *http://petstore.swagger.io/v2* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters | ||
|
||
|
||
<a name="testEndpointParameters"></a> | ||
# **testEndpointParameters** | ||
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) | ||
Fake endpoint for testing various parameters | ||
|
||
Fake endpoint for testing various parameters | ||
|
||
### Example | ||
```java | ||
// Import classes: | ||
//import io.swagger.client.ApiException; | ||
//import io.swagger.client.api.FakeApi; | ||
|
||
|
||
FakeApi apiInstance = new FakeApi(); | ||
String number = "number_example"; // String | None | ||
Double _double = 3.4D; // Double | None | ||
String string = "string_example"; // String | None | ||
byte[] _byte = B; // byte[] | None | ||
Integer integer = 56; // Integer | None | ||
Integer int32 = 56; // Integer | None | ||
Long int64 = 789L; // Long | None | ||
Float _float = 3.4F; // Float | None | ||
byte[] binary = B; // byte[] | None | ||
Date date = new Date(); // Date | None | ||
Date dateTime = new Date(); // Date | None | ||
String password = "password_example"; // String | None | ||
try { | ||
apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); | ||
} catch (ApiException e) { | ||
System.err.println("Exception when calling FakeApi#testEndpointParameters"); | ||
e.printStackTrace(); | ||
} | ||
``` | ||
|
||
### Parameters | ||
|
||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**number** | **String**| None | | ||
**_double** | **Double**| None | | ||
**string** | **String**| None | | ||
**_byte** | **byte[]**| None | | ||
**integer** | **Integer**| None | [optional] | ||
**int32** | **Integer**| None | [optional] | ||
**int64** | **Long**| None | [optional] | ||
**_float** | **Float**| None | [optional] | ||
**binary** | **byte[]**| None | [optional] | ||
**date** | **Date**| None | [optional] | ||
**dateTime** | **Date**| None | [optional] | ||
**password** | **String**| None | [optional] | ||
|
||
### Return type | ||
|
||
null (empty response body) | ||
|
||
### Authorization | ||
|
||
No authorization required | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: application/xml, application/json | ||
|
127 changes: 127 additions & 0 deletions
127
samples/client/petstore/java/default/src/main/java/io/swagger/client/api/FakeApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
package io.swagger.client.api; | ||
|
||
import com.sun.jersey.api.client.GenericType; | ||
|
||
import io.swagger.client.ApiException; | ||
import io.swagger.client.ApiClient; | ||
import io.swagger.client.Configuration; | ||
import io.swagger.client.Pair; | ||
|
||
import java.util.Date; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
|
||
public class FakeApi { | ||
private ApiClient apiClient; | ||
|
||
public FakeApi() { | ||
this(Configuration.getDefaultApiClient()); | ||
} | ||
|
||
public FakeApi(ApiClient apiClient) { | ||
this.apiClient = apiClient; | ||
} | ||
|
||
public ApiClient getApiClient() { | ||
return apiClient; | ||
} | ||
|
||
public void setApiClient(ApiClient apiClient) { | ||
this.apiClient = apiClient; | ||
} | ||
|
||
/** | ||
* Fake endpoint for testing various parameters | ||
* Fake endpoint for testing various parameters | ||
* @param number None (required) | ||
* @param _double None (required) | ||
* @param string None (required) | ||
* @param _byte None (required) | ||
* @param integer None (optional) | ||
* @param int32 None (optional) | ||
* @param int64 None (optional) | ||
* @param _float None (optional) | ||
* @param binary None (optional) | ||
* @param date None (optional) | ||
* @param dateTime None (optional) | ||
* @param password None (optional) | ||
* @throws ApiException if fails to make API call | ||
*/ | ||
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 { | ||
Object localVarPostBody = null; | ||
|
||
// verify the required parameter 'number' is set | ||
if (number == null) { | ||
throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); | ||
} | ||
|
||
// verify the required parameter '_double' is set | ||
if (_double == null) { | ||
throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); | ||
} | ||
|
||
// verify the required parameter 'string' is set | ||
if (string == null) { | ||
throw new ApiException(400, "Missing the required parameter 'string' when calling testEndpointParameters"); | ||
} | ||
|
||
// verify the required parameter '_byte' is set | ||
if (_byte == null) { | ||
throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); | ||
} | ||
|
||
// create path and map variables | ||
String localVarPath = "/fake".replaceAll("\\{format\\}","json"); | ||
|
||
// query params | ||
List<Pair> localVarQueryParams = new ArrayList<Pair>(); | ||
Map<String, String> localVarHeaderParams = new HashMap<String, String>(); | ||
Map<String, Object> localVarFormParams = new HashMap<String, Object>(); | ||
|
||
|
||
|
||
if (integer != null) | ||
localVarFormParams.put("integer", integer); | ||
if (int32 != null) | ||
localVarFormParams.put("int32", int32); | ||
if (int64 != null) | ||
localVarFormParams.put("int64", int64); | ||
if (number != null) | ||
localVarFormParams.put("number", number); | ||
if (_float != null) | ||
localVarFormParams.put("float", _float); | ||
if (_double != null) | ||
localVarFormParams.put("double", _double); | ||
if (string != null) | ||
localVarFormParams.put("string", string); | ||
if (_byte != null) | ||
localVarFormParams.put("byte", _byte); | ||
if (binary != null) | ||
localVarFormParams.put("binary", binary); | ||
if (date != null) | ||
localVarFormParams.put("date", date); | ||
if (dateTime != null) | ||
localVarFormParams.put("dateTime", dateTime); | ||
if (password != null) | ||
localVarFormParams.put("password", password); | ||
|
||
final String[] localVarAccepts = { | ||
"application/xml", "application/json" | ||
}; | ||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); | ||
|
||
final String[] localVarContentTypes = { | ||
|
||
}; | ||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); | ||
|
||
String[] localVarAuthNames = new String[] { }; | ||
|
||
|
||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.swagger.client.api; | ||
|
||
import io.swagger.client.ApiClient; | ||
|
||
import java.util.Date; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import feign.*; | ||
|
||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T23:17:22.230+08:00") | ||
public interface FakeApi extends ApiClient.Api { | ||
|
||
|
||
/** | ||
* Fake endpoint for testing various parameters | ||
* Fake endpoint for testing various parameters | ||
* @param number None (required) | ||
* @param _double None (required) | ||
* @param string None (required) | ||
* @param _byte None (required) | ||
* @param integer None (optional) | ||
* @param int32 None (optional) | ||
* @param int64 None (optional) | ||
* @param _float None (optional) | ||
* @param binary None (optional) | ||
* @param date None (optional) | ||
* @param dateTime None (optional) | ||
* @param password None (optional) | ||
* @return void | ||
*/ | ||
@RequestLine("POST /fake") | ||
@Headers({ | ||
"Content-type: application/x-www-form-urlencoded", | ||
"Accepts: application/json", | ||
}) | ||
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); | ||
} |
14 changes: 14 additions & 0 deletions
14
samples/client/petstore/java/okhttp-gson/docs/EnumClass.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
# EnumClass | ||
|
||
## Enum | ||
|
||
|
||
* `_ABC` (value: `"_abc"`) | ||
|
||
* `_EFG` (value: `"-efg"`) | ||
|
||
* `_XYZ_` (value: `"(xyz)"`) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
# EnumTest | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | ||
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | ||
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | ||
|
||
|
||
<a name="EnumStringEnum"></a> | ||
## Enum: EnumStringEnum | ||
Name | Value | ||
---- | ----- | ||
UPPER | "UPPER" | ||
LOWER | "lower" | ||
|
||
|
||
<a name="EnumIntegerEnum"></a> | ||
## Enum: EnumIntegerEnum | ||
Name | Value | ||
---- | ----- | ||
NUMBER_1 | 1 | ||
NUMBER_MINUS_1 | -1 | ||
|
||
|
||
<a name="EnumNumberEnum"></a> | ||
## Enum: EnumNumberEnum | ||
Name | Value | ||
---- | ----- | ||
NUMBER_1_DOT_1 | 1.1 | ||
NUMBER_MINUS_1_DOT_2 | -1.2 | ||
|
||
|
||
|
Oops, something went wrong.