Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serialization of inline classes looks broken #417

Closed
5V715 opened this issue Feb 23, 2021 · 2 comments
Closed

serialization of inline classes looks broken #417

5V715 opened this issue Feb 23, 2021 · 2 comments
Labels

Comments

@5V715
Copy link

5V715 commented Feb 23, 2021

When serializing inline classes the fieldname is looks off

import java.util.UUID
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
class SomeTest {

    companion object {
        @JvmStatic
        fun main(args: Array<String>) {
           val mapper = jacksonObjectMapper()
            val test = Wrapping(InvoiceId(UUID.randomUUID()))
            println(mapper.writeValueAsString(test))
        }
    }
}
inline class InvoiceId(val value: UUID)
data class Wrapping(val id: InvoiceId)

produces
{"id-p4lkGtA":"03fa0d6f-a609-417a-9e9d-9df866125cce"}

Expected behavior
{"id":"03fa0d6f-a609-417a-9e9d-9df866125cce"}

Kotlin:
Jackson-module-kotlin: 2.11.4

@5V715 5V715 added the bug label Feb 23, 2021
@5V715 5V715 changed the title Serialization of inline classes looks broken serialization of inline classes looks broken Feb 23, 2021
@efenderbosch
Copy link

@5V715 update to 2.12.1, it was fixed in that release

@dinomite
Copy link
Member

dinomite commented Mar 8, 2021

Thanks @efenderbosch. @5V715 Latest Jackson should work, this was fixed in #383

@dinomite dinomite closed this as completed Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants