kbuntrock / openapi-maven-plugin

Generate openapi documentation for SpringMVC or JaxRS/JakartaRS projects.
https://kbuntrock.github.io/openapi-maven-plugin/
MIT License
13 stars 8 forks source link

Improve nullable support for dto fields #111

Closed josve closed 2 months ago

josve commented 3 months ago

The purpose of this change is to allow better control over nullable settings when generating the dto generation.

Basically it add support for configuring if fields should be considered non-nullable by default "defaultNonNullableFields", this is really the most important part of the change as I'm migrating from another tool which had that behavior so having this as a configuration option would really help with migrating.

Then the nullable/nonnull annotations (both will be needed with this new option) currently use the javax version as default which will not work if you have a project migrate to jakarta (or you want to use jetbeans or similar). Therefore I added support for setting custom annotations to indicate what you want to use.

kbuntrock commented 3 months ago

I'm 100% for this functionality, thank you very much for your contribution.

I'm writing a few minor reviews on your MR (but globally I'm very pleased about it since it goes well with the architecture I want for this tool)

And may I ask you from which tools are you migrating?

kbuntrock commented 2 months ago

Replaced by #122 Thanks agin for your work @josve

kbuntrock commented 2 months ago

PS @josve : I've allowed a list of annotation. As for example @NotBlank and @NotEmpty have the same effect than @NotNull on the "required" value.