-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Javadoc for constructors missing "description" on parameters? #1463
Comments
It looks like adding descriptions to constructor's javadoc jsonschema2pojo/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/DescriptionRule.java Lines 60 to 67 in d2f8dea
|
my 2c:
They're probably redundant, so maybe some order? ->
I think if the schema itself doesn't provide a description, then that's a problem with the schema, not this library. Although I could see a solution where it's just the param again to not trigger some javadoc error?
|
Sounds reasonable. @joelittlejohn if you would happen to have a spare minute at some point, would be happy to hear your thoughts on given topic. |
I'd put following as a javadoc. Presented dot after /**
@param title. description.
*/ |
My 2c: the javadoc warning is there for a reason, because I think adding I like what @eirnym proposed, where each part is optional of course, so this kind of thing: /**
* @param {title. }?{description.}?
*/ |
Wouldn't that imply that /**
* {@param {title. }?{description.}?}?
*/ Let's consider simple "artificial" schema: {
"type": "object",
"properties": {
"type": {
"type": "string",
"title": "a title",
"description": "Type lorem ipsum"
},
"id": {
"type": "integer"
}
}
} What would be the expected output in case /**
*
* @param id
*
* @param type
* a type. Type lorem ipsum
*/
public Example(String type, Integer id) {
super();
this.type = type;
this.id = id;
} or /**
*
* @param type
* a type. Type lorem ipsum
*/
public Example(String type, Integer id) {
super();
this.type = type;
this.id = id;
} |
Yes, param itself would be optional. I think from your example the second output would be better. We only include params where we can provide some useful info. Do you find the omission of id in the second example to be odd? |
Saying that it looks a bit odd indeed, I have to admit that I have no strong opinion on whether it's something that should be avoided at any cost. |
thanks y'all! |
I'm using the jsonschema2dataclass gradle plugin (issue clone from jsonschema2dataclass/js2d-gradle#604) but I think this issue is coming from the core library here.
for data like:
a constructor is created like:
Would it make sense to inject the description into the generated javadoc here so we don't get javadoc generation warnings (happens with Temurin Java11) like:
I was hoping the javadoc could include descriptions from the json spec itself and be generated something like:
The text was updated successfully, but these errors were encountered: