From a205d7cb2d5ca605109e44acbdd9cca64811949f Mon Sep 17 00:00:00 2001 From: Renette Ros Date: Wed, 13 Sep 2023 18:41:06 +0200 Subject: [PATCH] Add recipe to upgrade to springdoc-openapi 2 (#433) Closes #430 --- .../META-INF/rewrite/spring-boot-30.yml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/src/main/resources/META-INF/rewrite/spring-boot-30.yml b/src/main/resources/META-INF/rewrite/spring-boot-30.yml index 4d59a3561..d2e466454 100644 --- a/src/main/resources/META-INF/rewrite/spring-boot-30.yml +++ b/src/main/resources/META-INF/rewrite/spring-boot-30.yml @@ -62,6 +62,7 @@ recipeList: - org.openrewrite.java.spring.boot3.ConfigurationOverEnableSecurity - org.openrewrite.java.spring.boot3.SpringBootProperties_3_0 - org.openrewrite.java.spring.boot3.MigrateThymeleafDependencies + - org.openrewrite.java.spring.boot3.UpgradeSpringDoc_2 - org.openrewrite.java.spring.security6.UpgradeSpringSecurity_6_0 - org.openrewrite.java.spring.cloud2022.UpgradeSpringCloud_2022 - org.openrewrite.hibernate.MigrateToHibernate61 @@ -862,3 +863,80 @@ recipeList: - org.openrewrite.java.spring.ChangeSpringPropertyKey: oldPropertyKey: management.trace.include newPropertyKey: management.httpexchanges.recording.include +--- +type: specs.openrewrite.org/v1beta/recipe + +name: org.openrewrite.java.spring.boot3.UpgradeSpringDoc_2 +displayName: Upgrade to springodc-openapi 2 +description: > + Migrate applications to the latest spring-doc 2 release. This recipe will modify an + application's build files and make changes code changes for removed/updated APIs. + See the [upgrade guide](https://springdoc.org/#migrating-from-springdoc-v1) +tags: + - spring +recipeList: + - org.openrewrite.java.dependencies.RemoveDependency: + groupId: org.springdoc + artifactId: springdoc-openapi-data-rest + - org.openrewrite.java.dependencies.RemoveDependency: + groupId: org.springdoc + artifactId: springdoc-openapi-groovy + - org.openrewrite.java.dependencies.RemoveDependency: + groupId: org.springdoc + artifactId: springdoc-openapi-hateoas + - org.openrewrite.java.dependencies.RemoveDependency: + groupId: org.springdoc + artifactId: springdoc-openapi-javadoc + - org.openrewrite.java.dependencies.RemoveDependency: + groupId: org.springdoc + artifactId: springdoc-openapi-kotlin + - org.openrewrite.java.dependencies.RemoveDependency: + groupId: org.springdoc + artifactId: springdoc-openapi-security + - org.openrewrite.java.dependencies.ChangeDependency: + oldGroupId: org.springdoc + oldArtifactId: springdoc-openapi-common + newArtifactId: springdoc-openapi-starter-common + newVersion: 2.x + - org.openrewrite.java.dependencies.ChangeDependency: + oldGroupId: org.springdoc + oldArtifactId: springdoc-openapi-webmvc-core + newArtifactId: springdoc-openapi-starter-webmvc-api + newVersion: 2.x + - org.openrewrite.java.dependencies.ChangeDependency: + oldGroupId: org.springdoc + oldArtifactId: springdoc-openapi-webflux-core + newArtifactId: springdoc-openapi-starter-webflux-api + newVersion: 2.x + - org.openrewrite.java.dependencies.ChangeDependency: + oldGroupId: org.springdoc + oldArtifactId: springdoc-openapi-ui + newArtifactId: springdoc-openapi-starter-webmvc-ui + newVersion: 2.x + - org.openrewrite.java.dependencies.ChangeDependency: + oldGroupId: org.springdoc + oldArtifactId: springdoc-openapi-webflux-ui + newArtifactId: springdoc-openapi-starter-webflux-ui + newVersion: 2.x + - org.openrewrite.java.ChangeType: + oldFullyQualifiedTypeName: org.springdoc.core.SpringDocUtils + newFullyQualifiedTypeName: org.springdoc.core.utils.SpringDocUtils + - org.openrewrite.java.ChangeType: + oldFullyQualifiedTypeName: org.springdoc.api.annotations.ParameterObject + newFullyQualifiedTypeName: org.springdoc.core.annotations.ParameterObject + - org.openrewrite.java.ChangeType: + oldFullyQualifiedTypeName: org.springdoc.core.GroupedOpenApi + newFullyQualifiedTypeName: org.springdoc.core.models.GroupedOpenApi + - org.openrewrite.java.ChangeType: + oldFullyQualifiedTypeName: org.springdoc.core.customizers.OpenApiCustomiser + newFullyQualifiedTypeName: org.springdoc.core.customizers.OpenApiCustomizer + - org.openrewrite.java.ChangeType: + oldFullyQualifiedTypeName: org.springdoc.core.Constants + newFullyQualifiedTypeName: org.springdoc.core.utils.Constants + - org.openrewrite.java.ChangeType: + oldFullyQualifiedTypeName: org.springdoc.core.SwaggerUiConfigParameters + newFullyQualifiedTypeName: org.springdoc.core.properties.SwaggerUiConfigParameters + - org.openrewrite.java.ChangeMethodName: + methodPattern: org.springdoc.core.models.GroupedOpenApi.Builder addOpenApiCustomiser(..) + newMethodName: addOpenApiCustomizer + matchOverrides: true