Choose what this site may use

This site uses strictly necessary cookies to work and to remember your privacy choices. With your permission it would also load content hosted by other services, such as videos, maps and fonts, which then receive your network address and device data. We do not sell or share your personal information and we run no advertising. Choose Accept all, Reject all or Customise. You can change your mind at any time through Privacy choices at the foot of every page.

  • Always on

    Needed for the site to work and to remember your privacy choices. Always on.

  • Remembers settings you choose, such as the light or dark display, in your browser.

  • Loads videos, maps and other content hosted by other services. Those services receive your address and device data.

Menu Close
In this section: Specification
Specification
Functions
Schemas
Registers

CorrectionNotice

Source schemas/json/correction-notice.schema.json

On this page
  1. Properties
  2. Positive fixtures
  3. Negative fixtures
  4. Mappings to open standards
  5. Schema

Correction of one version of a record (OBSP 0.1 section 5.9): the corrected record and version, the state transition from the encoded transition table, the reason, the issuer role and every dependant it invalidates. Supersession never deletes history; a consumer may only raise a dispute.

FieldValue
Identifierurn:obsp:schema:v3.1:correctionnotice
Dialecthttps://json-schema.org/draft/2020-12/schema
Used by functionsCorrect

Properties

PropertyRequiredTypeDescription
schemaVersionyesreference
apiVersionyesconstant
kindyesconstant
protocolVersionyesconstant
noticeUniyesreference
correctedRecordyesobject
transitionyesreference
supersededBynoreference
reasonyesobject
issueryesobject
dependantsyesarrayEvery dependant the notice invalidates; an explicit empty list when there is none
issuedAtyesreference
effectiveAtnoreference
signatureyesreference
evidenceRefsyesarray
recordedAtyesreference
extensionsnoreference

Positive fixtures

  • correction-notice.dispute-raised.valid.json
  • correction-notice.valid.json

Negative fixtures

  • correction-notice.company-issuer.json: issuer is a protocol role, never a company name
  • correction-notice.consumer-withdraws.json: a consumer may only raise a dispute
  • correction-notice.current-to-current.json: no self-transition
  • correction-notice.missing-dependants.json: dependants list is required (explicitly empty when none)
  • correction-notice.missing-reason.json: reason required
  • correction-notice.recalled-to-superseded.json: RECALLED is terminal
  • correction-notice.superseded-to-current.json: SUPERSEDED is terminal
  • correction-notice.superseded-without-successor.json: SUPERSEDED names its successor version
  • correction-notice.withdrawn-to-disputed.json: WITHDRAWN is terminal

Mappings to open standards

