Giter VIP home page Giter VIP logo

rewrite-okhttp's Introduction

rewrite-okhttp's People

Contributors

aleksimpson avatar jkschneider avatar mike-solomon avatar shanman190 avatar simonverhoeven avatar timtebeek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

simonverhoeven

rewrite-okhttp's Issues

`okhttp` `RequestBody.create(mediaType,body)` -> `RequestBody.create(body,mediaType)`

This recipe should be straightforward to implement.

okhttp is very popular and we can consider adding more migrations in the future

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType,"some request");
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create("some request",mediaType);

The migration in Kotlin seems a little more involved but maybe we can do that later when we have Kotlin support

See square/okhttp#6655

Adopt new MockWebServer Maven coordinate and package name

What problem are you trying to solve?

Version 5.0.0-alpha.2 changes the MockWebServer Maven coordinate and package name.

In this release MockWebServer has a new Maven coordinate and package name. A longstanding problem with MockWebServer has been its API dependency on JUnit 4. We’ve reorganized things to remove that dependency while preserving backwards compatibility.

Maven Coordinate Package Name Description
com.squareup.okhttp3:mockwebserver3:5.0.0-alpha.2 mockwebserver3 Core module. No JUnit dependency!
com.squareup.okhttp3:mockwebserver3-junit4:5.0.0-alpha.2 mockwebserver3.junit4 Optional JUnit 4 integration.
com.squareup.okhttp3:mockwebserver3-junit5:5.0.0-alpha.2 mockwebserver3.junit5 Optional JUnit 5 integration.
com.squareup.okhttp3:mockwebserver:5.0.0-alpha.2 okhttp3.mockwebserver Obsolete. Depends on JUnit 4.

What precondition(s) should be checked before applying this recipe?

None.

Describe the situation before applying the recipe

Old dependency & package in use.

Describe the situation after applying the recipe

Dependency & package updated.

Have you considered any alternatives or workarounds?

Not really

Any additional context

Source: https://square.github.io/okhttp/changelogs/changelog/#version-500-alpha2

For the implementation we could likely reuse these existing recipes configured through Yaml:
https://docs.openrewrite.org/recipes/java/changepackage
https://docs.openrewrite.org/recipes/java/dependencies/changedependency

That way at most we'll need some tests if we want to be sure we correctly replace these, but no code otherwise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.