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

Prevent construction of null-valued JsonNodes (like TextNode) #4381

Closed
cowtowncoder opened this issue Feb 13, 2024 · 3 comments
Closed

Prevent construction of null-valued JsonNodes (like TextNode) #4381

cowtowncoder opened this issue Feb 13, 2024 · 3 comments
Labels

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Feb 13, 2024

Describe your Issue

(note: follow-up to #4378 which is for 2.x)

We should not allow constructing JsonNodes around null, except for explicit NullNode: attempts to do so should throw a JacksonException (DatabindException subtype).
This should be checked for:

  • TextNode
  • BigIntegerNode
  • DecimalNode
  • BinaryNode

There may also be cases where we decide null is appropriate content.
One such type is POJONode.

@cowtowncoder
Copy link
Member Author

cc @pjfanning .

@pjfanning
Copy link
Member

I would include BinaryNode here too.

@cowtowncoder
Copy link
Member Author

cowtowncoder commented Feb 14, 2024

@pjfanning Ok I have no strong opinion so sure, why not.

EDIT: BinaryNode included as well.

@cowtowncoder cowtowncoder changed the title Prevent construction of null-valued JsonNodes (like TextNode) in 3.0 Prevent construction of null-valued JsonNodes (like TextNode) Mar 2, 2024
cowtowncoder added a commit that referenced this issue Mar 2, 2024
cowtowncoder added a commit that referenced this issue Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants