In a Microprofile / Quarkus project using Kotlin have a data class with a variable of type Instant.
@Schema(name = "Vehicle", description = "POJO that represents a vehicle at a specific time.")
data class VehicleDTO(
var time: Instant = Instant.EPOCH
)
The problem is that the generated openapi schema does not represent how the value of Instant is actually transmitted.
The schema looks like the following, whereas it is simply represented as a string like that: 2015-06-02T21:34:33.616Z.
Instant:
type: object
properties:
nanos:
format: int32
type: integer
seconds:
format: int64
type: integer
epochSecond:
format: int64
type: integer
nano:
format: int32
type: integer
I already tried to annotate the data class to use the implementation string and type string, but it does not change anything.
@Schema(name = "Vehicle", description = "POJO that represents a vehicle at a specific time.")
data class VehicleDTO(
@Schema(implementation = String::class, type = SchemaType.STRING)
var time: Instant = Instant.EPOCH
)