Migrate from @ApiResponses to @ApiResponses

Apache 2.0

Changes the namespace of the @ApiResponses and @ApiResponse annotations and converts its attributes (ex. code -> responseCode, message -> description, response -> content).

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

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 io.swagger.annotations.ApiResponses to io.swagger.v3.oas.annotations.responses.ApiResponses
  2. Change type io.swagger.annotations.ApiResponse to io.swagger.v3.oas.annotations.responses.ApiResponse
  3. Change annotation attribute name @ApiResponse(code) to @ApiResponse(responseCode)
  4. Change annotation attribute name @ApiResponse(message) to @ApiResponse(description)
  5. Convert API response codes to strings
  6. Convert API response to content annotation
  7. Convert API responseHeaders to headers