joelittlejohn / jsonschema2pojo

Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
http://www.jsonschema2pojo.org
Apache License 2.0
6.22k stars 1.66k forks source link

Empty <p> tag #1580

Open RagGren opened 8 months ago

RagGren commented 8 months ago

jsonschema2pojo creates empty <p> tags, if there is a title schema annotation but no further schema annotations.

TitleRule adds a <p> tag to the Javadoc always. If there is no further schema annotation, e.g. typically a description, the paragraph is empty. This causes a Javadoc Warning.

Maybe it would be better to add the <p> tag in the DescriptionRule though I fear this is inadequate and it must be added for other annotations/keywords/extension too (e.g. javaName, $comment, etc.). Probably it might be better to write <p> tags only if really needed, e.g. if there is a title and a description, but it seems that this must be implemented in other classes, like PropertyRule (and others).

Even if it is good style to add both, a title and a description to the JSON Schema, it is also correct to have only one of both (or none of them).