forked from loafle/openapi-generator-original
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:
@@ -239,7 +239,7 @@ public class Example {
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
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 {
|
||||
BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
|
||||
System.out.println(result);
|
||||
@@ -568,7 +568,7 @@ public class Example {
|
||||
http_basic_test.setPassword("YOUR PASSWORD");
|
||||
|
||||
FakeApi apiInstance = new FakeApi(defaultClient);
|
||||
BigDecimal number = new BigDecimal(); // BigDecimal | None
|
||||
BigDecimal number = new BigDecimal(78); // BigDecimal | None
|
||||
Double _double = 3.4D; // Double | None
|
||||
String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
byte[] _byte = null; // byte[] | None
|
||||
@@ -579,7 +579,7 @@ public class Example {
|
||||
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
|
||||
OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None
|
||||
String password = "password_example"; // String | None
|
||||
String paramCallback = "paramCallback_example"; // String | None
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user