Decision Gate Docs

Avaluació de portes determinista, reproduïble amb decisions auditable.

Asset Core docs

esquemes_registre

Registreu un esquema de forma de dades per a un llogater i un espai de noms.

Notes clau

  • Els esquemes són immutables; registrar la mateixa versió dues vegades falla.
  • Proporciona created_at per enregistrar quan es va redactar l’esquema.

Inputs

  • registre (requerit): Tipus: objecte.

Input Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "record": {
      "additionalProperties": false,
      "properties": {
        "created_at": {
          "oneOf": [
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "unix_millis"
                },
                "value": {
                  "type": "integer"
                }
              },
              "required": [
                "kind",
                "value"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "logical"
                },
                "value": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "kind",
                "value"
              ],
              "type": "object"
            }
          ]
        },
        "description": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "description": "Optional schema description.",
              "type": "string"
            }
          ]
        },
        "namespace_id": {
          "description": "Namespace identifier.",
          "minimum": 1,
          "type": "integer"
        },
        "schema": {
          "description": "JSON Schema payload.",
          "type": [
            "null",
            "boolean",
            "number",
            "string",
            "array",
            "object"
          ]
        },
        "schema_id": {
          "description": "Data shape identifier.",
          "type": "string"
        },
        "signing": {
          "additionalProperties": false,
          "properties": {
            "algorithm": {
              "default": null,
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "description": "Signature algorithm label.",
                  "type": "string"
                }
              ]
            },
            "key_id": {
              "description": "Signing key identifier.",
              "type": "string"
            },
            "signature": {
              "description": "Schema signature string.",
              "type": "string"
            }
          },
          "required": [
            "key_id",
            "signature"
          ],
          "type": "object"
        },
        "tenant_id": {
          "description": "Tenant identifier.",
          "minimum": 1,
          "type": "integer"
        },
        "version": {
          "description": "Data shape version identifier.",
          "type": "string"
        }
      },
      "required": [
        "tenant_id",
        "namespace_id",
        "schema_id",
        "version",
        "schema",
        "description",
        "created_at"
      ],
      "type": "object"
    }
  },
  "required": [
    "record"
  ],
  "type": "object"
}

Sortides

  • registre (requerit): Tipus: objecte.

Esquema de sortida

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "record": {
      "additionalProperties": false,
      "properties": {
        "created_at": {
          "oneOf": [
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "unix_millis"
                },
                "value": {
                  "type": "integer"
                }
              },
              "required": [
                "kind",
                "value"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "logical"
                },
                "value": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "kind",
                "value"
              ],
              "type": "object"
            }
          ]
        },
        "description": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "description": "Optional schema description.",
              "type": "string"
            }
          ]
        },
        "namespace_id": {
          "description": "Namespace identifier.",
          "minimum": 1,
          "type": "integer"
        },
        "schema": {
          "description": "JSON Schema payload.",
          "type": [
            "null",
            "boolean",
            "number",
            "string",
            "array",
            "object"
          ]
        },
        "schema_id": {
          "description": "Data shape identifier.",
          "type": "string"
        },
        "signing": {
          "additionalProperties": false,
          "properties": {
            "algorithm": {
              "default": null,
              "oneOf": [
                {
                  "type": "null"
                },
                {
                  "description": "Signature algorithm label.",
                  "type": "string"
                }
              ]
            },
            "key_id": {
              "description": "Signing key identifier.",
              "type": "string"
            },
            "signature": {
              "description": "Schema signature string.",
              "type": "string"
            }
          },
          "required": [
            "key_id",
            "signature"
          ],
          "type": "object"
        },
        "tenant_id": {
          "description": "Tenant identifier.",
          "minimum": 1,
          "type": "integer"
        },
        "version": {
          "description": "Data shape version identifier.",
          "type": "string"
        }
      },
      "required": [
        "tenant_id",
        "namespace_id",
        "schema_id",
        "version",
        "schema",
        "description",
        "created_at"
      ],
      "type": "object"
    }
  },
  "required": [
    "record"
  ],
  "type": "object"
}

Exemples

Registra un esquema de forma de dades.

Input:

{
  "record": {
    "created_at": {
      "kind": "unix_millis",
      "value": 1710000000000
    },
    "description": "Asserted payload schema.",
    "namespace_id": 1,
    "schema": {
      "additionalProperties": false,
      "properties": {
        "deploy_env": {
          "type": "string"
        }
      },
      "required": [
        "deploy_env"
      ],
      "type": "object"
    },
    "schema_id": "asserted_payload",
    "tenant_id": 1,
    "version": "v1"
  }
}

Output:

{
  "record": {
    "created_at": {
      "kind": "unix_millis",
      "value": 1710000000000
    },
    "description": "Asserted payload schema.",
    "namespace_id": 1,
    "schema": {
      "additionalProperties": false,
      "properties": {
        "deploy_env": {
          "type": "string"
        }
      },
      "required": [
        "deploy_env"
      ],
      "type": "object"
    },
    "schema_id": "asserted_payload",
    "tenant_id": 1,
    "version": "v1"
  }
}