postman-code-generators icon indicating copy to clipboard operation
postman-code-generators copied to clipboard

Add support to kotlin RetroFit client

Open HeshamAmer opened this issue 5 years ago • 6 comments

HeshamAmer avatar Dec 20 '19 09:12 HeshamAmer

Hi. What can be the best way to work on this? I have some questions/comments:

  1. Retrofit interfaces are usually made with user-defined classes that represents the response from api call. How can be infere (or guess?) a name for objects to create classes with that name?
  2. What can be the default serializer? I could say that gson is ok.
  3. This issue should aim to generate the interface from the whole postman collection. It can be from just one request but I think that it will be much better to create the interface for the whole collection.

german1608 avatar Mar 11 '20 21:03 german1608

Hey there, Thanks for reaching out. 1- I think with Retro fit the DataModels are also defined as part of the interface, worst comes to worst you can just use String as a default return type and let the serialisation happen later. 2- Gson or Jackson are both nice. 3- I'm not sure here, whatever you find best.

HeshamAmer avatar Mar 11 '20 22:03 HeshamAmer

Hi. @HeshamAmer thanks for your feedback. I'll try to start working on this

german1608 avatar Mar 14 '20 15:03 german1608

I can create an Android Kotlin plugin. Do you have plans for it or I can start developing?@webholik

Husseinhj avatar Oct 13 '20 11:10 Husseinhj

@Husseinhj A Kotlin codegen would be a great addition! Just to be clear, you want to make code generator for RetroFit library or do you have something else in mind? I am not familiar with the Kotlin ecosystem and not sure how popular Retrofit is but we would ideally want something that is used by majority of Kotlin users.

webholik avatar Oct 13 '20 15:10 webholik

@webholik I can work on the three android or Kotlin multiplatform HTTP request libraries such as RetroFit, OkHttp, and android HttpURLConnection.

Husseinhj avatar Oct 13 '20 20:10 Husseinhj