-
-
Notifications
You must be signed in to change notification settings - Fork 229
Description
Why do we need this improvement?
Currently, when using the Java generator in Modelina, properties defined as type: string with format: uuid in the schema are mapped to plain String fields in the generated Java classes. However, for better type safety and semantic correctness, it would be preferable to map such fields to the java.util.UUID type.
Given this schema:
type: object
properties:
id:
type: string
format: uuid
Currently, Modelina generates:
public class MyModel {
private String id;
}
Expected:
public class MyModel {
private java.util.UUID id;
}
Thank you for considering this enhancement!
How will this change help?
java.util.UUID provides stronger type-safety and utility methods compared to raw String.
This would align better with Java conventions for representing UUIDs.
Screenshots
No response
How could it be implemented/designed?
I think the implementation should go there:
https://github.com/asyncapi/modelina/blob/master/src/generators/java/JavaConstrainer.ts#L171
🚧 Breaking changes
No
👀 Have you checked for similar open issues?
- I checked and didn't find a similar issue
🏢 Have you read the Contributing Guidelines?
- I have read the Contributing Guidelines
Are you willing to work on this issue?
No, someone else can work on it.