Skip to content

Does jsonschema-generator work with any annotation libraries that auto-generate getters? #322

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

You must be logged in to vote

Hi @kanesee,

Lombok and similar libraries are adding getters to the compiled Java byte code. The jsonschema-generator is looking at that byte code, i.e., those auto-generated getters should be treated like any old hand-crafted ones. At least that was my assumption so far.

The jackson @JsonIgnore annotation is being respected, if you include the jsonschema-module-jackson dependency and its corresponding configuration: https://victools.github.io/jsonschema-generator/#jackson-module

configBuilder.with(new JacksonModule());

The challenge in your case appears to be that you expect the @JsonSerialize annotation to provide a drop-in replacement.
While that is not part of the default behavior, yo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
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