Closed unkish closed 1 year ago
I know I recommended this, but I think with this change we will see a new javadoc warning:
warning: no @param for somearg
For any argument that doesn't have @param
.
So we get a warning for no param, and we get a warning for param without description. So we're a bit stuck if we don't have a description :thinking: Making up some junk (like "The somearg value"
) seems pointless too.
I've been thinking about it and couldn't come up with any "ideal" solutions, so far following "ideas" where on the table:
@param somearg somearg
"The somearg value"
On reflection I think the way you have implemented this is correct. We should omit any param that has no description.
If you see a warning telling you that you have not documented some parameters, then this warning is accurate, and you can fix it by documenting the parameter (add title and/or description).
For a moment I've thought that people might start complaining about schema being an external to their project and them being unable/not allowed to modify it.
But change wouldn't make it worse (granted that warning and not error will be emitted) as currently we produce Javadoc without @param
description that also generates warning.
@unkish This is the last one for 1.2.0 I think. Could you rebase and I will merge?
An observation not related to given task.
There has been a change
https://github.com/joelittlejohn/jsonschema2pojo/blob/02d6017c08a092b72a177c4e5e6b9dc3a5d1124c/jsonschema2pojo-gradle-plugin/src/main/groovy/org/jsonschema2pojo/gradle/GenerateJsonSchemaJavaTask.groovy#L56
However configuration
is defined as:
https://github.com/joelittlejohn/jsonschema2pojo/blob/02d6017c08a092b72a177c4e5e6b9dc3a5d1124c/jsonschema2pojo-gradle-plugin/src/main/groovy/org/jsonschema2pojo/gradle/GenerateJsonSchemaJavaTask.groovy#L34
and setTargetVersion
accepts JsonSchemaExtension
(which is a implementation of GenerationConfig
)
https://github.com/joelittlejohn/jsonschema2pojo/blob/02d6017c08a092b72a177c4e5e6b9dc3a5d1124c/jsonschema2pojo-gradle-plugin/src/main/groovy/org/jsonschema2pojo/gradle/GenerateJsonSchemaJavaTask.groovy#L85
Is gradle doing some trickery that this won't be failing in runtime ?
UPD: Probably is fine as configuration = project.jsonSchema2Pojo
Add Javadoc to constructors parameters which have corresponding documented properties. Properties that are not documented (do not have
title
ordescription
) won't be added to constructors Javadoc.Following format will be used:
Closes #1463