Structs and Containers

A container is a named collection of fields. The container is versioned to indicate at any point in time the set of fields that can be present in the collection, but the collection of fields is not fixed permanently. A struct is a container being used within another MDC.

A container sometimes can be a field of another MDC and can be a top level MDC in other cases. Each type of serialization introduces an object in a new way. Container Definitions describes how containers are defined.

Table 1. Container Definitions
Format Description
XML For an MDC named "container_name" the start of a container looks like <container_name> and the end of a container looks like </container_name>. For completely empty containers, there can be a start and end pair, or it can be a single tag: <container_name/>.
EXAMPLE:
<MtxRequestSubscriberModify>
    ...
</MtxRequestSubscriberModify>
JSON In JSON, the start of an object is{ and the end is}. The name of the data container is specified using a field name that does not conflict with any other field name. The JSON representation of the same entity as the XML example above is:
{"$": "container_name", ... }
EXAMPLE:
{
    "$": "MtxRequestSubscriberModify",
    ...
}
OpenAPI JSON The OpenAPI JSON schema uses the mtx_container_name, mtx_sys_ver, and mtx_ext_ver fields which represent metadata about the container.
EXAMPLE:
{
    mtx_container_name":"MtxRequestSubscriberModify",
    "mtx_sys_ver": 5200,
    "mtx_ext_ver": 1,
    ....
}

A struct is a container that is used inside another container as a structured field an can be used in lists and arrays of structs. MtxSubscriberSearchData is a container used as a struct. This usage often occurs as a field in request objects. In the case of an MtxRequestSubscriberModify request, it is used as a struct for the field named SubscriberSearchData.

Table 2. Struct Definitions
Format Description
XML In XML, a field is introduced with an XML start tag consisting of the name of the field, and for structs, a set of start and end tags containing the name of the MDC name. The MDC name is within the start tag of the field and the end tag of the field.
EXAMPLE:
<MtxRequestSubscriberModify>
    <SubscriberSearchData>
        <MtxSubscriberSearchData>
        ...
        </MtxSubscriberSearchData>
    </SubscriberSearchData>
    ...
</MtxRequestSubscriberModify>
JSON In JSON, a field name is specified within quotes and followed by a colon ( : ). For a struct, the colon is followed by the JSON start { and end } characters for objects. The rest of the "struct" is emitted like other containers within the begin and end of object characters.
EXAMPLE:
{
    "$": "MtxRequestSubscriberModify",
    "SubscriberSearchData": {
        "$": "MtxSubscriberSearchData",
        ...
    },
    ...
}

OpenAPI JSON Style In OpenAPI format, field names are all lowerCamelCaseConverted, and the subscriber search block struct follows the rest of the container serialization rules within the JSON start { and end } characters for objects.
EXAMPLE:
{
    "mtx_container_name":"MtxRequestSubscriberModify",
    "mtx_sys_ver": 5200,
    "mtx_ext_ver": 1,
    "subscriberSearchData": {
        "mtx_container_name": "MtxSubscriberSearchData",
        "mtx_sys_ver": 5200,
        "mtx_ext_ver": 1,
        ...
    },
    ...
}