Jackson's Access.WRITE_ONLY during test null

前端 未结 3 1869
栀梦
栀梦 2021-01-15 01:21

I\'m currently playing around with Jackson\'s de/serialization features and I encountered a problem, I don\'t know how to solve.

During my test the @JsonProper

3条回答
  •  臣服心动
    2021-01-15 01:27

    I had the same problem, with a similar setup. The problem is in the test input data. Basically, writeValueAsBytes() will ignore the password while serializing exactly as instructed by the annotation.

    Note that, Access.WRITE_ONLY basically means "SetterOnly" or "DeserializationOnly" not the other way around.

提交回复
热议问题