SHAR Production
← Все контракты

JSON Schema 2020-12

Окно прав

Территория и ограниченные даты начала/окончания.

Схема

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sharprod.com/schemas/rights-window.schema.json",
  "title": "SHAR Production Rights Window Contract",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "asset_id": {
      "type": "string"
    },
    "territory": {
      "type": "string",
      "pattern": "^(?:[A-Z]{2}|WORLD)$"
    },
    "starts_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "ends_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    }
  },
  "required": [
    "asset_id",
    "territory",
    "starts_at",
    "ends_at"
  ]
}

Проверенный пример

{
  "input": {
    "asset_id": "asset-synthetic-01",
    "territory": "WORLD",
    "starts_at": "2026-09-06",
    "ends_at": "2027-09-06"
  },
  "result": {
    "valid": true,
    "errors": []
  }
}

Отклонённый пример

{
  "input": {
    "asset_id": "asset-synthetic-01",
    "territory": "world"
  },
  "result": {
    "valid": false,
    "errors": [
      {
        "instancePath": "",
        "schemaPath": "#/required",
        "keyword": "required",
        "params": {
          "missingProperty": "starts_at"
        },
        "message": "must have required property 'starts_at'"
      }
    ]
  }
}

SHAR Production · sharprod.com