Improve generated Java examples (#8012)

* Add basic types imports to generated examples

This adds an extension to include basic types imports to generated Java
examples.

* Make some fixes to example generation

* Generate OffsetDatetime correctly

* Create a useful sample for enums, regenerate samples

* Fix BigDecimal as well
This commit is contained in:
Thomas Hervé 2020-11-26 11:14:26 +01:00 committed by GitHub
parent 157ad1ce73
commit 616b44f3b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 142 additions and 70 deletions

View File

@ -21,10 +21,12 @@ import com.google.common.base.Strings;
import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.PathItem; import io.swagger.v3.oas.models.PathItem;
import io.swagger.v3.oas.models.examples.Example;
import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.ArraySchema;
import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.ComposedSchema;
import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.parameters.Parameter;
import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.parser.util.SchemaTypeUtil; import io.swagger.v3.parser.util.SchemaTypeUtil;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
@ -931,6 +933,37 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return super.toDefaultValue(schema); return super.toDefaultValue(schema);
} }
/**
* Return the example value of the parameter. Overrides the
* setParameterExampleValue(CodegenParameter, Parameter) method in
* DefaultCodegen to always call setParameterExampleValue(CodegenParameter)
* in this class, which adds single quotes around strings from the
* x-example property.
*
* @param codegenParameter Codegen parameter
* @param parameter Parameter
*/
@Override
public void setParameterExampleValue(CodegenParameter codegenParameter, Parameter parameter) {
if (parameter.getExample() != null) {
codegenParameter.example = parameter.getExample().toString();
}
if (parameter.getExamples() != null && !parameter.getExamples().isEmpty()) {
Example example = parameter.getExamples().values().iterator().next();
if (example.getValue() != null) {
codegenParameter.example = example.getValue().toString();
}
}
Schema schema = parameter.getSchema();
if (schema != null && schema.getExample() != null) {
codegenParameter.example = schema.getExample().toString();
}
setParameterExampleValue(codegenParameter);
}
@Override @Override
public void setParameterExampleValue(CodegenParameter p) { public void setParameterExampleValue(CodegenParameter p) {
String example; String example;
@ -959,15 +992,17 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
if (example == null) { if (example == null) {
example = "56"; example = "56";
} }
example = example + "L"; example = StringUtils.appendIfMissingIgnoreCase(example, "L");
} else if ("Float".equals(type)) { } else if ("Float".equals(type)) {
if (example == null) { if (example == null) {
example = "3.4"; example = "3.4";
} }
example = example + "F"; example = StringUtils.appendIfMissingIgnoreCase(example, "F");
} else if ("Double".equals(type)) { } else if ("Double".equals(type)) {
if (example == null) {
example = "3.4"; example = "3.4";
example = example + "D"; }
example = StringUtils.appendIfMissingIgnoreCase(example, "D");
} else if ("Boolean".equals(type)) { } else if ("Boolean".equals(type)) {
if (example == null) { if (example == null) {
example = "true"; example = "true";
@ -979,6 +1014,14 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
example = "new File(\"" + escapeText(example) + "\")"; example = "new File(\"" + escapeText(example) + "\")";
} else if ("Date".equals(type)) { } else if ("Date".equals(type)) {
example = "new Date()"; example = "new Date()";
} else if ("OffsetDateTime".equals(type)) {
example = "OffsetDateTime.now()";
} else if ("BigDecimal".equals(type)) {
example = "new BigDecimal(78)";
} else if (p.allowableValues != null && !p.allowableValues.isEmpty()) {
Map<String, Object> allowableValues = p.allowableValues;
List<Object> values = (List<Object>) allowableValues.get("values");
example = type + ".fromValue(\"" + String.valueOf(values.get(0)) + "\")";
} else if (!languageSpecificPrimitives.contains(type)) { } else if (!languageSpecificPrimitives.contains(type)) {
// type is a model class, e.g. User // type is a model class, e.g. User
example = "new " + type + "()"; example = "new " + type + "()";
@ -1141,6 +1184,18 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
itr.remove(); itr.remove();
} }
} }
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation op : operationList) {
Collection<String> operationImports = new TreeSet<String>();
for (CodegenParameter p : op.allParams) {
if (importMapping.containsKey(p.dataType)) {
operationImports.add(importMapping.get(p.dataType));
}
}
op.vendorExtensions.put("x-java-import", operationImports);
}
return objs; return objs;
} }

View File

