-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
How to set optional and mandatory fields on openapi class schemas? #229
Comments
By default, we're marking nullable fields as optional fields and non-nullalbe fields as required (based on Kotlin return types or @JsonSchema(requireNonNulls = false)
data class Entity(
val wontBeRequired: String
@OpenApiRequired
val willBeRequired: String
) |
for example @jsonschema(requireNonNulls = true) fist field is still marked as optional in openapi file |
@OpenApiRequired is not valid in java |
It seems to be working fine: Lines 398 to 402 in 3d15957
Could you share your code for more details? :) |
Umm
I see you put it on getters and setters as well
I will try
…On Wed, 4 Sept 2024, 21:54 dzikoysk, ***@***.***> wrote:
It seems to be working fine:
https://github.com/javalin/javalin-openapi/blob/3d159578951461165961e21af3460a1adb01954e/examples/javalin-gradle-kotlin/src/main/java/io/javalin/openapi/plugin/test/JavalinTest.java#L398-L402
Could you share your code for more details? :)
—
Reply to this email directly, view it on GitHub
<#229 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMPYYPUZAPJDTR6XPBQNY2LZU5JNRAVCNFSM6AAAAABNUX6VDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRZG43DCNJXG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
We don't support this kind of annotations on fields. There's an open ticket if you'd be interested in keeping an eye on this topic tho: |
How to set optional and mandatory fields on openapi class schemas?
The text was updated successfully, but these errors were encountered: