Skip to content

Add null to enum definition #212

Closed Answered by CarstenWickner
enthimema asked this question in Q&A
Discussion options

You must be logged in to vote

Hello again @enthimema,

First of all, as already hinted at above (and described explicitly on #213), the handling of null values on enum types had a bug.
A bug fix was created and just released in v4.21.0.
Therefore, please update the jsonschema-generator dependencies accordingly.

Secondly, your configuration is not quite right yet.

  1. The @Null annotation (according to its JavaDoc) is supposed to be used for fields that are always null. It is therefore the incorrect choice (even though the resulting schema is not reflecting that interpretation, but I didn't bother "fixing" that now as well. There is a @javax.validation.Nullable annotation, which Is probably what you had in mind, but that's…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@enthimema
Comment options

@CarstenWickner
Comment options

@enthimema
Comment options

Comment options

You must be logged in to vote
2 replies
@enthimema
Comment options

@enthimema
Comment options

Answer selected by CarstenWickner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants