Migrate from @ApiOperation to @Operation

Apache 2.0

Converts the @ApiOperation annotation to @Operation and converts the directly mappable attributes and removes the others.

org.openrewrite.openapi.swagger.MigrateApiOperationToOperation
mod run . --recipe=org.openrewrite.openapi.swagger.MigrateApiOperationToOperation

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Change type ApiOperation to Operation
  2. Change annotation attribute name @Operation(notes) to @Operation(description)
  3. Change annotation attribute name @Operation(value) to @Operation(summary)
  4. Change annotation attribute name @Operation(nickname) to @Operation(operationId)
  5. Change annotation attribute name @Operation(httpMethod) to @Operation(method)
  6. Remove annotation attribute @Operation(response)
  7. Remove annotation attribute @Operation(consumes)
  8. Remove annotation attribute @Operation(produces)