All Projects → AdevintaSpain → Protein

AdevintaSpain / Protein

Licence: apache-2.0
💊 Protein is an IntelliJ Plugin to generate Kotlin code for Retrofit 2 and RxJava 2 based on a Swagger definition

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Protein

Kotlin Android Scaffolding
An android project structure using kotlin and most common libraries.
Stars: ✭ 53 (-80.59%)
Mutual labels:  rxjava2, android-studio, retrofit2
Runconfigurationasaction
Provides a way to use IntelliJ run configurations as buttons
Stars: ✭ 17 (-93.77%)
Mutual labels:  android-studio, intellij-plugin, plugin
Android Mvp Mvvm Flytour
🔥🔥🔥 FlyTour是Android MVVM+MVP+Dagger2+Retrofit+RxJava+组件化+插件组成的双编码架构+双工程架构+双语言Android应用开发框架,通过不断的升级迭代该框架已经有了十个不同的版本,5.0之前工程架构采用gradle配置实现组件化,5.0之后的工程架构采用VirtualAPK实现了插件化,5.0之前采用Java编码实现,5.0之后采用Kotlin编码实现,编码架构由MVVM和MVP组成,工程架构和编码架构及编码语言开发者可根据自己具体的项目实际需求去决定选择使用,该框架是Android组件化、Android插件化、Android MVP架构、Android MVVM架构的集大成者,帮助你快速的搭建自己的App项目开发框架,以便把主要的精…
Stars: ✭ 2,948 (+979.85%)
Mutual labels:  rxjava2, plugin, retrofit2
Graphql Retrofit Converter
A Retrofit 2 Converter.Factory for GraphQL.
Stars: ✭ 46 (-83.15%)
Mutual labels:  rxjava2, android-studio, retrofit2
Phoenix For Vk
Yet another VK client for Android
Stars: ✭ 131 (-52.01%)
Mutual labels:  rxjava2, android-studio, retrofit2
figma-import-plugin
A plugin for Android Studio to import figma resources
Stars: ✭ 24 (-91.21%)
Mutual labels:  intellij-plugin, android-studio
mvp-android-template
MVP Android Template to give you a Quick Head Start for your next Android Project. It implements MVP Architecture using Dagger2, Room, RxJava2 , Retrofit2
Stars: ✭ 20 (-92.67%)
Mutual labels:  rxjava2, retrofit2
FindTaek
📦 내가 시킨 택배가 어디까지 왔는지 확인해보세요
Stars: ✭ 26 (-90.48%)
Mutual labels:  retrofit2, android-studio
MVPArchitecture
Android MVP architecture in Kotlin using Dagger2, RxJava2, Retrofit2 and so on
Stars: ✭ 27 (-90.11%)
Mutual labels:  rxjava2, retrofit2
Android-Mvi-Starter
Android MVI Starter application
Stars: ✭ 19 (-93.04%)
Mutual labels:  rxjava2, retrofit2
eventbus-plugin
IntelliJ iDEA plugin to work with projects using greenrobot's EventBus library
Stars: ✭ 25 (-90.84%)
Mutual labels:  intellij-plugin, android-studio
SeeWhat-Kotlin
基于谷歌官方MVP-RXJAVA模式的个人Demo,由Koltin编写完成。An Android sample built with Kotlin && the Rx series && MVP-Rxjava
Stars: ✭ 14 (-94.87%)
Mutual labels:  rxjava2, retrofit2
RxFamilyUser
框架使用retrofit2与rxjava2+databing,Md风格一个开源项目.
Stars: ✭ 21 (-92.31%)
Mutual labels:  rxjava2, retrofit2
Retrofit2Rxjava2Download
这是用Retrofit2和Rxjava2搭配封装的下载文件。
Stars: ✭ 19 (-93.04%)
Mutual labels:  rxjava2, retrofit2
Kotlin Android Mvp Starter
Create/Generate your kotlin MVP projects easily
Stars: ✭ 270 (-1.1%)
Mutual labels:  rxjava2, retrofit2
rxandroid2-retrofit2
Small tutorial to get started with RxAndroid 2 and Retrofit 2
Stars: ✭ 55 (-79.85%)
Mutual labels:  rxjava2, retrofit2
weather-app-android-mvvm
Simple MVVM practice repository for very very beginners. You don't need to know about Dagger, Coroutine or Rx for understanding MVVM and this project. To check the MVVM Architecture Bengali Tutorial visit my blog site
Stars: ✭ 32 (-88.28%)
Mutual labels:  retrofit2, android-studio
StackOverFlowApi
working with Stack OverFlow Api
Stars: ✭ 24 (-91.21%)
Mutual labels:  rxjava2, retrofit2
RxRetroAPICall
API call example using Retrofit and RxJava2
Stars: ✭ 16 (-94.14%)
Mutual labels:  rxjava2, retrofit2
Openapi Typescript Codegen
NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
Stars: ✭ 249 (-8.79%)
Mutual labels:  swagger, codegen
* IntelliJ Kotlin code generator for Retrofit2 and RxJava2 based on Swagger *

Version Downloads

Protein is a plugin for intelliJ that automates the build of Retrofit "Interfaces" and "models" for Android in Kotlin. It generates the code for Retrofit based on a Swagger endpoint.


Background | Features | Download | Who Made This | Apps using Protein | Contribute | Bugs and Feedback | License


Background

Protein: A large molecule composed of one or more chains of amino acids in a specific order; the order is determined by the base sequence of nucleotides in the gene coding for the protein. Proteins are required for the structure, function, and regulation of the body’s cells, tissues, and organs, and each protein has unique functions. Examples are hormones, enzymes, and antibodies.

