Skip to content

Generate Schema for getters without corresponding fields #380

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

You must be logged in to vote

HI @nickkhine,

I suggest you have a look at the documentation:
https://victools.github.io/jsonschema-generator/#generator-options

Since you're using the OptionPreset.PLAIN_JSON, you're missing the Option.NONSTATIC_NONVOID_NONGETTER_METHODS by default, which you should add explicitly in order for the getFieldThatWillNotGenerate() method to be considered.

Regarding the naming, Option.FIELDS_DERIVED_FROM_ARGUMENTFREE_METHODS would take care of your example.
The JacksonModule would use the @JsonProperty annotation's value instead if it is present.

However, this may include methods you don't want to be reflected in your JSON Schema (such as toString()).
Therefore you could either use the Jacks…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nickkhine
Comment options

Answer selected by nickkhine
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