Replace String literals with MediaType constants

MSAL

Replace String literals with org.springframework.http.MediaType constants in modules that depend on spring-web.

org.openrewrite.java.spring.http.ReplaceStringLiteralsWithMediaTypeConstants
mod run . --recipe=org.openrewrite.java.spring.http.ReplaceStringLiteralsWithMediaTypeConstants

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. Replace String literal with constant org.springframework.http.MediaType.ALL_VALUE
  2. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_ATOM_XML_VALUE
  3. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_CBOR_VALUE
  4. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE
  5. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_GRAPHQL_VALUE
  6. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_GRAPHQL_RESPONSE_VALUE
  7. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_JSON_VALUE
  8. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE
  9. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_OCTET_STREAM_VALUE
  10. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_PDF_VALUE
  11. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_PROBLEM_JSON_VALUE
  12. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_PROBLEM_JSON_UTF8_VALUE
  13. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_PROBLEM_XML_VALUE
  14. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_PROTOBUF_VALUE
  15. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_RSS_XML_VALUE
  16. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_NDJSON_VALUE
  17. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_STREAM_JSON_VALUE
  18. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_XHTML_XML_VALUE
  19. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_XML_VALUE
  20. Replace String literal with constant org.springframework.http.MediaType.APPLICATION_YAML_VALUE
  21. Replace String literal with constant org.springframework.http.MediaType.IMAGE_GIF_VALUE
  22. Replace String literal with constant org.springframework.http.MediaType.IMAGE_JPEG_VALUE
  23. Replace String literal with constant org.springframework.http.MediaType.IMAGE_PNG_VALUE
  24. Replace String literal with constant org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE
  25. Replace String literal with constant org.springframework.http.MediaType.MULTIPART_MIXED_VALUE
  26. Replace String literal with constant org.springframework.http.MediaType.MULTIPART_RELATED_VALUE
  27. Replace String literal with constant org.springframework.http.MediaType.TEXT_EVENT_STREAM_VALUE
  28. Replace String literal with constant org.springframework.http.MediaType.TEXT_HTML_VALUE
  29. Replace String literal with constant org.springframework.http.MediaType.TEXT_MARKDOWN_VALUE
  30. Replace String literal with constant org.springframework.http.MediaType.TEXT_PLAIN_VALUE
  31. Replace String literal with constant org.springframework.http.MediaType.TEXT_XML_VALUE