Skip to content

Commit

Permalink
Consistently use package including swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Feb 10, 2024
1 parent 38a5b13 commit 3bc9d6b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
26 changes: 13 additions & 13 deletions src/main/resources/META-INF/rewrite/swagger-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.openapi.SwaggerToOpenAPI
name: org.openrewrite.openapi.swagger.SwaggerToOpenAPI
displayName: Migrate from Swagger to OpenAPI
description: Migrate from Swagger to OpenAPI.
tags:
Expand All @@ -27,12 +27,12 @@ recipeList:
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: io.swagger.annotations.Tag
newFullyQualifiedTypeName: io.swagger.v3.oas.annotations.tags.Tag
- org.openrewrite.openapi.MigrateApiOperationToOperation
- org.openrewrite.openapi.MigrateApiResponsesToApiResponses
- org.openrewrite.openapi.MigrateApiImplicitParamsToParameters
- org.openrewrite.openapi.MigrateApiToTag
- org.openrewrite.openapi.MigrateApiParamToParameter
- org.openrewrite.openapi.MigrateApiModelPropertyToSchema
- org.openrewrite.openapi.swagger.MigrateApiOperationToOperation
- org.openrewrite.openapi.swagger.MigrateApiResponsesToApiResponses
- org.openrewrite.openapi.swagger.MigrateApiImplicitParamsToParameters
- org.openrewrite.openapi.swagger.MigrateApiToTag
- org.openrewrite.openapi.swagger.MigrateApiParamToParameter
- org.openrewrite.openapi.swagger.MigrateApiModelPropertyToSchema
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: io.swagger.annotations.ApiModel
newFullyQualifiedTypeName: io.swagger.v3.oas.annotations.media.Schema
Expand All @@ -41,7 +41,7 @@ recipeList:

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.openapi.MigrateApiOperationToOperation
name: org.openrewrite.openapi.swagger.MigrateApiOperationToOperation
displayName: Migrate from @ApiOperation to @Operation
description: Converts the @ApiOperation annotation to @Operation and converts the directly mappable attributes
and removes the others.
Expand Down Expand Up @@ -72,7 +72,7 @@ recipeList:

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.openapi.MigrateApiResponsesToApiResponses
name: org.openrewrite.openapi.swagger.MigrateApiResponsesToApiResponses
displayName: Migrate from @ApiResponses to @ApiResponses
description: Changes the namespace of the @ApiResponses and @ApiResponse annotations and converts its attributes
(ex. code -> responseCode, message -> description).
Expand All @@ -98,7 +98,7 @@ recipeList:

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.openapi.MigrateApiImplicitParamsToParameters
name: org.openrewrite.openapi.swagger.MigrateApiImplicitParamsToParameters
displayName: Migrate from @ApiImplicitParams to @Parameters
description: Converts @ApiImplicitParams to @Parameters and the @ApiImplicitParam annotation to @Parameter and converts
the directly mappable attributes and removes the others.
Expand Down Expand Up @@ -128,7 +128,7 @@ recipeList:

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.openapi.MigrateApiToTag
name: org.openrewrite.openapi.swagger.MigrateApiToTag
displayName: Migrate from @Api to @Tag
description: Converts @Api to @Tag annotation and converts the directly mappable attributes and removes the others.
tags:
Expand All @@ -145,7 +145,7 @@ recipeList:

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.openapi.MigrateApiParamToParameter
name: org.openrewrite.openapi.swagger.MigrateApiParamToParameter
displayName: Migrate from @ApiParam to @Parameter
description: Converts the @ApiParam annotation to @Parameter and converts the directly mappable attributes.
tags:
Expand All @@ -162,7 +162,7 @@ recipeList:

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.openapi.MigrateApiModelPropertyToSchema
name: org.openrewrite.openapi.swagger.MigrateApiModelPropertyToSchema
displayName: Migrate from @ApiModelProperty to @Schema
description: Converts the @ApiModelProperty annotation to @Schema and converts the "value" attribute to "description".
tags:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 the original author or authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openrewrite.openapi.swagger;

import org.junit.jupiter.api.Test;
Expand All @@ -11,7 +26,7 @@
class ConvertApiResponseCodesToStringsTest implements RewriteTest {
@Override
public void defaults(RecipeSpec spec) {
spec.recipeFromResources("org.openrewrite.openapi.MigrateApiResponsesToApiResponses")
spec.recipeFromResources("org.openrewrite.openapi.swagger.MigrateApiResponsesToApiResponses")
.parser(JavaParser.fromJavaVersion().classpath("swagger-annotations-1.+", "swagger-annotations-2.+"));
}

Expand Down

0 comments on commit 3bc9d6b

Please sign in to comment.