jakartaee / jakartaee/jsonp-api
JsonObject's getString() should provide same interface as other getters
- Dominant language
- Java
- Stars
- 160
- Forks
- 64
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 4
Description
`JsonObject`'s getters are inconsistent in the interfaces that they provide.
`getString("thing")` throws an exception if the key is missing, all other getters return null.
As a convenience method, `getString()` should provide the same interface as the other getters, which all seem to model `Map.get()` in returning null when the key is missing.
The obvious workaround is to use `getString("thing", null)`. But `getString("thing")` should not be violating the interface provided by all other methods.
Contributor guide
Research direction
Start at the JsonObject getString("thing") entry point and compare its missing-key behavior with the other JsonObject getters. Confirm how the overload accepting a default value behaves. Done means the no-default getString() call returns null for a missing key, matching the other getters and the Map.get() model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100