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

MP OpenAPI 3.1 support for 4.x #6954

Merged
merged 31 commits into from
Jun 13, 2023
Merged

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Jun 6, 2023

Resolves #5820

This PR adds MP OpenAPI 3.1 support to 4.x.

Do not be overly alarmed by the number of changed files! Read below.

Some details:

  1. For our MP OpenAPI support we continue to layer on SmallRye OpenAPI. SmallRye OpenAPI relies on the latest Jandex release which has moved from org.jboss to io.smallrye for its GAV coordinates while keeping the org.jboss.jandex packages. This PR adopts the new io.smallrye Jandex artifacts (code and maven plug-in). There are related changes in many pom.xml (inflating the changed-file count) and a few other files.
  2. A number of files have moved from the SE OpenAPI module to the MP one. Some might move back once full support for SE returns. (What is there for SE in this PR is in nima/openapi and provides only limited and very simple support for a static OpenAPI document file. This will change in a later PR focused on SE OpenAPI support.)
  3. A fair amount of logic shared between SE and MP resides in the openapi module.
  4. Changes in seemingly unrelated components:
    1. The Hibernate CDI integration component relies on org.hibernate.orm:hibernate-orm which depends on Weld which in turn depends on Jandex. The ORM module pulled in the older release of Jandex, so in our Hibernate CDI component this PR adds an exclusion of org.jboss:jandex so it also uses the newer io.smallrye packaging. Fortunately, it seems the ORM code does not use now-removed APIs in Jandex.
    2. LRA uses a previously-deprecated Jandex API that is now gone. This PR contains a few changes to adapt.
  5. The archetypes have changed to reflect the Jandex plug-in and code changes.

tjquinno added 28 commits May 19, 2023 18:48
…on test create jandex earlier so it will be in the test jar
@tjquinno tjquinno added this to the 4.0.0-M1 milestone Jun 6, 2023
@tjquinno tjquinno requested a review from ljnelson June 6, 2023 11:05
@tjquinno tjquinno self-assigned this Jun 6, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 6, 2023
@tjquinno tjquinno requested a review from danielkec June 6, 2023 12:29
@trentjeff trentjeff self-requested a review June 13, 2023 17:21
applications/mp/pom.xml Outdated Show resolved Hide resolved
dependencies/pom.xml Outdated Show resolved Hide resolved
Copy link
Member

@ljnelson ljnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left comments; I'll approve if you want but left them as simple comments for now

}

// See if we should parse the value fully.
switch (value.charAt(0)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Minor; could do return switch ...)

* @throws IOException in case of I/O problems
*/
static OpenAPI parse(Map<Class<?>, ExpandedTypeDescription> types, InputStream inputStream) throws IOException {
try (Reader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK to not have a BufferedReader?

Copy link
Member

@ljnelson ljnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically looks fine

@tjquinno tjquinno merged commit a4aef4f into helidon-io:main Jun 13, 2023
@tjquinno tjquinno deleted the mp-openapi-4.x branch June 13, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants