Code Monkey home page Code Monkey logo

thrifty-retrofit-converter's Introduction

Thrifty Retrofit converter

License

A Retrofit converter implementation using Thrifty for (de)serialization of Apache Thrift requests and responses.

It supports Binary, Compact and Json Thrift protocols. It supports Thrifty models generated in both Java and Kotlin.

Usage

Add the library as a dependency to your build.gradle to automatically download it from Maven Central.

implementation "com.infinum:retrofit-converter-thrifty:3.0.0"

... and add the converter factory when you create the Retrofit object.

Retrofit retrofit = new Retrofit.Builder()
    .baseUrl("https://example.com/api/")
    .addConverterFactory(ThriftyConverterFactory.create(ProtocolType.COMPACT))
    .build();

We also maintain a changelog.

Contributing

Feedback and code contributions are very much welcome. Just make a pull request with a short description of your changes. By making contributions to this project you give permission for your code to be used under the same license.

Generating new files with the thrifty compiler

In case source files need to be generated from .thrift files using a different version of the thrifty compiler, use these commands:

wget https://repo1.maven.org/maven2/com/microsoft/thrifty/thrifty-compiler/2.1.2/thrifty-compiler-2.1.2-all.jar
java -jar thrifty-compiler-2.1.2-all.jar --out=retrofit-converter-thrifty/src/test/java/ --lang=java retrofit-converter-thrifty/src/test/resources/phone.thrift
java -jar thrifty-compiler-2.1.2-all.jar --out=retrofit-converter-thrifty/src/test/kotlin/ --lang=kotlin --kt-file-per-type retrofit-converter-thrifty/src/test/resources/phone.thrift

Deploying a new version

To publish to Maven Central you first need to set the following Gradle properties:

signing.keyId=<GPG_KEY_ID>
signing.password=<GPG_KEY_PASSWORD>
signing.secretKeyRingFile=<GPG_SECRING_LOCATION>

sonatypeUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/
sonatypeUsername=<SONATYPE_USERNAME>
sonatypePassword=<SONATYPE_PASSWORD>

To deploy a new version to Maven Central, use deploy.sh:

./publish.sh <artifact version> [optional tag message]

The publish.sh script will automatically push a tag with the version name and change the version in the README.

All you need to do after the script runs is to press release in Sonatype OSS.

thrifty-retrofit-converter's People

Contributors

reisub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thrifty-retrofit-converter's Issues

Add support for Json protocol

Json protocol support has recently been added to Thrifty, so we need another enum value for the protocol type.

Note: to be able to do this, Thrifty first has to do a new release with the Json protocol support (it's not relased yet, just merged).

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.