Closed ChristophB closed 2 years ago
For selected properties, we could introduce a custom time mapping:
DateTimeValue:
allOf:
- $ref: "#/components/schemas/Value"
- type: object
properties:
value:
type: string
format: x-local-date-time # <= custom format
And in pom.xml:
<typeMappings>
<typeMapping>x-local-date-time=java.time.LocalDateTime</typeMapping>
</typeMappings>
relevant properties for custom format mapping:
DateTimeRestriction.values
itemsDateTimeValue.value
DateTimeConstant.value
Requested Changes
Some properties in the top-api schema are timezone independent. They should be mapped to
java.time.LocalDateTime
.e.g.: date-time value in a derived phenotype's expression
Problems
This timezone independence does not apply to all date-time values. Some values exchanged via API indeed need a timezone! (e.g. create/update date-time of phenotypes)
We can only set the mapping to a Java class via global generator configuration option
<dateLibrary>java8-localdatetime</dateLibrary>
and this is not recommended for JDK 1.8+ (see java spring generator docs).