My company is considering creating a mpp library t...
# multiplatform
d
My company is considering creating a mpp library to share data models exposed by our backend api with the frontend. The backend uses Spring Boot and Jackson and the frontend (which is also a mpp project) uses kotlinx.serialization. How will this work? And how do we solve Jackson specific annotations like
@JsonFormat(pattern = "yyyy-MM-dd")
?
d
First question, I'm guessing for some reason using
kotlinx.serialization
is not an option?
d
No, the backend team wanted to keep Jackson, it works well with Spring I guess. Will check out, thanks 👍
u
Your common data objects will live in the common module (pure kotlin, so no jvm dependencies), so they won't be able to import Jackson annotations anyways. You could use kotlinx.serialization annotations, as kotlinx.serialization is multiplatform library and you can reference it from common module. There might be some other way of dealing with this, but I'm not aware of it.