Hi 👋Background: I've got a service, let's call it Service 1, that offers a RESTful API endpoint and uses Jackson for deserialization. Service 1 makes API calls to Service 2. To make these calls, Service 1 uses a Service 2 client SDK which is written in Kotlin, defines Kotlin DTOs, and uses Kotlin Serialization. The SDK isn't just written in Kotlin, it's actually auto-generated from an OpenAPI spec, so I can't easily change the SDK's code.Question: Some of the data Service 1 receives has to be passed verbatim to Service 2. I'm trying to avoid rewriting DTOs for all this data, since they're sitting right there in the SDK with Kotlin Serialization annotations. Is there some way for Service 1 to use Jackson to deserialize into those Kotin Serialization DTOs, e.g. treating
for these simple DTOs.
6 months ago
don’t do it. you don’t want your api of service1 to be tied to the api of service 2. thats bad architecture.