You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In our APIs we have parameters which are not required but if they are sent they should not be null. We need they to not be required but not being nullable.
Example ( in Kotlin ):
class PostRequest(
.....
@field:Schema(required = false, description = COLLATERALS_DESCRIPTION, defaultValue = "[]")
@field:NotNull
val collaterals: List<CollateralRequest> = listOf()
)
In this example the field collaterals is initialized with an empty array if it was not present in the request body but if the client send it it should not be null.
Because we put required = false at the schema annotation.
Describe the solution you'd like
I would like that the required attribute of the schema annotation had precedence before the @NotNull or even that the non-nullable types in Kotlin
Describe alternatives you've considered
I didn't found an alternative
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
In our APIs we have parameters which are not required but if they are sent they should not be null. We need they to not be required but not being nullable.
Example ( in Kotlin ):
In this example the field collaterals is initialized with an empty array if it was not present in the request body but if the client send it it should not be null.
The generated OpenAPI is something like this:
But it should be:
Because we put required = false at the schema annotation.
Describe the solution you'd like
I would like that the required attribute of the schema annotation had precedence before the @NotNull or even that the non-nullable types in Kotlin
Describe alternatives you've considered
I didn't found an alternative
The text was updated successfully, but these errors were encountered: