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

OpenAPI endpoint is broken #9981

Closed
JR-1991 opened this issue Oct 6, 2023 · 14 comments · Fixed by #10328
Closed

OpenAPI endpoint is broken #9981

JR-1991 opened this issue Oct 6, 2023 · 14 comments · Fixed by #10328
Labels
Milestone

Comments

@JR-1991
Copy link
Contributor

JR-1991 commented Oct 6, 2023

What steps does it take to reproduce the issue?

The openapi endpoint provided by Payara results in an internal server error in version 6.0. For example, the endpoint does not function on Demo Dataverse (v6.0), although it does on Harvard's Dataverse (v5.14). Click on each link to reproduce the error.

Which version of Dataverse are you using?

Dataverse 6.0

@pdurbin
Copy link
Member

pdurbin commented Oct 6, 2023

Thanks for discussing this and opening this OpenAPI/Swagger issue, @JR-1991!

I showed the stacktrace below (from my laptop running 7e0738e, the latest from the develop branch) to @poikilotherm and he found what seems to be a related issue on the Payara side:

@donsizemore found this issue:

Here's the stacktrace: openapi-error.txt

Other open Swagger/OpenAPI issues:

@pdurbin
Copy link
Member

pdurbin commented Oct 26, 2023

Today @poikilotherm suggested using https://github.com/OpenAPITools/openapi-generator which would not be dependent on Payara (should also work if we switched to Wildfly or OpenLiberty, etc.). Also, it doesn't require the app server to be running.

@cmbz
Copy link

cmbz commented Jan 8, 2024

2024/01/08: Prioritized and moved to Needs Sizing during prioritization meeting.

@cmbz
Copy link

cmbz commented Jan 9, 2024

2024/01/08: Moved to Needs Sizing during today's prioritization meeting

@pdurbin
Copy link
Member

pdurbin commented Jan 10, 2024

As discussed yesterday at tech hours, a simple thing is to ask Payara about how the fix is coming along. I just did this in payara/Payara#6369 (comment)

As switching to output generated from https://github.com/OpenAPITools/openapi-generator none of us have tried that library and we don't have a great sense of how much effort it is.

A major use case for getting /openapi working again is PyDataverse. See "Implementation of core generation based on Swagger/OpenAPI" at https://py.gdcc.io

@cmbz
Copy link

cmbz commented Jan 16, 2024

2024/01/16: Recommendation to create a separate spike (10) to investigate the tool suggested here: #9981 (comment)

@cmbz
Copy link

cmbz commented Jan 16, 2024

2024/01/16: spike created: #10236

@cmbz
Copy link

cmbz commented Jan 16, 2024

2024/01/16: Moved to waiting. Work will continue via #10236 while we wait for response from Payara.

@pdurbin
Copy link
Member

pdurbin commented Feb 14, 2024

This just in. Someone has come up with a potential fix for Payara:

@pdurbin
Copy link
Member

pdurbin commented Feb 23, 2024

I just built that PR with this:

sdk use java 11.0.20-tem
mvn clean install -T 16 -PQuickBuild -DskipTests

Then I uploaded it to Google Drive: https://drive.google.com/file/d/17kVKOco86FDKXvs1aBZLq9QBABxO8S5A/view?usp=drive_link

I haven't tested it to see if /openapi works or not.

@cmbz
Copy link

cmbz commented Mar 13, 2024

2024/03/14

  • JP will reference this issue in his PR and when it's closed this issue will be too.

@pdurbin
Copy link
Member

pdurbin commented Apr 2, 2024

@poikilotherm
Copy link
Contributor

Payara 6.2024.4 RC1 is just in today. I suppose there will be a new release soon. We should update our version of Payara as it also contains my MPC NPE fix. We can check back again if it started working again.

@jp-tosca
Copy link
Contributor

jp-tosca commented Apr 2, 2024

If this is the case we should probably have to decide what to do with #10328 here are a few things to consider:

  • We should remove the endpoints added to serve the spec
  • We should discuss if we keep using the smallrye plugin, according to the documentation shared to us by @poikilotherm if a .yaml or .json file are provided under /WEB-INF the server would provide these files.
  • We still may need to include the changes done to the API methods and the annotations added on this OpenAPI definition endpoint #10328 or the spec will be similar at the one provided at https://dataverse.unc.edu/openapi which shows some of the errors solved, I am not sure how will the spec generated the payara will take this yet, as soon as the new release is up I can test it.

pdurbin added a commit that referenced this issue May 29, 2024
pdurbin added a commit that referenced this issue May 29, 2024
stevenwinship pushed a commit that referenced this issue Jun 6, 2024
* Plugin initial config

* Initial changes to provide OpenAPI definition

* Added integration test

* Imports fix

* Add patchnotes

* Update the changelog

* Update src/main/java/edu/harvard/iq/dataverse/api/Info.java

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Update doc/release-notes/10236-openapi-definition-endpoint.md

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Update doc/release-notes/10236-openapi-definition-endpoint.md

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Add native API docs

* Remove generated definitions

* Add to gitignore generated openapi files

* Updates to docs

* Ignore files correction

* Remove files created by the plugin

* Changes to move the definition files to META-INF

* Changes to move the definitions to WEB-INF

* Changes to get the files from META-INF

* Changed the phase of execution of the smallrye plugin

* Changes of names to improve the generation of the spec

* Add support for OpenAPI annotations and documents the version endpoint

* Multipart Annotations

* Typos correction

* Changes for tags

* Renaming of methods

* Changes to the endpoint

* Added test

* Add test

* Deleted extra import

* Docs updated

* openapi doc tweaks #9981 #10236

* improve release note #9981 #10236

* Remove old test and changes response to JSON

* stub out guidance on openapi validation #9981 #10236

* add InfoIT to list of tests

* use description of Dataverse from website

* mention status codes in openapi doc

* update api faq about changelog, link to breaking changes doc

* typo

* Change to OpenApi

* Changes to docs

* Name fix

* Removing the multipart from unirest

---------

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
@pdurbin pdurbin added this to the 6.3 milestone Jun 6, 2024
luddaniel pushed a commit to Recherche-Data-Gouv/dataverse that referenced this issue Jun 12, 2024
* Plugin initial config

* Initial changes to provide OpenAPI definition

* Added integration test

* Imports fix

* Add patchnotes

* Update the changelog

* Update src/main/java/edu/harvard/iq/dataverse/api/Info.java

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Update doc/release-notes/10236-openapi-definition-endpoint.md

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Update doc/release-notes/10236-openapi-definition-endpoint.md

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Add native API docs

* Remove generated definitions

* Add to gitignore generated openapi files

* Updates to docs

* Ignore files correction

* Remove files created by the plugin

* Changes to move the definition files to META-INF

* Changes to move the definitions to WEB-INF

* Changes to get the files from META-INF

* Changed the phase of execution of the smallrye plugin

* Changes of names to improve the generation of the spec

* Add support for OpenAPI annotations and documents the version endpoint

* Multipart Annotations

* Typos correction

* Changes for tags

* Renaming of methods

* Changes to the endpoint

* Added test

* Add test

* Deleted extra import

* Docs updated

* openapi doc tweaks IQSS#9981 IQSS#10236

* improve release note IQSS#9981 IQSS#10236

* Remove old test and changes response to JSON

* stub out guidance on openapi validation IQSS#9981 IQSS#10236

* add InfoIT to list of tests

* use description of Dataverse from website

* mention status codes in openapi doc

* update api faq about changelog, link to breaking changes doc

* typo

* Change to OpenApi

* Changes to docs

* Name fix

* Removing the multipart from unirest

---------

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants