Open doctau opened 5 years ago
Which version are you using? Please try the latest master if you've not yet done so.
I was using 3.3.4, but I'll try master shortly. Thanks
The problem still occurs in 4.0.0-SNAPSHOT
I wanted to create a custom pojo.mustache but model.parentVars is not set either
I also attempted a custom template and parentVars was also empty
isInherited seems like the proper boolean for this and could be used as a backup to parentVars, but it is false even in cases when the var comes from a parent.
was this ever resolved?
When generating a model class which is an allOf, the Java generators make it a subclass (of the first allOf entry anyway) with all the getter/setter methods inherited from the parent. This means that if you are using the fluent setters, the result of calling any inherited setter is the parent not the subclass. It would be useful if it returned the subclass.
For example, consider this fragment
The following code will fail, because Bar.a() returns a Foo instead of a Bar. It would be safe to override the method to return Bar, since covariant return types are allowed in Java.
Bar bar = new Bar().a("a").b("b")
This would make using the fluent setters easier when allOf is used.