Is your feature request related to a problem? Please describe.
I would like to use importmapping for the superclasses of generated models. In this case the superclasses are the original classes the openapi schema was made from.
Describe the solution you'd like
Have a non-overriden method in the superclass( a getter with a fixed value rather than variable return). Currently readonly creates a constructor which the superclass does not support.
Avoid @OverRide annotations on all properties not on parent(s). Or avoid the setter returning object entirely.
Describe alternatives you've considered
I'v tried using the normalizer with the REF_AS_PARENT_IN_ALLOF to true.
Leaving the properties in the childclass workarounds the whole @OverRide setters, but would basically be shadowing superclass fields.
Additional context
The problem im trying to solve somehow:
We have a multilayer extends, like Pet -> Lizard -> Snake.
Our original Pet and Lizard classes are annotated with lombok.experimental.Superbuilder. So they dont have public Lizard setPetType(String petType) and other overriden property setters.
If i try to use importmapping for the parentclasses to use the shared originals, the compile breaks on the @OverRide (imported superclass not having self returning setters).
Also i havent found a way for a fixed field. Our Pet equivalent has an abstract get method which has a fixed value impl in our Cat and Lizard equivalent. Lets say
getPetType() {
return "Cat"
}
When i set readOnly in the spec it seems to assume constructor injection for the property. And it would require that constructor for the intermediate superclass.
Is there any normal way around this other than changing the template? I'd rather not have to maintain custom template changes.
I feel it's a shame you can't import the actual original class of the allOf this way, but there might be a valid reason.
Is your feature request related to a problem? Please describe.
I would like to use importmapping for the superclasses of generated models. In this case the superclasses are the original classes the openapi schema was made from.
Describe the solution you'd like
Have a non-overriden method in the superclass( a getter with a fixed value rather than variable return). Currently readonly creates a constructor which the superclass does not support.
Avoid @OverRide annotations on all properties not on parent(s). Or avoid the setter returning object entirely.
Describe alternatives you've considered
I'v tried using the normalizer with the REF_AS_PARENT_IN_ALLOF to true.
Leaving the properties in the childclass workarounds the whole @OverRide setters, but would basically be shadowing superclass fields.
Additional context
The problem im trying to solve somehow:
We have a multilayer extends, like Pet -> Lizard -> Snake.
Our original Pet and Lizard classes are annotated with lombok.experimental.Superbuilder. So they dont have public Lizard setPetType(String petType) and other overriden property setters.
If i try to use importmapping for the parentclasses to use the shared originals, the compile breaks on the @OverRide (imported superclass not having self returning setters).
Also i havent found a way for a fixed field. Our Pet equivalent has an abstract get method which has a fixed value impl in our Cat and Lizard equivalent. Lets say
getPetType() {
return "Cat"
}
When i set readOnly in the spec it seems to assume constructor injection for the property. And it would require that constructor for the intermediate superclass.
Is there any normal way around this other than changing the template? I'd rather not have to maintain custom template changes.
I feel it's a shame you can't import the actual original class of the allOf this way, but there might be a valid reason.