postman-code-generators
postman-code-generators copied to clipboard
Add support to kotlin RetroFit client
Hi. What can be the best way to work on this? I have some questions/comments:
- 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?
- What can be the default serializer? I could say that gson is ok.
- 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.
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.
Hi. @HeshamAmer thanks for your feedback. I'll try to start working on this
I can create an Android Kotlin plugin. Do you have plans for it or I can start developing?@webholik
@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 I can work on the three android or Kotlin multiplatform HTTP request libraries such as RetroFit, OkHttp, and android HttpURLConnection.