[java][spring] Process fields of POJOs recursively#19630
[java][spring] Process fields of POJOs recursively#19630DatApplePy wants to merge 64 commits intoOpenAPITools:masterfrom
Conversation
2) baseType is used in case of containers (temporary) 3) openApiNullable is not needed for useOptional
2) Reformat tables (compatibility)
welshm
left a comment
There was a problem hiding this comment.
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 |
|
Due to lack of free time, I am unable to complete this change. I am very sorry to have to say this after months of waiting. Unfortunately, the code is confusing enough that such a change cannot be easily resolved in a way that is readable and maintainable in the future (in my opinion). |
Fixes #19601 (and fixes #19557) | [REQ][Java][Spring] Process and generate variables/objects (and their annotations) recursively in mustache
1st round
@Validif it's a model@NotNullonly if the field is required and not nullable2nd round
getTypeDeclarationcloneinCodegenPropertyto get proper deep copiesOptional.of(...)for default valuesisResolvedEnumtoCodegenPropertyto 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.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)