-
Notifications
You must be signed in to change notification settings - Fork 493
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
Spike: Investigate creating OpenAPI YAML from our code #10236
Comments
2024/01/17: Moved to sprint ready so work can start. |
As I mentioned in standup, I'm going to change the title of this issue to make it more generic. After poking at https://github.com/OpenAPITools/openapi-generator a bit and playing with the example at https://openapi-generator.tech/docs/plugins/ I'm not so sure that this is the right tool for generating the OpenAPI YAML we want. Instead, it seems like it produced client code from OpenAPI YAML. I checked with @poikilotherm who suggested some additional libraries to try: "I might have gotten that one wrong - the OpenAPI generator is about generating Java code from the spec, not the other way round But: I did some digging, looking specifically for generating the OpenAPI YAML file... And here's what I found: A) Use Swagger and Swagger Annotations. https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-maven-plugin/README.md and https://github.com/openapi-tools/swagger-maven-plugin (not sure what the difference is). There is also https://github.com/stoicflame/enunciate which supports Swagger output as well as generating client code in a variety of languages. B) Use MicroProfile OpenAPI annotations (these are the ones also useable with Payara /openapi endpoint) and use other plugins: https://geronimo.apache.org/microprofile/openapi.html or https://github.com/smallrye/smallrye-open-api/tree/main/tools/maven-plugin I think the best shot is the SmallRye Maven Plugin, as it provides code scanning and keeps us compatible with the Payara OpenAPI implementation" So next we should try some of the above. |
Testing this plugin I was able to generate the following spec: I also generated the yaml version but GitHub doesn't allow them 😓 |
Here's, I grabbed the YAML from the post JP made and added .txt so GitHub will take it: openapi.yaml.txt This is great! I guess if we go with this approach we should figure out where to put these files. It reminds me of how we put SchemaSpy output here, for example: https://guides.dataverse.org/en/5.14/schemaspy . That said, SchemaSpy has been treated as a one-off, something @donsizemore kindly does manually. Maybe this output should go directly into |
On a related note, I just built a version of Payara (for the first time) using the PR that fixes /openapi and left some notes about how I built it and where I put it: #9981 (comment) |
* 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 <[email protected]> * Update doc/release-notes/10236-openapi-definition-endpoint.md Co-authored-by: Philip Durbin <[email protected]> * Update doc/release-notes/10236-openapi-definition-endpoint.md Co-authored-by: Philip Durbin <[email protected]> * 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 <[email protected]>
* 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 <[email protected]> * Update doc/release-notes/10236-openapi-definition-endpoint.md Co-authored-by: Philip Durbin <[email protected]> * Update doc/release-notes/10236-openapi-definition-endpoint.md Co-authored-by: Philip Durbin <[email protected]> * 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 <[email protected]>
Overview
The
openapi
endpoint provided by Payara results in an internal server error in version 6.0, as detailed here: #9981Payara has been contacted for a fix (see: #9981 (comment)).
This spike proposes that while we await the Payara fix, we investigate using the OpenAPI Generator Tool to determine feasibility, as recommended here: #9981 (comment)
Related
The text was updated successfully, but these errors were encountered: