diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java index 1115a4b709d9..713a45843d01 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java @@ -93,9 +93,9 @@ public class ExampleGenerator { }; } } else if (property instanceof DateProperty) { - return new java.util.Date(System.currentTimeMillis()); + return "2000-01-23T04:56:07.000+0000"; } else if (property instanceof DateTimeProperty) { - return new java.util.Date(System.currentTimeMillis()); + return "2000-01-23T04:56:07.000+0000"; } else if (property instanceof DecimalProperty) { return new BigDecimal(1.3579); } else if (property instanceof DoubleProperty) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java index 54f022ad1247..3b7700115e18 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java @@ -16,10 +16,8 @@ import io.swagger.models.properties.RefProperty; import io.swagger.models.properties.StringProperty; import org.codehaus.plexus.util.StringUtils; -import java.text.SimpleDateFormat; import java.util.Collection; import java.util.Collections; -import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; @@ -33,8 +31,6 @@ public class XmlExampleGenerator { public static String TAG_END = " examples; - protected SimpleDateFormat dtFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); - protected SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); public XmlExampleGenerator(Map examples) { this.examples = examples; @@ -172,7 +168,7 @@ public class XmlExampleGenerator { if (property.getExample() != null) { return property.getExample().toString(); } else { - return dtFormat.format(new Date()); + return "2000-01-23T04:56:07.000Z"; } } else if (property instanceof StringProperty) { if (property.getExample() != null) { @@ -184,7 +180,7 @@ public class XmlExampleGenerator { if (property.getExample() != null) { return property.getExample().toString(); } else { - return dateFormat.format(new Date()); + return "2000-01-23T04:56:07.000Z"; } } else if (property instanceof IntegerProperty) { if (property.getExample() != null) { diff --git a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift index 23a33a0f2847..befa59da5f5a 100644 --- a/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/PetstoreClient/Classes/Swaggers/APIs/StoreAPI.swift @@ -54,12 +54,12 @@ extension PetstoreClientAPI { "complete" : true, "status" : "aeiou", "quantity" : 123, - "shipDate" : "2016-02-13T08:19:01.757+0000" + "shipDate" : "2000-01-23T04:56:07.000+0000" }, contentType=application/json}, {example= 123456 123456 0 - 2016-02-13T16:19:01.763Z + 2000-01-23T04:56:07.000Z string true , contentType=application/xml}] @@ -69,12 +69,12 @@ extension PetstoreClientAPI { "complete" : true, "status" : "aeiou", "quantity" : 123, - "shipDate" : "2016-02-13T08:19:01.757+0000" + "shipDate" : "2000-01-23T04:56:07.000+0000" }, contentType=application/json}, {example= 123456 123456 0 - 2016-02-13T16:19:01.763Z + 2000-01-23T04:56:07.000Z string true , contentType=application/xml}] @@ -106,12 +106,12 @@ extension PetstoreClientAPI { "complete" : true, "status" : "aeiou", "quantity" : 123, - "shipDate" : "2016-02-13T08:19:01.765+0000" + "shipDate" : "2000-01-23T04:56:07.000+0000" }, contentType=application/json}, {example= 123456 123456 0 - 2016-02-13T16:19:01.766Z + 2000-01-23T04:56:07.000Z string true , contentType=application/xml}] @@ -121,12 +121,12 @@ extension PetstoreClientAPI { "complete" : true, "status" : "aeiou", "quantity" : 123, - "shipDate" : "2016-02-13T08:19:01.765+0000" + "shipDate" : "2000-01-23T04:56:07.000+0000" }, contentType=application/json}, {example= 123456 123456 0 - 2016-02-13T16:19:01.766Z + 2000-01-23T04:56:07.000Z string true , contentType=application/xml}]