-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQ][Java][Spring] Process and generate variables/objects (and their annotations) recursively in mustache #19601
Comments
Hi @mibarannikov Sorry, but I don't understand your question exactly. What you wrote is correct, that code snippet will be generated from that api spec. Or maybe you got something else, which is not the one you posted here? |
I've already spent 2 days trying to generate such code Set<@pattern(regexp = "^[0-9]{10,15}$") String> testList; what conditions must be met for a set to be generated with a pattern |
I only get Set testList; , no pattern |
Sorry, as soon as I wrote the message, the solution came. Updating the maven plugin to 7.7.0 helped |
we just released v7.10.0 a few days ago. please give it a try when you've time. |
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):
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.
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.
The text was updated successfully, but these errors were encountered: