-
-
Notifications
You must be signed in to change notification settings - Fork 524
Support for non-nullable types in Kotlin #443
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
Comments
The support for non-nullable types in Kotlin will be available on v1.2.32. |
Hi @bnasslahsen , It seems to work for function parameters, but not on the response data classes in the components.schemas section of the openapi document. Kind regards, Frank. |
I noticed that if a class is wrapped within an EntityModel, then it is not able to show non-nullable fields as required. This might be related to #453 . |
It seems that it does not work for request body parameters and responses wrapped with ResponseEntity |
It also does not work for fields with complex types (e.g. another data class) |
@bnasslahsen is it possible to re-open this issue? |
It's all time possible to reopen an issue. |
Unfortunately i have zero PR's in the making. Im just yelling at my backend people :) "It seems to work for function parameters, but not on the response data classes in the components.schemas section of the openapi document." |
For anyone still curious, I was able to solve this by adding |
NB: This is a more specific continuation of issue #269
When generating apidocs from Kotlin data classes the non-nullable fields are not listed as required.
The name property should be in the required list:
There are workarounds like annotating the non-nullable properties with javax.validation.NotNull, but that is too verbose to my taste.
The text was updated successfully, but these errors were encountered: