Skip to content
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

[BUG][okhttp-gson] can not generate javadoc #3299

Closed
jmini opened this issue Jul 8, 2019 · 5 comments · Fixed by #3302
Closed

[BUG][okhttp-gson] can not generate javadoc #3299

jmini opened this issue Jul 8, 2019 · 5 comments · Fixed by #3302

Comments

@jmini
Copy link
Member

jmini commented Jul 8, 2019

Description

Introduced with issue #2994 / PR #2995 the generated javadoc now contains @http.response.details. Example from our the samples:

* @http.response.details
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 400 </td><td> Invalid ID supplied </td><td> - </td></tr>
<tr><td> 404 </td><td> Order not found </td><td> - </td></tr>
</table>

When trying to generate the javadoc artifact for the project, you get tons of errors:

cd samples/client/petstore/java/okhttp-gson
mvn javadoc:javadoc
INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.419 s
[INFO] Finished at: 2019-07-08T10:44:48+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:javadoc (default-cli) on project petstore-okhttp-gson: An error has occurred in JavaDocs report generation: 
[ERROR] Exit code: 1 - /____/openapi-generator/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java:63: error: unknown tag: http.response.details
[ERROR]      * @http.response.details
[ERROR]        ^
[ERROR] /____/openapi-generator/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java:117: error: unknown tag: http.response.details
[ERROR]      * @http.response.details
[ERROR]        ^
[ERROR] /____/openapi-generator/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java:134: error: unknown tag: http.response.details
[ERROR]      * @http.response.details
[ERROR]        ^
openapi-generator version

4.0.2

Suggest a fix

We can keep the table, but remove the @http.response.details and just put "Response details:"

@saigiridhar21, @wing328 what do you think?

@wing328
Copy link
Member

wing328 commented Jul 8, 2019

Yes please go ahead with the fix.

@jmini
Copy link
Member Author

jmini commented Jul 8, 2019

I would put the html table before the parameters section.

    /**
     * Send-Message
     * <p>Http response details:</p>
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td>  </td><td>  -  </td></tr>
     </table>
     * @param sendMessageRequestBody  (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     */
    public void sendMessage(SendMessageRequestBody sendMessageRequestBody) throws ApiException

IMO it looks better (preview of the javadoc in Eclipse IDE):

Screenshot 2019-07-08 at 11 07 51

@jmini
Copy link
Member Author

jmini commented Jul 8, 2019

Wait, never-mind the issue is how the maven build is configured.

When the configuration bloc is correctly defined, you get decent result:
Screenshot 2019-07-08 at 11 19 24

@saigiridhar21
Copy link
Contributor

saigiridhar21 commented Jul 8, 2019

@jmini Do you mean that the configuration block is incorrectly configured in pom.xml?

@jmini
Copy link
Member Author

jmini commented Jul 8, 2019

Thank you for the quick feedback. I have proposed a fix in #3302. Feel free to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants