Executing an API request that returns 0 or 1 for a field that must be explicitly true / false. At the same time, I also make other requests to similar APIs for the same type of fields, which will return true / false. I would like to share the code that processes this response from all APIs.
In this case, I think the best option would be to use the converter of your mapping library (jackson, etc.).
In simple Kotlin, you can use the extension / property function for this purpose.
IRus
source share