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

#893 Disable Jackson ObjectMapper FAIL_ON_UNKNOWN_PROPERTIES Deserialization Feature by default #896

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

amiriahmad72
Copy link
Contributor

@amiriahmad72 amiriahmad72 commented Jan 18, 2024

In order to disable Jackson ObjectMapper FAIL_ON_UNKNOWN_PROPERTIES Deserialization Feature by default , Edit static newObjectMapper method of JacksonSerializer:

static ObjectMapper newObjectMapper() {
    return new ObjectMapper()
            .registerModule(MODULE)
            .configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true) // https://github.com/jwtk/jjwt/issues/877
            .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); // https://github.com/jwtk/jjwt/issues/893
}

Also add specific test with json which has unknown field and must seserialize to custom data type.

This PR fixs #893

Note:
I close #894 PR and reopen this PR, because it has confilict with synchronous and same changes in #895 PR of @lhazlewood

@amiriahmad72
Copy link
Contributor Author

Hi @lhazlewood
Could you please check this PR?

@lhazlewood
Copy link
Contributor

@amiriahmad72 sorry about the delay, I should be able to review it properly today.

@lhazlewood lhazlewood added this to the 0.12.4 milestone Jan 25, 2024
@amiriahmad72
Copy link
Contributor Author

@lhazlewood Thank you for your review. I've updated the JavaDoc.

@lhazlewood lhazlewood merged commit fd619e0 into jwtk:master Jan 27, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants