Skip to content

Conversation

@filiphr
Copy link

@filiphr filiphr commented Dec 28, 2025

This adds a new asXxxOr(defaultValue) method which returns default value instead of coercing when using NullNode like we discussed in #5417

@cowtowncoder
Copy link
Member

cowtowncoder commented Dec 29, 2025

I'm sorry for not following up on this, but just to mention, I am not really keen on adding a significant set of new methods, with fairly narrow scope. Especially since the role of JSON null has not been decided.

I hope to get to follow up on this within couple of days.

Basically -- I'll elaborate later on -- I'd be in favor of slightly different approach of something like

 public JsonNode JsonNode.nullAs(JsonNode);
 public JsonNode JsonNode.nullAs(Supplier<JsonNode>);

where we'd have one or two general-purpose converters for JSON null handling.

@github-actions
Copy link

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 78.79% 📈 +0.140%
Branches branches 72.58% 📈 +0.180%

Coverage data generated from JaCoCo test results

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