Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I use jackson library and I have @JsonPOJOBuilder class for deserialize JSON. I added @JsonIgnoreProperties for ignore some fields. For example:
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@SuperBuilder
@JsonDeserialize(builder = SubClass.BuilderImpl.class)
public class SubClass extends MainClass {
@JsonPOJOBuilder(withPrefix = "")
@JsonIgnoreProperties({"a1", "a2"})
static final class BuilderImpl
extends builder<SubClass, BuilderImpl> {
public SubClass() {
super();
I need get throw when json with some of ignored field, such as
objectMapper.configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, true);
How can I do this with annotation or, maybe, exist other variant do this in SubClass?
Thanks a lot.
–
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.