Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Conversation

@fzoro
Copy link

@fzoro fzoro commented Feb 25, 2019

Serialization with jackson fails when moipAccount field is null.

Kotlin code to reproduce the issue.

    // all fields null(which is ok)
    val c = Customer()
    val objectMapper = ObjectMapper()
    objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL)
    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
    val json = objectMapper.writeValueAsString(c) // throws NPE, since it evaluates all fields.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant