Skip to content

Change JsonNode.stringValue() of NullNode to return null, not fail (3.0) #5287

@cowtowncoder

Description

@cowtowncoder

(note: follow-up to #5283)

Initial implementation of "Extended set of scalar value accessors " of JSTEP-3 contains implementation of

JsonNode.stringValue()

(and 2 variants, stringValue(String defaultValue), stringValueOpt())

that will NOT accept JSON null as legitimate value, and then throws exception (or returns "defaultValue()"
But based on developer feedback, it seems sensible to consider JSON null as indicating value to return as Java null (in case of stringValue()).

NOTE: JSON null will lead to returning "default value" for stringValue(defaultValue) and Optional.empty() for stringValueOpt().

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.0Issue planned for initial 3.0 release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions