I'm using OpenAPI Generator to create a client, but when I trying to make a POST request is serialized the LocalDateTime like a integer array, looks like
{
"startDate": [ 2019, 11, 13, 0, 0 ],
"endDate": [ 2020, 12, 31, 0, 0 ]
}
I'm waiting for this result, parse like a ISO string
{
"startDate": "2019-11-13T00:00",
"endDate": "2020-12-31T00:00"
}
My gradle configuration is this:
dependencies {
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.3'
classpath 'org.openapitools:openapi-generator-gradle-plugin:4.2.3'
}
task generateClientDS(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
inputSpec = "$rootDir/specifications/client-ds.yaml".toString()
outputDir = "$rootDir".toString()
generatorName = 'java'
library = 'resttemplate'
apiPackage = 'com.example.gen.clients.clientds.api'
modelPackage = 'com.example.gen.clients.clientds.dto'
modelNameSuffix = 'DTO'
configOptions = [
hideGenerationTimestamp: 'true',
dateLibrary: 'java8'
]
typeMappings = [
OffsetDateTime: 'java.time.LocalDateTime'
]
}
application.properties
spring.jackson.serialization.write-dates-as-timestamps=false
I've even added it as been but it doesn't work, any idea what is wrong?