Open JoeryH opened 3 years ago
Possible duplicate of https://github.com/mbknor/mbknor-jackson-jsonSchema/issues/132
Not sure about Kotlin and val
, but similar thing happens for non-boxed primitives. Basically this field is always present when you're serializing an object, but optional when deserializing. Unfortunately, there's no way to tell jsonSchema which kind of schema you're looking for.
Yeah, I've hit this with primitives as well, maybe it's worth having an config option for not forcing primitives to be required?
This might also be worth making a seperate issue, but if you set a default value for a primitive through the use of @JsonSchemaDefault, it also adds the property as required.
I am using Kotlin, but I think this applies to all languages:
The resulting shema will include this field as required, effectively ignoring the annotation.