users@jsonb-spec.java.net

[jsonb-spec users] [jsr367-experts] [33-I-JSON Compatibility] Proposal

From: Martin Vojtek <voytoo_at_gmail.com>
Date: Sat, 18 Apr 2015 19:53:36 +0200

Hi Experts,


JSON-B should provide support or some level of compliance with I-JSON
specification.

https://tools.ietf.org/html/rfc7493

There are several things to discuss.

Should JSON-B support I-JSON by default? My proposal is to not support all
the recommendations of I-JSON by default.

If we agree on that, what specific parts of I-JSON should JSON-B provide by
default?


Proposal of parts (of I-JSON) to support by JSON-B by default:

Should be supported by default:
- Encoding and Characters (UTF-8 by default)
- Object constraints (no members with duplicate name)
- MUST-IGNORE policy - partial mapping
- Time and Date Handling - serialize accoring to I-JSON

Should not be supported by default:
- Numbers - serialize big number(s) into string (and deser given strings
into number)
- Top-Level Constructs - fail fast when ser/deser something different than
object/array as top-level JSON
- binary data encoded as a string in base64url


To support I-JSON fully in some case, I propose to provide I-JSON
compatibility mode available via config property.

JsonbConfig config = new
JsonbConfig().setProperty("jsonb.i-json.compliance", true);
Jsonb jsonb = JsonbBuilder.create(config);

Looking forward to your feedback.

MartinV