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

Added test suite for micronaut-openapi with spring-boot application. #1770

Open
wants to merge 1 commit into
base: 6.12.x
Choose a base branch
from

Conversation

altro3
Copy link
Collaborator

@altro3 altro3 commented Sep 14, 2024

Added documentation how to use micronaut-openapi with Spring applications


// add to annotationProcessor and compileOnly blocks next libraries:

annotationProcessor platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should promote applying the Micronaut platform BOM, they should only apply the core BOM, the spring BOM and the OpenAPI BOM

The platform BOM may conflict

Copy link
Collaborator Author

@altro3 altro3 Sep 20, 2024

Choose a reason for hiding this comment

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

Yes, the versions may not be exactly the same, but personally I use it exactly like this and so far everything has worked fine. It's just that if you don't do it like this, you'll have to set your own version for each library or connect as many as 4 additional bomb files - core, openapi, serde and micronaut-spring.

It seems to me that it's quite normal for the first version. If users have real problems, then the example can be improved.

Copy link
Contributor

Choose a reason for hiding this comment

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

so the issue is it might work for you but it is likely not to align the Spring Platform BOM which will create issues for others depending on the dependencies specified. If it is purely documentation then sure maybe it is fine, but be aware this is not going to work at scale

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, fixed

To use micronaut openapi views (Swagger UI, OpenAPi Explorer, Redoc, RapiDoc) you need to add static resources to Spring configuration like this:

.WebConfig.java
[source,java]
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use snippet:: to include a real tested piece of code here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@altro3 altro3 force-pushed the add-spring-tests branch 2 times, most recently from 57e84df to 510dd37 Compare September 20, 2024 08:14
@altro3
Copy link
Collaborator Author

altro3 commented Sep 20, 2024

@graemerocher could you merge all PRs?

Added documentation how to use micronaut-openapi with Spring applications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants