forked from loafle/openapi-generator-original
Refactor default and example values in Java generators (#1045)
* fix default, example for java okhttp * update java feign samples * update samples, doc * add new doc for dart-jaguar * update model template * update jaxrs spec model * update resteasy sample * update java samples
This commit is contained in:
@@ -357,18 +357,18 @@ http_basic_test.setPassword("YOUR PASSWORD");
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
BigDecimal number = new BigDecimal(); // BigDecimal | None
|
||||
Double _double = 3.4D; // Double | None
|
||||
String patternWithoutDelimiter = "null"; // String | None
|
||||
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
byte[] _byte = null; // byte[] | None
|
||||
Integer integer = null; // Integer | None
|
||||
Integer int32 = null; // Integer | None
|
||||
Long int64 = nullL; // Long | None
|
||||
Float _float = nullF; // Float | None
|
||||
String string = "null"; // String | None
|
||||
File binary = new File("null"); // File | None
|
||||
Integer integer = 56; // Integer | None
|
||||
Integer int32 = 56; // Integer | None
|
||||
Long int64 = 56L; // Long | None
|
||||
Float _float = 3.4F; // Float | None
|
||||
String string = "string_example"; // String | None
|
||||
File binary = new File("/path/to/file"); // File | None
|
||||
LocalDate date = new LocalDate(); // LocalDate | None
|
||||
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None
|
||||
String password = "null"; // String | None
|
||||
String paramCallback = "null"; // String | None
|
||||
String password = "password_example"; // String | None
|
||||
String paramCallback = "paramCallback_example"; // String | None
|
||||
try {
|
||||
apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
|
||||
} catch (ApiException e) {
|
||||
@@ -381,20 +381,20 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**number** | **BigDecimal**| None | [default to null]
|
||||
**_double** | **Double**| None | [default to null]
|
||||
**patternWithoutDelimiter** | **String**| None | [default to null]
|
||||
**_byte** | **byte[]**| None | [default to null]
|
||||
**integer** | **Integer**| None | [optional] [default to null]
|
||||
**int32** | **Integer**| None | [optional] [default to null]
|
||||
**int64** | **Long**| None | [optional] [default to null]
|
||||
**_float** | **Float**| None | [optional] [default to null]
|
||||
**string** | **String**| None | [optional] [default to null]
|
||||
**binary** | **File**| None | [optional] [default to null]
|
||||
**date** | **LocalDate**| None | [optional] [default to null]
|
||||
**dateTime** | **OffsetDateTime**| None | [optional] [default to null]
|
||||
**password** | **String**| None | [optional] [default to null]
|
||||
**paramCallback** | **String**| None | [optional] [default to null]
|
||||
**number** | **BigDecimal**| None |
|
||||
**_double** | **Double**| None |
|
||||
**patternWithoutDelimiter** | **String**| None |
|
||||
**_byte** | **byte[]**| None |
|
||||
**integer** | **Integer**| None | [optional]
|
||||
**int32** | **Integer**| None | [optional]
|
||||
**int64** | **Long**| None | [optional]
|
||||
**_float** | **Float**| None | [optional]
|
||||
**string** | **String**| None | [optional]
|
||||
**binary** | **File**| None | [optional]
|
||||
**date** | **LocalDate**| None | [optional]
|
||||
**dateTime** | **OffsetDateTime**| None | [optional]
|
||||
**password** | **String**| None | [optional]
|
||||
**paramCallback** | **String**| None | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -425,9 +425,9 @@ To test enum parameters
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
List<String> enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List<String> | Header parameter enum test (string array)
|
||||
List<String> enumHeaderStringArray = Arrays.asList("$"); // List<String> | Header parameter enum test (string array)
|
||||
String enumHeaderString = "-efg"; // String | Header parameter enum test (string)
|
||||
List<String> enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List<String> | Query parameter enum test (string array)
|
||||
List<String> enumQueryStringArray = Arrays.asList("$"); // List<String> | Query parameter enum test (string array)
|
||||
String enumQueryString = "-efg"; // String | Query parameter enum test (string)
|
||||
Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double)
|
||||
Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
|
||||
@@ -451,7 +451,7 @@ Name | Type | Description | Notes
|
||||
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||
**enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2]
|
||||
**enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
|
||||
**enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
|
||||
**enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $]
|
||||
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||
|
||||
### Return type
|
||||
@@ -523,8 +523,8 @@ test json serialization of form data
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
String param = "null"; // String | field1
|
||||
String param2 = "null"; // String | field2
|
||||
String param = "param_example"; // String | field1
|
||||
String param2 = "param2_example"; // String | field2
|
||||
try {
|
||||
apiInstance.testJsonFormData(param, param2);
|
||||
} catch (ApiException e) {
|
||||
@@ -537,8 +537,8 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**param** | **String**| field1 | [default to null]
|
||||
**param2** | **String**| field2 | [default to null]
|
||||
**param** | **String**| field1 |
|
||||
**param2** | **String**| field2 |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi();
|
||||
List<String> status = Arrays.asList("status_example"); // List<String> | Status values that need to be considered for filter
|
||||
List<String> status = Arrays.asList("available"); // List<String> | Status values that need to be considered for filter
|
||||
try {
|
||||
List<Pet> result = apiInstance.findPetsByStatus(status);
|
||||
System.out.println(result);
|
||||
@@ -194,7 +194,7 @@ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi();
|
||||
List<String> tags = Arrays.asList("tags_example"); // List<String> | Tags to filter by
|
||||
List<String> tags = Arrays.asList(); // List<String> | Tags to filter by
|
||||
try {
|
||||
List<Pet> result = apiInstance.findPetsByTags(tags);
|
||||
System.out.println(result);
|
||||
@@ -351,8 +351,8 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi();
|
||||
Long petId = 56L; // Long | ID of pet that needs to be updated
|
||||
String name = "null"; // String | Updated name of the pet
|
||||
String status = "null"; // String | Updated status of the pet
|
||||
String name = "name_example"; // String | Updated name of the pet
|
||||
String status = "status_example"; // String | Updated status of the pet
|
||||
try {
|
||||
apiInstance.updatePetWithForm(petId, name, status);
|
||||
} catch (ApiException e) {
|
||||
@@ -366,8 +366,8 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet that needs to be updated |
|
||||
**name** | **String**| Updated name of the pet | [optional] [default to null]
|
||||
**status** | **String**| Updated status of the pet | [optional] [default to null]
|
||||
**name** | **String**| Updated name of the pet | [optional]
|
||||
**status** | **String**| Updated status of the pet | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -405,8 +405,8 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi();
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "null"; // String | Additional data to pass to server
|
||||
File file = new File("null"); // File | file to upload
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
|
||||
System.out.println(result);
|
||||
@@ -421,8 +421,8 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
|
||||
**file** | **File**| file to upload | [optional] [default to null]
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -460,8 +460,8 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi();
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
File requiredFile = new File("null"); // File | file to upload
|
||||
String additionalMetadata = "null"; // String | Additional data to pass to server
|
||||
File requiredFile = new File("/path/to/file"); // File | file to upload
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||
System.out.println(result);
|
||||
@@ -476,8 +476,8 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Long**| ID of pet to update |
|
||||
**requiredFile** | **File**| file to upload | [default to null]
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
|
||||
**requiredFile** | **File**| file to upload |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ Creates list of users with given input array
|
||||
|
||||
|
||||
UserApi apiInstance = new UserApi();
|
||||
List<User> user = Arrays.asList(new List()); // List<User> | List of user object
|
||||
List<User> user = Arrays.asList(null); // List<User> | List of user object
|
||||
try {
|
||||
apiInstance.createUsersWithArrayInput(user);
|
||||
} catch (ApiException e) {
|
||||
@@ -114,7 +114,7 @@ Creates list of users with given input array
|
||||
|
||||
|
||||
UserApi apiInstance = new UserApi();
|
||||
List<User> user = Arrays.asList(new List()); // List<User> | List of user object
|
||||
List<User> user = Arrays.asList(null); // List<User> | List of user object
|
||||
try {
|
||||
apiInstance.createUsersWithListInput(user);
|
||||
} catch (ApiException e) {
|
||||
|
||||
Reference in New Issue
Block a user