@ -28,6 +28,9 @@ Method | HTTP request | Description
### Example ### Example
```java ```java
{{#vendorExtensions.x-java-import}}
import {{.}};
{{/vendorExtensions.x-java-import}}
// Import classes: // Import classes:
import {{{invokerPackage}}}.ApiClient; import {{{invokerPackage}}}.ApiClient;
import {{{invokerPackage}}}.ApiException; import {{{invokerPackage}}}.ApiException;

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -226,6 +226,7 @@ Test serialization of outer number types
### Example ### Example
```java ```java
import java.math.BigDecimal;
// Import classes: // Import classes:
import org.openapitools.client.ApiClient; import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException; import org.openapitools.client.ApiException;
@ -239,7 +240,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -552,6 +553,10 @@ Fake endpoint for testing various parameters
### Example ### Example
```java ```java
import java.io.File;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
// Import classes: // Import classes:
import org.openapitools.client.ApiClient; import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException; import org.openapitools.client.ApiException;
@ -571,7 +576,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -582,7 +587,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -520,6 +520,7 @@ uploads an image
### Example ### Example
```java ```java
import java.io.File;
// Import classes: // Import classes:
import org.openapitools.client.ApiClient; import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException; import org.openapitools.client.ApiException;
@ -592,6 +593,7 @@ uploads an image (required)
### Example ### Example
```java ```java
import java.io.File;
// Import classes: // Import classes:
import org.openapitools.client.ApiClient; import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException; import org.openapitools.client.ApiException;

View File

@ -487,7 +487,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
CompletableFuture<BigDecimal> result = apiInstance.fakeOuterNumberSerialize(body); CompletableFuture<BigDecimal> result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result.get()); System.out.println(result.get());
@ -554,7 +554,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
CompletableFuture<ApiResponse<BigDecimal>> response = apiInstance.fakeOuterNumberSerializeWithHttpInfo(body); CompletableFuture<ApiResponse<BigDecimal>> response = apiInstance.fakeOuterNumberSerializeWithHttpInfo(body);
System.out.println("Status code: " + response.get().getStatusCode()); System.out.println("Status code: " + response.get().getStatusCode());
@ -1204,7 +1204,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -1215,7 +1215,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {
@ -1303,7 +1303,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -1314,7 +1314,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -459,7 +459,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -525,7 +525,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
ApiResponse<BigDecimal> response = apiInstance.fakeOuterNumberSerializeWithHttpInfo(body); ApiResponse<BigDecimal> response = apiInstance.fakeOuterNumberSerializeWithHttpInfo(body);
System.out.println("Status code: " + response.getStatusCode()); System.out.println("Status code: " + response.getStatusCode());
@ -1131,7 +1131,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -1142,7 +1142,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {
@ -1229,7 +1229,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -1240,7 +1240,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -228,7 +228,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -542,7 +542,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -553,7 +553,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -228,7 +228,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -542,7 +542,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -553,7 +553,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
AsyncFile binary = new AsyncFile(); // AsyncFile | None AsyncFile binary = new AsyncFile(); // AsyncFile | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
AsyncFile binary = new AsyncFile(); // AsyncFile | None AsyncFile binary = new AsyncFile(); // AsyncFile | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -239,7 +239,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -568,7 +568,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -579,7 +579,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -222,6 +222,7 @@ Test serialization of outer number types
### Example ### Example
```java ```java
import java.math.BigDecimal;
// Import classes: // Import classes:
import org.openapitools.client.ApiClient; import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException; import org.openapitools.client.ApiException;
@ -235,7 +236,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -608,6 +609,10 @@ Fake endpoint for testing various parameters
### Example ### Example
```java ```java
import java.io.File;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
// Import classes: // Import classes:
import org.openapitools.client.ApiClient; import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException; import org.openapitools.client.ApiException;
@ -627,7 +632,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -638,7 +643,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {

View File

@ -521,6 +521,7 @@ uploads an image
### Example ### Example
```java ```java
import java.io.File;
// Import classes: // Import classes:
import org.openapitools.client.ApiClient; import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException; import org.openapitools.client.ApiException;
@ -593,6 +594,7 @@ uploads an image (required)
### Example ### Example
```java ```java
import java.io.File;
// Import classes: // Import classes:
import org.openapitools.client.ApiClient; import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException; import org.openapitools.client.ApiException;

View File

@ -451,7 +451,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
System.out.println(result); System.out.println(result);
@ -517,7 +517,7 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
try { try {
ApiResponse<BigDecimal> response = apiInstance.fakeOuterNumberSerializeWithHttpInfo(body); ApiResponse<BigDecimal> response = apiInstance.fakeOuterNumberSerializeWithHttpInfo(body);
System.out.println("Status code: " + response.getStatusCode()); System.out.println("Status code: " + response.getStatusCode());
@ -1245,7 +1245,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -1256,7 +1256,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {
@ -1343,7 +1343,7 @@ public class Example {
http_basic_test.setPassword("YOUR PASSWORD"); http_basic_test.setPassword("YOUR PASSWORD");
FakeApi apiInstance = new FakeApi(defaultClient); FakeApi apiInstance = new FakeApi(defaultClient);
BigDecimal number = new BigDecimal(); // BigDecimal | None BigDecimal number = new BigDecimal(78); // BigDecimal | None
Double _double = 3.4D; // Double | None Double _double = 3.4D; // Double | None
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
byte[] _byte = null; // byte[] | None byte[] _byte = null; // byte[] | None
@ -1354,7 +1354,7 @@ public class Example {
String string = "string_example"; // String | None String string = "string_example"; // String | None
File binary = new File("/path/to/file"); // File | None File binary = new File("/path/to/file"); // File | None
LocalDate date = new LocalDate(); // LocalDate | None LocalDate date = new LocalDate(); // LocalDate | None
OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
String password = "password_example"; // String | None String password = "password_example"; // String | None
String paramCallback = "paramCallback_example"; // String | None String paramCallback = "paramCallback_example"; // String | None
try { try {