Documentation about how to change the behaviour of Endpoint Generator is basically nonexistent.
The documentation states
Designed to be flexible: all parts of the generator are pluggable, which allows you to alter the default behavior or add a new one.
Source: Endpoint Generator | Reference | React | Hilla Docs
I am using OffsetDateTime in a spring data projection and also have openapi generation running via springdoc-openapi. This api doc maps OffsetDateTime and also duration correctly:
"timestamp": {
"type": "string",
"format": "date-time"
}
"duration": {
"type": "object",
"properties": {
"seconds": {
"type": "integer",
"format": "int64"
},
"zero": {
"type": "boolean"
},
"nano": {
"type": "integer",
"format": "int32"
},
"negative": {
"type": "boolean"
},
"positive": {
"type": "boolean"
},
"units": {
"type": "array",
"items": {
"type": "object",
"properties": {
"durationEstimated": {
"type": "boolean"
},
"timeBased": {
"type": "boolean"
},
"dateBased": {
"type": "boolean"
}
}
}
}
}
}
But Hilla based its endpoint generation on this openapi json
"timestamp" : {
"type" : "object",
"x-java-type" : "java.time.OffsetDateTime"
},
"duration" : {
"type" : "object",
"x-java-type" : "java.time.Duration"
},
As far as I can tell the culprit is this code in ClassInfoModel.java
private static final Class<?>[] DATE_TIME_CLASSES = { LocalDateTime.class,
Instant.class, LocalTime.class };
But in an hour of searching I was not able to find how to change this “flexible” but very very lackingly documented architecture.
Can anyone here help me with this?