Skip to content

Change default of DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES to true for 3.0 #4858

Closed

Description

@cowtowncoder

Describe your Issue

As of Jackson 2.x, DeserializationFeature. FAIL_ON_NULL_FOR_PRIMITIVES defaults to false, allowing coercion from JSON null into Java int, long and so on.
For some users -- and especially on "low null" languages like Kotlin -- such coercion is rarely expected, so suggestion was made to change the default.

No decision is yet made: discussion for helping decision is here:

FasterXML/jackson-future-ideas#79

this issue is placeholder until decision is made.

Activity

  1. added
    to-evaluate
    3.0
    and removed
    to-evaluate
    on Dec 18, 2024
  2. yawkat commented on Dec 30, 2024

    @yawkat
    Member

    I assume title should say "change to true"?

    Sounds like a good change to me.

  3. changed the title [-]Change default of `DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES` to `false` for 3.0[/-] [+]Change default of `DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES` to `true` for 3.0[/+] on Dec 31, 2024
  4. cowtowncoder commented on Dec 31, 2024

    @cowtowncoder
    MemberAuthor

    @yawkat Thanks, yes fixed that typo. And looks like proposal is passing (5 to 1 voting as of now).

  5. cowtowncoder commented on Jan 7, 2025

    @cowtowncoder
    MemberAuthor

    As per FasterXML/jackson-future-ideas#79, proposal approved, will work on this.

  6. added 2 commits that reference this issue on Jan 7, 2025
    4f6aec4
    b63eb33
  7. JooHyukKim commented on Jan 8, 2025

    @JooHyukKim
    Member

    Added PR to push through changes in #4890.
    Modified JSTEP-2 accordingly.

  8. added a commit that references this issue on Jan 9, 2025
  9. JooHyukKim commented on Jan 9, 2025

    @JooHyukKim
    Member

    Per-test modification needed after #4884 merged.

  10. JooHyukKim commented on Jan 9, 2025

    @JooHyukKim
    Member

    @cowtowncoder Made fixes to most of modules. all failing tests seem to be reasonable (nothing buggy).

    May I ask for help with Scala module @pjfanning ?

  11. cowtowncoder commented on Jan 9, 2025

    @cowtowncoder
    MemberAuthor

    @JooHyukKim yes, @pjfanning maintains Scala module and should be able to help.

    Looks like it's only 4 test failures, fortunately:

    [info] Tests: succeeded 530, failed 4, canceled 0, ignored 8, pending 0
    [info] *** 4 TESTS FAILED ***
    
  12. added
    3.0-release-notes
    on Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.03.0-release-notes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions