MESSAGE FORMATS & SCHEMAS 12 MIN READ 2026.05.06

> Context Interchange JSON Schema Definition

A comprehensive specification for JSON schema definitions used in the context interchange between systems, detailing required fields, data types, and serialization standards.

Context Interchange JSON Schema Definition

1. Introduction

This document specifies the JSON schema definitions used for context interchange in ECM Protocol v1.0.0. The schema encompasses the structure, required fields, data types, and serialization standards necessary to ensure reliable and consistent data exchange between systems implementing the protocol.

2. Schema Structure

The JSON schema for context interchange is designed to encapsulate various data elements essential for ECM Protocol. The schema is defined to be extensible, allowing for future enhancements in a backward-compatible manner (see ยง4.5 on Compatibility & Versioning).

2.1 Context Schema Definition

The context interchange JSON schema is structured as follows:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ecmprotocol.com/schemas/context-interchange.schema.json",
  "title": "Context Interchange Schema",
  "type": "object",
  "properties": {
    "contextId": {
      "type": "string",
      "description": "A unique identifier for the context."
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "The ISO 8601 timestamp of the context generation."
    },
    "data": {
      "type": "object",
      "description": "The serialized data required for context sharing.",
      "properties": {
        "key": {
          "type": "string",
          "description": "A key for identifying the data element."
        },
        "value": {
          "type": ["string", "number", "boolean", "object", "array"],
          "description": "The value of the data element, supporting multiple types."
        }
      },
      "required": ["key", "value"]
    }
  },
  "required": ["contextId", "timestamp", "data"]
}

3. Normative Requirements

The following normative requirements are established for systems implementing the context interchange schema:

  • Each context message MUST include a contextId which MUST be globally unique to prevent collisions.
  • The timestamp field MUST conform to the ISO 8601 standard to ensure temporal consistency.
  • Context data serialized in the data field MUST validate against the defined data schema, enforcing both presence and type constraints.
  • Implementations MAY extend the schema to include additional properties, but such extensions SHOULD NOT interfere with existing schema properties to maintain backward compatibility.

4. Data Serialization

The serialization format for the context interchange MUST adhere to the JSON standard as specified by RFC 8259. This ensures wide compatibility and interoperability with existing JSON libraries and tools.

5. Compatibility & Versioning

Additions to the schema, including new optional fields or expanded data types, are managed under the ECM Protocol's backward compatibility policy. The specification allows for non-breaking extensions, ensuring continued operability across different versions of the protocol.

5.1 Backward Compatibility

All future revisions to the JSON schema SHOULD strive to maintain backward compatibility, permitting existing implementations to function correctly without requiring immediate updates.

+------------+ +------------+| Producer | --+-> | Consumer |+------------+ +------------+

6. Related Sections

For further clarification on the schema design and implementation guidelines, see ยง3.2 of the Core Protocol document, which outlines the foundational principles and technical constraints for constructing ECM Protocol-compliant schemas.

//TAGS

MESSAGE FORMATS SCHEMAS JSON CONTEXT INTERCHANGE