{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/twmarketdata-com/json-schema/twmarketdata-com-dataset-response-envelope-schema.json",
  "title": "DatasetResponseEnvelope",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/twmarketdata-com-openapi.json#/components/schemas/DatasetResponseEnvelope",
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "meta": {
      "$ref": "#/$defs/DatasetMeta"
    },
    "pagination": {
      "$ref": "#/$defs/PaginationMeta"
    },
    "data_gaps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DataGap"
      }
    }
  },
  "$defs": {
    "DataGap": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "error"
          ]
        },
        "scope": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        },
        "observed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "additionalProperties": true
    },
    "DatasetMeta": {
      "type": "object",
      "properties": {
        "dataset": {
          "type": [
            "string",
            "null"
          ]
        },
        "request_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "generated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "ticker": {
          "type": [
            "string",
            "null"
          ]
        },
        "market": {
          "type": [
            "string",
            "null"
          ]
        },
        "date_from": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "date_to": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "source_policy": {
          "type": [
            "string",
            "null"
          ]
        },
        "freshness": {
          "type": [
            "string",
            "null"
          ]
        },
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "unit_semantics": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": true
    },
    "PaginationMeta": {
      "type": "object",
      "properties": {
        "limit": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "maximum": 1000
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "has_more": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "additionalProperties": true
    }
  }
}