Is it possible to override / customize the TS types that Hilla generates for certain classes?
I’m working with MongoDB and want to send their com.bson.ObjectId type (essentially a DB document key) over the wire so I can use AutoCrud / AutoGrid / etc.
Currently Hilla generates an unusable TS type for this based on some internal fields within the class, whereas ideally I’d serialise / deserialise to String as needed.
interface ObjectId {
timestamp: number;
date?: string;
}
export default ObjectId;
I had this problem in the past when using SpringDoc, which generated the exact same OpenAPI types.
I was able to overcome this by customising the Jackson objectMapper to converts the object to/from a string during JSON conversion, along with a SpringDoc customization bean that instructed the OpenAPI generator to treat ObjectIds as Strings within the generated schema.
Is there something similar that I can do to customise the Hilla type generation for third-party types?