Class ReducedJsonMetadataTypeWriter

  • All Implemented Interfaces:
    TypeWriter, MetadataTypeWriter

    public class ReducedJsonMetadataTypeWriter
    extends AbstractJsonMetadataTypeWriter
    MetadataTypeWriter implementation that serializes a MetadataType object into a JSON object with a reduced structure by creating a type catalog for all ObjectTypes found.

    The end serialization ends up with an structure like the one described in the following snippet.

    /**

     {
       "value": {...}
       "catalog": {...}
     }
     

    The value element contains the serializing MetadataType structure with references to the catalog. NOTE that if the serializing object is an object type, then a simple reference to the catalog will be described in the value field. e.g.: @{code ... "value"{ type: "@ref:myObjectTypeId" } ...}

    The catalog contains all the described object types in the root MetadataType, also, ObjectTypes described in the catalog can also contain references to other types declared in that catalog.

    Since:
    1.2.0, 1.1.7