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

Support multiple apps in OpenAPI document #1493

Merged
merged 13 commits into from
Mar 17, 2020
Merged

Support multiple apps in OpenAPI document #1493

merged 13 commits into from
Mar 17, 2020

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Mar 11, 2020

Resolves #1288

The SmallRye OpenAPI annotation scanning does not correctly handle multiple applications in the server. To deal with this, the Helidon MP layer:

  • invokes the SmallRye OpenAPI scanner once for each app, restricting the scanner so it works only with that app’s classes, thus producing a temporary OpenAPI model for just that app; then
  • merges the resulting models into one (using a SmallRye utility method) for use by SmallRye as the model resulting from annotation scanning.

(Because OpenAPI is also supported in SE this PR includes some changes in SE to enhance the contract of OpenAPISupport and its builder. Functionally, SE is unaffected by this change.)

To locate the apps, these revised Helidon MP OpenAPI layer uses the pre-existing JaxRsCdiExtension which harvests not only annotated apps but also ones registered programmatically.

There are a few changes to the MP server component so code that creates a JaxRsApplication can indicate if it's a synthetic application being represented. This is useful because the OpenAPI enhancements do not need to handle a synthetic app.

@tjquinno tjquinno added bug Something isn't working MP open-api 2.x Issues for 2.x version branch labels Mar 11, 2020
@tjquinno tjquinno added this to the 2.0.0 milestone Mar 11, 2020
@tjquinno tjquinno self-assigned this Mar 11, 2020
@tjquinno tjquinno changed the title Support multiple apps in OpenAPI document WIP: Support multiple apps in OpenAPI document Mar 11, 2020
…tons because they come from JaxRsCdiExtension in the server component which already provides instances
@tjquinno tjquinno changed the title WIP: Support multiple apps in OpenAPI document Support multiple apps in OpenAPI document Mar 12, 2020
@tjquinno tjquinno added this to In Progress in Backlog Mar 13, 2020
Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

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

One small request for change

tomas-langer
tomas-langer previously approved these changes Mar 17, 2020
Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

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

LGTM

@tjquinno tjquinno merged commit 61e157e into helidon-io:master Mar 17, 2020
Backlog automation moved this from In Progress to Closed Mar 17, 2020
@tjquinno tjquinno deleted the openapi-multi-apps-2.x branch March 17, 2020 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues for 2.x version branch bug Something isn't working MP open-api
Projects
Backlog
  
Closed
Development

Successfully merging this pull request may close these issues.

OpenAPI incomplete with multiple JAX-RS applications
2 participants