-
Notifications
You must be signed in to change notification settings - Fork 91
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
Schema-annotation: add property addJavaDoc
#2090
Comments
In my company, we check with CheckStyle that methods have full Javadoc. However, when a method is well documented with OpenAPI, that's not necessary (DRY, as you stated). So we just annotate the following: @SuppressWarnings("javadoc") // Documented with OpenAPI |
This is really a bad workaround. What about the Javadoc for such properites/getters/setters -you don't have one. |
I'm pretty sure this issue has been raised before. The main problem is that when scanning annotations, the source code (and JavaDoc comments) are no longer available. There might be a way to do this in the Maven plugin where the comments are preprocessed, but I haven't seen any obvious solution yet. |
We don't document private properties, we document getters and setters, since they are public. |
It is a pity, I don't know much about it, I thought it would be possible somehow with an annotation preprocessor. After all, smallrye has access to the classes and the code.
This would be a valuable solution. Imagine a I think when generating from Java to OpenAPI such important things (like setting the |
Other possible solutions:
|
Yes, it seems feasible [1] using an annotation processor, or the Maven |
@MikeEdgar It would be great to have something like that. Can you do it? |
@nimo23 I won't have the time for it anytime soon due to competing priorities. We always welcome contributions from the community if you have the spare cycles to give it a try. |
I already tried and played with
But unfortunately I don't know anything about all these APIs and don't know the subtle connections between these APIs (e.g. Element<->Field) and Smallrye (compilation, process-sources, etc.) in order to be able to provide useful results here. I have to wait until someone with relevant experience has time for this issue. |
Currently, I need to duplicate existing Javadoc from the property into the
Schema.description
tag. This is very annoying and hurts DRY (don’t repeat yourself). It fills the Java class with redundant data and is worse for maintenance, etc..:Please add a new property for the
Schema
-Tag, e.g.addJavaDoc = true | false
. If the value is set to true, the Javadoc is appended to the OpenAPIdescription
value:For example:
another example using both
addJavaDoc
and an explicitdescription
that simply appends the Javadoc after the description value (in this case: "My description. The description page..."):The Javadoc can contain html-tags or Markdown-Syntax (https://openjdk.org/jeps/467) which needs to be considered when putting this in the openapi
description
value.The text was updated successfully, but these errors were encountered: