JsonObject class
The JsonObject class is the core representation of a JSON object within InsuranceSuite. The class can be used for both serialization and parsing / deserialization of JSON data. This use can be either with or without an explicit JSON Schema definition for the object. A JsonObject is essentially just a Map<String, Object> where every value in the Map is either a scalar value that our platform knows how to serialize, another JsonObject, or a List of scalars or JsonObjects. JsonObjects can be manipulated directly as Maps or can be optionally wrapped with statically-typed getters and setters. See the javadoc on the JsonObject class for details about the various helper methods for parsing and serializing data.
Schema versus schemaless
JsonObjects can be serialized or deserialized either with or without a JSON Schema. See JSON parsing and validation and JSON serialization for more details about how parsing and serialization work differently when a schema is supplied versus when one is not.
Late-binding of schemas
A JsonObject can work either with or without a schema. The purpose of this ability is to enable the late binding of REST API request and response schemas. Being "late-bound" allows for the extension of the core schemas by content or customer extensions.
For example, application code can be written against the schema gw.pc.policy.policy-1.0. The application code uses a JsonObject to represent input and output data for REST APIs that make use of definitions within the schema. A customer could then extend the schema to customer.policy.policy-1.0 and extend the REST API to use the custom JSON schema. The end result is that the REST API framework knows what schema to use for input deserialization and output serialization—the customer schema.
However, the core application code does not need to be aware of the extension schema at all. In fact, the core application code does not even need to know the context in which it is being invoked. This strategic ignorance allows the same code to be shared across schema definitions for different minor versions of the same schema. This strategy also allows code sharing across for structurally similar but nominally distinct schema versions.
Keeping the JsonObject disconnected from the schema used to serialize or deserialize the object allows for code reuse and composition across layers. At the same time, the separation also allows the calling code ultimately to validate that the data conforms to the schema. Moreover, the separation allows the REST API framework to validate schema conformity.
