Skip to content

Branch main Contract JsonCanonicalizationRule

github-actions[bot] edited this page Jul 14, 2026 · 75 revisions

Contract: Jsoncanonicalizationrule

Back to Branch Overview

Field Value
Branch main
Source specs/contracts/JsonCanonicalizationRule.schema.json
Commit 774b981ef226
Synced (UTC) 2026-07-14T05:14:42Z

Visual Context

Contract pages define the machine-checkable object shape that crosses a lifecycle boundary.

flowchart LR
  Producer["Lifecycle producer"] --> Contract["Contract schema"]
  Contract --> Example["Schema example"]
  Example --> Validator["Schema validator"]
  Contract --> Fixture["Conformance fixture output"]
  Fixture --> Gate["Base-design gate"]
Loading

Reading Checklist

Question Where to look
Which lifecycle boundary uses it? Read description, required fields, and linked references.
What diagnostics are mandatory? Inspect diagnostic reference fields and rule-reference links.
How is it validated? Compare this schema with fixtures/schema_examples/ and conformance vectors.

JSON Payload

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "JsonCanonicalizationRule",
  "description": "Deterministic JSON serialization and hashing rule.",
  "type": "object",
  "properties": {
    "ruleID": {
      "type": "string"
    },
    "objectKeyOrdering": {
      "type": "string",
      "enum": [
        "LEXICOGRAPHIC_UTF8"
      ]
    },
    "arrayOrdering": {
      "type": "string",
      "enum": [
        "PRESERVE_INPUT_ORDER"
      ]
    },
    "numberEncoding": {
      "type": "string",
      "enum": [
        "JSON_NUMBER_CANONICAL"
      ]
    },
    "hashAlgorithm": {
      "type": "string",
      "enum": [
        "SHA-256"
      ]
    }
  },
  "required": [
    "ruleID",
    "objectKeyOrdering",
    "arrayOrdering",
    "numberEncoding",
    "hashAlgorithm"
  ],
  "additionalProperties": false
}

Clone this wiki locally