Payara icon indicating copy to clipboard operation
Payara copied to clipboard

Bug Report: openAPI document not correct generated when more than one application is deployed / FISH-6298

Open FlorianFehring opened this issue 4 years ago • 5 comments

When deploying two applications with org.eclipse.microprofile.openapi annotation documented REST-APIs sometimes only one of them is rendered in the openapi document accessable under localhost:8080/openapi.


Expected Outcome

Both REST-APIs are documented in the generated openapi-doc

Current Outcome

Only one API is documented, sometimes the not longer deployed API only. See at "Steps to reproduce"

Steps to reproduce

Steps and observation:

  1. Deploy first application -> openapi-doc is generated correct
  2. Deploy second application -> openapi-doc only shows first application
  3. Undeploy first application -> openapi-doc only shows first appliaction
  4. Undeploy second application -> openapi-doc is empty (as expected)
  5. Deploy second application -> openapi-doc shows second application
  6. Deploy first application -> openapi-doc shows either first or second application

After some tries it seams to be not deterministic. Sometimes at step 3 the second application is shown in the api-doc, sometimes at step 5 the openapi-doc of the first app is shown.

Additional tests:

  • Deploying every of the two applications on their own shows correct openapi-doc.

Environment

  • Distribution: Payara Web Profile 5.2021.2 / 5.2021.3
  • JDK Version: openJDK11
  • Operating System: Windows

FlorianFehring avatar May 19 '21 06:05 FlorianFehring

Hi @FlorianFehring, would you be able to provide a sample applications that I can deploy to reproduce this error?

Thank you, Alan

AlanRoth avatar May 19 '21 08:05 AlanRoth

Hi @FlorianFehring, can you provide some sample applications that use the latest version?

Thank you, Alan

AlanRoth avatar Jun 21 '21 08:06 AlanRoth

Hi @AlanRoth. Sorry for late response, a lot of work those days. Tested it on 2021.4, same result. Booth used applications are here: https://scl.fh-bielefeld.de/files/SmartData.zip https://scl.fh-bielefeld.de/files/SmartDataPorter.zip SmartDataPorter needs a JDBC resource named as "jdbc/SmartDataPorter" to be deployable. (we use a postgres behind)

I'am not sure if it is related, but we found another problem with similar effect. Some students reported to me, that the /openapi returns only with:

openapi: 3.0.0 info: title: Deployed Resources version: 1.0.0 paths: {} components: {}

They use payara 2021.3 on their local machines. Then suddenly 2 days later, the same occurred on our api testing server (running since March on version 2021.2), it seems that there were no new deploy and only a weekly system reboot. If i make a fresh domain and fresh deploy with actual 2021.4 openapi shows up correctly, if i update from 2021.2 to 2021.4 (i separated the domain folder from the payara5 folder, as found in some tutorial) the problem resides. So maybe there are some cache like files that get confused after some reboots?

In the log is no error message, beside the : [2021-06-25T09:30:25.007+0200] [Payara 5.2021.4] [INFORMATION] [] [fish.payara.microprofile.openapi.impl.rest.app.service.OpenApiResource] [tid: _ThreadID=82 _ThreadName=http-thread-pool::http-listener-1(2)] [timeMillis: 1624606225007] [levelValue: 800] [[ No OpenAPI document found.]]

Than you for you help, Florian

FlorianFehring avatar Jun 25 '21 07:06 FlorianFehring

Are there any news? I testet with 5.2022.1 and have still the same problem. The log outputs "visiting unvisited references|#]" 6 times, which is the number of currently active applications.

FlorianFehring avatar Feb 23 '22 15:02 FlorianFehring

Hi @FlorianFehring,

Thank you for your patience, this issue has actually been raised before and is currently in development with the ID FISH-6298, I believe the fix implemented by this issue will resolve your problem here. The fix for this issue is currently targeted for the Payara Community 5.2022.3 release.

Thanks, James

JamesHillyard avatar Jul 25 '22 09:07 JamesHillyard

Hi @FlorianFehring,

As your original reproducers aren't available, I am unable to confirm if the recent fix FISH-6298 resolves your issue, however as of Payara Community 5.2022.3 the generated OpenAPI document takes into consideration multiple applications and will generate the correct document.

Here is the technical documentation containing information about the changes made: Payara Documentation - OpenAPI

If you don't feel this has fixed your issue, please provide the full reproducers for further investigation.

Thanks, James

JamesHillyard avatar Aug 22 '22 12:08 JamesHillyard

Hi @JamesHillyard

i took a look at the new version and can confirm the problem is solved now. All API documentation for all applications are shown now. Thank you!

FlorianFehring avatar Aug 23 '22 11:08 FlorianFehring