A mapping to a standard, never a conformance statement.

  • maps to NS-3 Risk index record UNIs (relation REL-NS-3)

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:obsp:schema:v3.1:correctionnotice",
  "title": "CorrectionNotice",
  "description": "Correction of one version of a record (OBSP 0.1 section 5.9): the corrected record and version, the state transition from the encoded transition table, the reason, the issuer role and every dependant it invalidates. Supersession never deletes history; a consumer may only raise a dispute.",
  "type": "object",
  "required": [
    "schemaVersion",
    "apiVersion",
    "kind",
    "protocolVersion",
    "noticeUni",
    "correctedRecord",
    "transition",
    "reason",
    "issuer",
    "dependants",
    "issuedAt",
    "signature",
    "evidenceRefs",
    "recordedAt"
  ],
  "properties": {
    "schemaVersion": {
      "$ref": "#/$defs/SchemaVersion"
    },
    "apiVersion": {
      "const": "obsp/correction-notice/v3.1"
    },
    "kind": {
      "const": "CorrectionNotice"
    },
    "protocolVersion": {
      "const": "obsp/0.1"
    },
    "noticeUni": {
      "$ref": "#/$defs/Uni"
    },
    "correctedRecord": {
      "type": "object",
      "required": [
        "uni",
        "version",
        "recordKind",
        "digest"
      ],
      "properties": {
        "uni": {
          "$ref": "#/$defs/Uni"
        },
        "version": {
          "$ref": "#/$defs/RecordVersion"
        },
        "recordKind": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{2,63}$",
          "description": "Contract stem of the corrected record, e.g. observation-record"
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "additionalProperties": false
    },
    "transition": {
      "$ref": "#/$defs/CorrectionTransition"
    },
    "supersededBy": {
      "$ref": "#/$defs/VersionedRecordRef"
    },
    "reason": {
      "type": "object",
      "required": [
        "code",
        "text"
      ],
      "properties": {
        "code": {
          "enum": [
            "VALUE_ERROR",
            "CALIBRATION_ERROR",
            "TIME_ERROR",
            "PROVENANCE_ERROR",
            "METHOD_ERROR",
            "RIGHTS_CHANGE",
            "SECURITY_INCIDENT",
            "DUPLICATE",
            "DISPUTE_RAISED",
            "DISPUTE_RESOLVED_UPHELD"
          ]
        },
        "text": {
          "$ref": "#/$defs/NonEmptyString"
        }
      },
      "additionalProperties": false
    },
    "issuer": {
      "type": "object",
      "required": [
        "role",
        "uni"
      ],
      "properties": {
        "role": {
          "$ref": "#/$defs/ProtocolRole"
        },
        "uni": {
          "$ref": "#/$defs/Uni"
        }
      },
      "additionalProperties": false
    },
    "dependants": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "required": [
          "uni",
          "version",
          "action"
        ],
        "properties": {
          "uni": {
            "$ref": "#/$defs/Uni"
          },
          "version": {
            "$ref": "#/$defs/RecordVersion"
          },
          "recordKind": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{2,63}$"
          },
          "action": {
            "enum": [
              "MARK_STALE",
              "RECOMPUTE",
              "WITHDRAW",
              "NOTIFY_ONLY"
            ]
          }
        },
        "additionalProperties": false
      },
      "description": "Every dependant the notice invalidates; an explicit empty list when there is none"
    },
    "issuedAt": {
      "$ref": "#/$defs/Timestamp"
    },
    "effectiveAt": {
      "$ref": "#/$defs/Timestamp"
    },
    "signature": {
      "$ref": "#/$defs/Signature"
    },
    "evidenceRefs": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/EvidenceRef"
      }
    },
    "recordedAt": {
      "$ref": "#/$defs/Timestamp"
    },
    "extensions": {
      "$ref": "#/$defs/Extensions"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "transition": {
            "properties": {
              "to": {
                "const": "SUPERSEDED"
              }
            }
          }
        }
      },
      "then": {
        "required": [
          "supersededBy"
        ]
      },
      "else": {
        "not": {
          "required": [
            "supersededBy"
          ]
        }
      }
    },
    {
      "if": {
        "properties": {
          "transition": {
            "properties": {
              "to": {
                "const": "DISPUTED"
              }
            }
          }
        }
      },
      "then": {
        "properties": {
          "reason": {
            "properties": {
              "code": {
                "const": "DISPUTE_RAISED"
              }
            }
          }
        }
      },
      "else": {
        "properties": {
          "reason": {
            "properties": {
              "code": {
                "not": {
                  "const": "DISPUTE_RAISED"
                }
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "transition": {
            "properties": {
              "from": {
                "const": "DISPUTED"
              },
              "to": {
                "const": "CURRENT"
              }
            }
          }
        }
      },
      "then": {
        "properties": {
          "reason": {
            "properties": {
              "code": {
                "const": "DISPUTE_RESOLVED_UPHELD"
              }
            }
          }
        }
      },
      "else": {
        "properties": {
          "reason": {
            "properties": {
              "code": {
                "not": {
                  "const": "DISPUTE_RESOLVED_UPHELD"
                }
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "issuer": {
            "properties": {
              "role": {
                "const": "CONSUMER"
              }
            }
          }
        }
      },
      "then": {
        "properties": {
          "transition": {
            "properties": {
              "to": {
                "const": "DISPUTED"
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "SchemaVersion": {
      "type": "string",
      "const": "3.1.0"
    },
    "Uni": {
      "type": "string",
      "minLength": 8,
      "maxLength": 256,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9:._/@-]{7,255}$",
      "description": "Durable UNI or typed unresolved identifier according to authority rules"
    },
    "Digest": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{1,31}:[A-Fa-f0-9]{32,128}$",
      "description": "Algorithm-prefixed hexadecimal digest"
    },
    "NonEmptyString": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
    },
    "Timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "RecordVersion": {
      "type": "string",
      "pattern": "^[0-9]+(\\.[0-9]+){0,2}$"
    },
    "Extensions": {
      "type": "object",
      "description": "Namespaced extension bag; unknown top-level fields remain forbidden.",
      "propertyNames": {
        "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)+$"
      },
      "additionalProperties": true
    },
    "EvidenceRef": {
      "type": "object",
      "required": [
        "uri",
        "digest"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        },
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "recordedAt": {
          "$ref": "#/$defs/Timestamp"
        }
      },
      "additionalProperties": false
    },
    "ProtocolRole": {
      "enum": [
        "NODE",
        "SITE_CELL",
        "CLUSTER",
        "FED_PEER",
        "GRID_OPERATOR",
        "PROVIDER",
        "VERIFIER",
        "CONSUMER",
        "STEWARD"
      ],
      "description": "OBSP 0.1 participant role (specification section 3). Roles, never company names."
    },
    "RecordRef": {
      "type": "object",
      "required": [
        "uni",
        "digest"
      ],
      "properties": {
        "uni": {
          "$ref": "#/$defs/Uni"
        },
        "version": {
          "$ref": "#/$defs/RecordVersion"
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "additionalProperties": false
    },
    "VersionedRecordRef": {
      "type": "object",
      "required": [
        "uni",
        "version",
        "digest"
      ],
      "properties": {
        "uni": {
          "$ref": "#/$defs/Uni"
        },
        "version": {
          "$ref": "#/$defs/RecordVersion"
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "additionalProperties": false
    },
    "CorrectionState": {
      "enum": [
        "CURRENT",
        "DISPUTED",
        "SUPERSEDED",
        "WITHDRAWN",
        "RECALLED"
      ]
    },
    "CorrectionTransition": {
      "type": "object",
      "required": [
        "from",
        "to"
      ],
      "properties": {
        "from": {
          "$ref": "#/$defs/CorrectionState"
        },
        "to": {
          "$ref": "#/$defs/CorrectionState"
        }
      },
      "additionalProperties": false,
      "oneOf": [
        {
          "properties": {
            "from": {
              "const": "CURRENT"
            },
            "to": {
              "enum": [
                "DISPUTED",
                "SUPERSEDED",
                "WITHDRAWN",
                "RECALLED"
              ]
            }
          }
        },
        {
          "properties": {
            "from": {
              "const": "DISPUTED"
            },
            "to": {
              "enum": [
                "CURRENT",
                "SUPERSEDED",
                "WITHDRAWN",
                "RECALLED"
              ]
            }
          }
        }
      ],
      "description": "Allowed correction transitions (OBSP 0.1 section 5.9): CURRENT to DISPUTED, SUPERSEDED, WITHDRAWN or RECALLED; DISPUTED to CURRENT, SUPERSEDED, WITHDRAWN or RECALLED. SUPERSEDED, WITHDRAWN and RECALLED are terminal for a version."
    },
    "Signature": {
      "type": "object",
      "required": [
        "algorithm",
        "signatureDigest",
        "keyRef",
        "signerRole"
      ],
      "properties": {
        "algorithm": {
          "enum": [
            "ED25519",
            "ECDSA_P256_SHA256",
            "ECDSA_P384_SHA384"
          ]
        },
        "signatureDigest": {
          "$ref": "#/$defs/Digest"
        },
        "keyRef": {
          "type": "string",
          "pattern": "^(secret|key)://[A-Za-z0-9][A-Za-z0-9:._/@-]{2,250}$"
        },
        "signerRole": {
          "$ref": "#/$defs/ProtocolRole"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}