OpenAPITools / OpenAPITools/openapi-generator
[REQ] [Java] API classes do not have a sufficient javadoc causing failing builds when running `mvn javadoc:javadoc` with `-Werror` enabled
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
When generating Java servers the API class defined in api.mustache and apiInterface.mustache does not have java doc.
When running mvn javadoc:javadoc this becomes a warning, which due to -Werror becomes an error and the build fails.
This is tested on openjdk version "17.0.9".
A PR is incoming.
Describe the solution you'd like
I propose additions to the api.mustache and apiInterface.mustache files so that there is some javadoc there.
For api.mustache (text borrowed from csharp/api.interface:
/**
* Represents a collection of functions to interact with the API endpoints.
*/
And the same for apiResponse.mustache:
/**
* {{{notes}}}
*
{{#allParams}}
* @param {{paramName}} {{description}}
{{/allParams}}
{{#responses}}
* @return {{{message}}}
{{/responses}}
*/
Describe alternatives you've considered
We've implemented two alternative solutions.
Exclusion in pom.xml
In our pom.xml we can exclude the files, but this is quite a big hammer because the files are very close to passing the checks.
Add a local api.mustache template with the needed changes
This solutions works a little better but requires us to copy the entire api.mustache and apiInterface.mustache files into our repository, making it much more cumbersome to migrate to a future version of openapi-generator.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Java server templates api.mustache, apiInterface.mustache, and apiResponse.mustache. Run mvn javadoc:javadoc with -Werror on a generated server to reproduce the warnings; done means the generated API classes have sufficient Javadoc and the build completes without Javadoc errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, build-system, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100