This scientific definition defines quite good the objective of this Plugin in an abstract way. For many time at Adevinta Spain we struggled with the idea of making a good and maintainable architecture for Android. It's been some time until we got one that fits with our needs but we still have a lot of errors and issues that human beings do every time we make manual work. That's were we came to the idea of automatization and make new components with all we need.

Protein is our approach to work better, be more productive and reliable.

NOTE: Protein is based on the library Retroswagger that is the core for the kotlin builder that parses swagger json and generates the kotlin code.

Features

  • Easy interface
  • Interface and Models auto-generated
  • Swagger integration: create code based on swagger documentation
  • IntelliJ and Android Studio compatible

Requirements

To use it you need a Swagger schema endpoint (example: http://petstore.swagger.io/v2/swagger.json).

Example

Swagger json code
{
  "swagger":"2.0",
  "info":{
    "version":"1"
  },
  "host":"localhost:8000",
  "basePath":"/",
  "tags":[
    {
      "name":"favorites-controller",
      "description":"Favorites Controller"
    }
  ],
  "paths":{
    "/favorites":{
      "get":{
        "tags":[
          "favorites-controller"
        ],
        "summary":"Get all favorites for this user",
        "operationId":"getFavorites",
        "consumes":[
          "application/json"
        ],
        "produces":[
          "application/json;charset=UTF-8"
        ],
        "parameters":[
          {
            "name":"Authorization",
            "in":"header",
            "description":"Authorization",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"OK",
            "schema":{
              "$ref":"#/definitions/GetFavoritesResponse"
            }
          },
          "401":{
            "description":"Unauthorized"
          },
          "403":{
            "description":"Forbidden"
          },
          "404":{
            "description":"Not Found"
          }
        }
      }
    },
    "/favorites/{adId}":{
      "put":{
        "tags":[
          "favorites-controller"
        ],
        "summary":"Save favorite",
        "operationId":"saveFavorite",
        "consumes":[
          "application/json"
        ],
        "produces":[
          "application/json;charset=UTF-8"
        ],
        "parameters":[
          {
            "name":"adId",
            "in":"path",
            "description":"adId",
            "required":true,
            "type":"string"
          },
          {
            "name":"Authorization",
            "in":"header",
            "description":"Authorization",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"OK"
          },
          "201":{
            "description":"Created"
          },
          "401":{
            "description":"Unauthorized"
          },
          "403":{
            "description":"Forbidden"
          },
          "404":{
            "description":"Not Found"
          }
        }
      },
      "delete":{
        "tags":[
          "favorites-controller"
        ],
        "summary":"Delete favorite",
        "operationId":"deleteFavorite",
        "consumes":[
          "application/json"
        ],
        "produces":[
          "application/json;charset=UTF-8"
        ],
        "parameters":[
          {
            "name":"adId",
            "in":"path",
            "description":"adId",
            "required":true,
            "type":"string"
          },
          {
            "name":"Authorization",
            "in":"header",
            "description":"Authorization",
            "required":true,
            "type":"string"
          }
        ],
        "responses":{
          "200":{
            "description":"OK"
          },
          "204":{
            "description":"No Content"
          },
          "401":{
            "description":"Unauthorized"
          },
          "403":{
            "description":"Forbidden"
          }
        }
      }
    }
  },
  "definitions":{
    "FavoriteAd":{
      "type":"object",
      "properties":{
        "adId":{
          "type":"string"
        },
        "userId":{
          "type":"string"
        }
      }
    },
    "GetFavoritesResponse":{
      "type":"object",
      "properties":{
        "favorites":{
          "type":"array",
          "items":{
            "$ref":"#/definitions/FavoriteAd"
          }
        }
      }
    },
    "Single«ResponseEntity«GetFavoritesResponse»»":{
      "type":"object"
    }
  }
}
Retrofit2 + RxJava2 Interface generated in Kotlin

It will generate the interface and the models related to that interface.

package com.mycompany.mylibrary

import io.reactivex.Completable
import io.reactivex.Single
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.PUT
import retrofit2.http.Path

interface componentNameApiInterface {
    @GET("/favorites")
    fun getFavorites(): Single<GetFavoritesResponse>

    @PUT("/favorites/{adId}")
    fun saveFavorite(@Path("adId") adId: String): Completable

    @DELETE("/favorites/{adId}")
    fun deleteFavorite(@Path("adId") adId: String): Completable
}

Download

RELEASE

You can download it through the intelliJ/AndroidStudio plugin interface or you can check: https://plugins.jetbrains.com/plugin/10206-protein--android-component-builder

Build it yourself!

  1. If you want to build it locally you need download the latest version of IntelliJ Community https://www.jetbrains.com/idea/download/#section=mac
  2. Clone this repository ([email protected]:AdevintaSpain/protein.git)
  3. Execute "RunIdea" gradle task

Who made this

Ferran Pons
Ferran Pons

Apps using Protein

The following is a list of some of the public apps using Protein and are published on the Google Play Store.

Want to add your app? Found an app that no longer works or no longer uses Protein? Please submit a pull request on GitHub to update this page!

vibbo Fotocasa

Contribute

  1. Create an issue to discuss about your idea
  2. [Fork it] (https://github.com/AdevintaSpain/protein/fork)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request
  7. Profit! ✅

Bugs and Feedback

For bugs, questions and discussions please use the Github Issues.

License

Copyright 2018 Adevinta Spain S.L.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].