Skip to content

Elhussein-Hamed/PostmanToRetrofit2-v2

 
 

Repository files navigation

PostmanToRetrofit2

This is an Android Studio plugin which can generate Retrofit2's Java/Kotlin code from Postman's collection.

Features:

  • Supports RxJava and Coroutines with Retrofit2
  • Class generation and selection for each request in the collection from the directory of your choice
  • Automatic class generation from saved responses in a collection
  • Sub-collections within a collection handling
  • Postman Url parameters (i.e. :param) handling
  • Postman form-data, form-urlencoded and raw body types handling
  • GUI to help selecting the Postman collection from the file system and to choose the conversion settings
  • mnemonics support in the GUI
  • Saving the last user settings per project

Install

From Android Studio plugin marketplace

Open Android Studio:

  • File > Settings (For Mac Android Studio > Preferences) > Plugins > Search and install Postman to Retrofit2 V2

Installing manually

  • Download the latest plugin zip file from here

  • Open Android Studio

    • File > Settings (For Mac Android Studion > Preferences) > Plugins > ⚙️ > Install plugin from disk.. > import PostmanToRetrofit2-v2-Plugin-*.zip
  • Restart Android Studio

Usage

Import Retrofit2

gradle

implementation 'com.squareup.retrofit2:retrofit:2.5.0'

Other versions can be found in Maven

Import RxJava2 (Optional)

gradle

implementation "io.reactivex.rxjava2:rxjava:2.0.1"

Other versions can be found in Maven

plugin_preview

Packages

No packages published

Languages

  • Java 99.1%
  • Kotlin 0.9%