OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
This leads to 2 problems (that's all I've found so far):
1) Cannot create and apply custom annotations
2) Custom messages cannot be applied to Jakarta annotations
Describe the solution you'd like
It would be better if the dataTypeWithEnum value of the variables contained only the type of the current schema.
Using the previous example, the result would be this:
This way we can generate these structures recursively and also apply custom annotation and more.
Additional context
Since this issue is the extended form of another issue (#19557), I am already working on the feature.
I planned to implement the feature in two stages:
1) Refactor mustache templates related to this issue
pojo
beanValidation
beanValidationCore
nullableDataType
nullableDataTypeBeanValidation
2) Redesign AbstractJavaCodegen, e.g.
getTypeDeclaration, getTypeDeclarationForArray, getBeanValidation, etc...
I've already done some research and, for example, the ones listed above may change, or they are not needed.
Note: The development process can be slow because I read a lot of documentation (and StackOverFlow) and experiment a lot to make everything work as intended.
Is your feature request related to a problem? Please describe.
Currently, all container objects (List, Set and Map) with their elements are processed as one in the generator (AbstractJavaCodegen). Example:
datatypeWithEnum value of testList:
List<@Size(max = 5) Set<@Pattern(regexp = "^[0-9]{10,15}$") String>>
Generated code:
This leads to 2 problems (that's all I've found so far): 1) Cannot create and apply custom annotations 2) Custom messages cannot be applied to Jakarta annotations
Describe the solution you'd like
It would be better if the
dataTypeWithEnum
value of the variables contained only the type of the current schema. Using the previous example, the result would be this:This way we can generate these structures recursively and also apply custom annotation and more.
Additional context
Since this issue is the extended form of another issue (#19557), I am already working on the feature. I planned to implement the feature in two stages: 1) Refactor mustache templates related to this issue
getTypeDeclaration
,getTypeDeclarationForArray
,getBeanValidation
, etc... I've already done some research and, for example, the ones listed above may change, or they are not needed.Note: The development process can be slow because I read a lot of documentation (and StackOverFlow) and experiment a lot to make everything work as intended.