-
-
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
[java][spring] Process fields of POJOs recursively #19630
base: master
Are you sure you want to change the base?
Conversation
2) baseType is used in case of containers (temporary) 3) openApiNullable is not needed for useOptional
2) Reformat tables (compatibility)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this not change any of the generated samples? I would have expected if it's changing how the fields are processed some of the samples would have changed - or one should be added?
@DatApplePy Don't need to add different extensions for decimal and int values, It is enough to add Need to remove Also you can add support |
@altro3 Nice catch, thanks! I'm gonna take care of them :D |
Hi @DatApplePy, thank you for the PR! I appreciate your effort and enthusiasm. Among your improvements unfortunately I also see a couple of problems:
As a way forward to get things merged, I'd like to suggest this: Maybe you can break your changes into smaller PRs. Since your original issue was about custom validation messages, maybe change only this aspect in the first PR. By the way, I am wondering if you could maybe simply include the custom messages in the annotations that we generate as string e.g. here. Something vaguely like Again, thanks for your work! I'm looking forward to having your improvements merged. If you would like some more input along the way, you can reach me on Slack. |
Hi @martin-mfg!
If we combine The reason that NotNull appeared in new places is that I removed the use of beanValidationCore in pojo.mustache and nullableDataTypeBeanValidation.mustache and put beanValidation in their place. |
Reply to part 2 of @martin-mfg comment |
Fixes #19601 (and fixes #19557) | [REQ][Java][Spring] Process and generate variables/objects (and their annotations) recursively in mustache
1st round
@Valid
if it's a model@NotNull
only if the field is required and not nullable2nd round
getTypeDeclaration
clone
inCodegenProperty
to get proper deep copiesOptional.of(...)
for default valuesisResolvedEnum
toCodegenProperty
to decide whether the enum itself can be used as a type, or its base type should be used@cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) @martin-mfg (2023/08)
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)