jakartaee / jakartaee/jsonb-api

Standard Exception for Non-Deserializable

Open
#196 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
95
Forks
41
Avg merge
1d 6h
Merged PRs (30d)
35

Description

Currently the method `deserialize` does not define what shall happen in case a deserializer expects some particular JSON, but does actually find different JSON. This opens way for several outcomes:
* `return null`
* `return defaultObject`
* `throw RuntimeException`
* `throw `

In the current situation it is hard for application developers to use deserializers as he has to know what particular solution each particular deserializer chooses. So the outcome is not predictable nor similar.

From the view of an application developer it would be good if a general rule would be defined by JSON-B an application programmer can rely on, and a custom deserializer vendor can follow. My persion but unbias proposal would be to defined a standard exception for that case.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the JSON-B deserialize contract and how custom deserializers currently handle JSON that does not match their expectations. Determine the standard exception behavior proposed in the issue and define what application developers and deserializer vendors should be able to rely on; done means the rule is agreed and specified consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.