I have two java projects that each have classes that I want to use as a Typescript data model in a web application. My java project A is a dependency of project B. In order to generate the java and Typescript template file for project B, I am using maven. In my project B, I have a class that has as a property a class of project A. In the class of project A, I have indicated that a property can be nullable. Unfortunately, my Typescript model file does not seem to take into account the nullable annotation present in my project A. So in my Typescript model file, I do not have the possibility to use the undefined on my property. The nullable annotation is present in my project A.
Sample code:
Project A :
public class DTOA extends Serializable {
@Nullable
private String propANull;
}
Project B :
public class DTOB extends Serializable {
private DTOA propB;
@Nullable
private String propBNull;
}
Typescript template file :
export interface DTOA extends Serializable {
propANull: string;
}
export interface DTOB extends Serializable {
propB: propA;
propBNull ?: string;
}