Skip to content

Conversation

@dsgrieve
Copy link
Contributor

@dsgrieve dsgrieve commented Jan 13, 2026

What's changed?

Add a ChangeDependency to make sure io.swagger:swagger-jersey2-jaxrs ends up as io.swagger.core.v3:swagger-jaxrs2

What's your motivation?

The way the org.openrewrite.openapi.swagger.SwaggerToOpenAPI recipe works, a pom might end up with a dependency on io.swagger.core.v3:swagger-jersey2-jaxrs:2.2.x. This change catches the edge case where the swagger-jersey2-jaxrs artifact is simply not under the io.swagger.core.v3 group id.

Anything in particular you'd like reviewers to focus on?

The recipe makes the change to swagger-jaxrs2. Further down, there is a ChangeDependency in org.openrewrite.openapi.swagger.UseJakartaSwaggerArtifacts that changes swagger-jaxrs2 to swagger-jaxrs2-jakarta. The UseJakartaSwaggerArtifacts recipe is not invoked from org.openrewrite.openapi.swagger.SwaggerToOpenAPI.

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

oldArtifactId: swagger-integration
newArtifactId: swagger-integration-jakarta
- org.openrewrite.java.dependencies.ChangeDependency:
oldGroupId: io.swagger.core.v3
Copy link
Contributor

@steve-aom-elliott steve-aom-elliott Jan 13, 2026

Choose a reason for hiding this comment

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

Shouldn't the oldGroupId have been io.swagger, meaning you'd also need the newGroupId to be io.swagger.core.v3? After discussion, we're going to move this recipe up to SwaggerToOpenAPI instead, immediately following the first ChangeDependency, to get this artifact id correct.

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Jan 13, 2026
Copy link
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Looking at the artifact available

I've changed your approach to immediately move to the correct GAV coordinates for swagger-jaxrs2 even before we do a catch all on any other artifacts. That way we'r sure to be able to resolve the version pattern 2.2.x as we migrate, without warnings or errors for non existing intermediate GAV coordinates between the first and second instance of ChangeDependency. I think a test would have brought that to light, but it's ok to skip that now.

With that we're now ok to merge; thanks both!

@timtebeek timtebeek merged commit daef2b0 into main Jan 14, 2026
2 checks passed
@timtebeek timtebeek deleted the david/swagger-jaxrs2 branch January 14, 2026 10:29
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants