JCR

JSON Content Rules


Overview

JSON Content Rules (JCR) is a language for describing and testing the interchange of data in JSON [RFC7159] format used by computer protocols and processes. The syntax of JCR is not JSON but is "JSON-like", possessing the conciseness and utility that has made JSON popular.

As an example, the following JSON is taken from RFC 7159:

{
    "Image": {
        "Width":  800,
        "Height": 600,
        "Title":  "View from 15th Floor",
        "Thumbnail": {
            "Url":    "http://www.example.com/image/481989943",
            "Height": 125,
            "Width":  100
        },
    "Animated" : false,
    "IDs": [116, 943, 234, 38793]
    }
}

To give you a taste of JCR, it can be described using JCR as:

{
    "Image" : {
        "Width" : 0..1280,
        "Height" : 0..1024,
        "Title" : string,
        "Thumbnail" : {
            "Url" : uri,
            "Width" : 0..1280,
            "Height" : 0..1024
        },
        "Animated" : boolean,
        "IDs" : [ integer * ]
    }
}

To continue exploring JCR using this example, have a look at the tutorial.

For a more in-depth understanding of JCR take a look at the specifications.

Uses

There are many uses for JCR throughout the protocol and product development life-cycle, and even into deployment. These include:

  • helping specification authors concisely and clearly describe complex JSON data structures.
  • aiding software developers to verify their implementations conform to specifications by validating any generated JSON against the specified JCR.
  • aiding software developers by permitting specification of JCR based test sets.
  • aiding software implementors to resolve interoperability issues.
  • facilitating monitoring of JSON based protocols via comparison of observed JSON messages against their JCR specification.

One example of interoperability usage is [NicInfo], an RDAP client which can use JCR to help RDAP server operators find compatibility issues.

Find Out More

Find out more about JCR by looking at the specifications and tutorial.

You can experiment with JCR using the online checker, or by downloading one of the implementations.

Get Involved

Like JCR and want to know more? Know of an implementation we can list? Need help making JCR work for you? Contact us at .