Description
JSON Content Rules (JCR) is a specification language standardized by 3GPP, primarily documented in TS 29.155. It defines a syntax and semantics for creating rules that describe the expected structure and content of JSON documents. These rules act as a schema, specifying allowed data types (e.g., strings, numbers, booleans, arrays, objects), mandatory and optional fields, value constraints (e.g., ranges, patterns, enumerations), and nesting relationships. In practice, JCR rules are textual definitions that can be processed by validation engines. A network function or API gateway can use a JCR validator to check incoming or outgoing JSON messages against the predefined rules, ensuring they conform to the expected format before further processing. This validation is crucial for preventing malformed data from causing errors in service logic or interoperability issues between systems. The language supports complex constructs like conditional rules (e.g., if a field 'serviceType' is 'VoLTE', then another field 'codec' must be present), references for reusing common rule definitions, and annotations for documentation. Its role in the 3GPP ecosystem is to provide a machine-readable contract for data exchange, particularly in Service-Based Interfaces (SBIs) within the 5G Core network, where APIs extensively use JSON. By formalizing data expectations, JCR reduces integration effort, aids in automated testing, and enhances the reliability of network service interactions.
Purpose & Motivation
JCR was created to address the growing use of JSON as the primary data interchange format in modern, web-oriented network architectures, specifically the 5G Service-Based Architecture (SBA). Prior approaches often relied on informal documentation or proprietary schema definitions, leading to inconsistencies, integration errors, and increased development time for network function vendors and application developers. The motivation stemmed from the need for a standardized, vendor-neutral way to define the precise structure of JSON payloads used in 3GPP-defined APIs, such as those between Network Repository Functions (NRF), Network Exposure Functions (NEF), and other core network elements. By providing a formal rule language, 3GPP aimed to ensure that all implementations interpret API data contracts identically, thereby solving interoperability problems that could arise from ambiguous specifications. It also facilitates automated tooling for code generation, documentation, and validation, streamlining the development and testing lifecycle for 5G network software. Historically, similar needs in other protocols were met by languages like ASN.1 or XML Schema, but JCR is tailored for the JSON format's simplicity and prevalence in RESTful APIs, aligning with the industry shift towards web technologies in telecommunications.
Key Features
- Formal schema definition for JSON data structures
- Support for data type validation (strings, numbers, booleans, null, arrays, objects)
- Constraint specification for values (ranges, regular expressions, enumerated lists)
- Rule composition using operators (AND, OR, NOT) and references for reuse
- Conditional rule logic based on field values
- Annotation capability for embedding human-readable documentation within rules
Evolution Across Releases
JCR was initially introduced in Release 13 within TS 29.155. The initial architecture defined the core JCR language syntax, including rules for primitive types, arrays, objects, and basic constraints. It established the foundational capability for validating JSON structures used in early 3GPP service interfaces, providing a standardized alternative to ad-hoc JSON descriptions.
Defining Specifications
| Specification | Title |
|---|---|
| TS 29.155 | 3GPP TS 29.155 |