{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"$version": "2.3",
	"definitions": {
		"DataSeries": {
			"properties": {
				"key": {
					"description": "Unique id for data series.",
					"type": "string"
				},
				"measurement": {
					"description": "Measurement type.",
					"type": "string"
				},
				"name": {
					"description": "Name of data series to be displayed in a legend.",
					"type": "string"
				},
				"parameters": {
					"description": "Values which defines the context of the results (Sensitivity values).\n\nFor example, FlowRate = X would indicate that this series was calculated with the FlowRate = X.\nThere might be other DataSeries returned with other FlowRate value.\nSuch series should have the same series_group defined.",
					"items": {
						"anyOf": [
							{
								"$ref": "#/definitions/SingleValue"
							},
							{
								"$ref": "#/definitions/RangeValue"
							},
							{
								"$ref": "#/definitions/ParametrizedStringValue"
							}
						]
					},
					"type": "array"
				},
				"series_group": {
					"description": "The same SeriesGroup should be set for data series of the same representation (e.g., sensitivity series of the same channel).\n\nIf it is omitted, its _key_ value will be used.",
					"type": "string"
				},
				"unit": {
					"description": "Unit type of the data series.",
					"type": "string"
				},
				"values": {
					"description": "Array of numeric values.\n\nLength of this array must be equal to the length of index values array.",
					"items": {
						"type": ["number", "null", "string"]
					},
					"type": "array"
				}
			},
			"required": [
				"measurement",
				"name",
				"values"
			],
			"type": "object"
		},
		"IndexSeries": {
			"description": "Contains data to build an index series of a particular Drillplan Chart.",
			"properties": {
				"measurement": {
					"description": "Measurement type of the axes.",
					"type": "string"
				},
				"name": {
					"description": "Display name of an index axis.",
					"type": "string"
				},
				"unit": {
					"description": "Unit type of the axes.",
					"type": "string"
				},
				"values": {
					"description": "Set of values for index.\n\nEach dataSeries array of values should have the same length as index values are.",
					"items": {
						"type": ["number", "null", "string"]
					},
					"type": "array"
				}
			},
			"type": "object"
		},
		"ParametrizedStringValue": {
			"description": "Defines a ParametrizedString type for a value of a sensitivity parameter.",
			"properties": {
				"$type": {
					"description": "Type of a calculation.",
					"type": "string"
				},
				"key": {
					"description": "A key that defines the relationship of the parameter to the common set of sensitivity parameters.",
					"type": "string"
				},
				"measurement": {
					"description": "Measurement type of a sensitivity parameter.",
					"type": "string"
				},
				"name": {
					"description": "Name of a sensitivity parameter that will be displayed.",
					"type": "string"
				},
				"parameters": {
					"description": "Parameters for interpolation of template field.",
					"items": {
						"$ref": "#/definitions/SingleValue"
					},
					"type": "array"
				},
				"result_type": {
					"$ref": "#/definitions/ResultType",
					"description": "Type of Sensitivity Parameter."
				},
				"template": {
					"description": "Template string for interpolation with values from parameters field.",
					"type": "string"
				},
				"unit": {
					"description": "Unit type of the sensitivity parameter.",
					"type": "string"
				}
			},
			"type": "object"
		},
		"RangeValue": {
			"description": "Defines a Range type for a value of a sensitivity parameter.",
			"properties": {
				"$type": {
					"description": "Type of a calculation.",
					"type": "string"
				},
				"key": {
					"description": "A key that defines the relationship of the parameter to the common set of sensitivity parameters.",
					"type": "string"
				},
				"max_value": {
					"description": "Maximum value of a sensitivity parameter.",
					"type": "number"
				},
				"measurement": {
					"description": "Measurement type of a sensitivity parameter.",
					"type": "string"
				},
				"min_value": {
					"description": "Minimum value of a sensitivity parameter.",
					"type": "number"
				},
				"name": {
					"description": "Name of a sensitivity parameter that will be displayed.",
					"type": "string"
				},
				"result_type": {
					"$ref": "#/definitions/ResultType",
					"description": "Type of Sensitivity Parameter."
				},
				"unit": {
					"description": "Unit type of the sensitivity parameter.",
					"type": "string"
				}
			},
			"type": "object"
		},
		"ResultType": {
			"enum": [
				"DataSeries",
				"ParameterizedString",
				"Range",
				"Single"
			],
			"type": "string"
		},
		"SingleValue": {
			"description": "Defines a Single type for a value of a sensitivity parameter.",
			"properties": {
				"$type": {
					"description": "Type of a calculation.",
					"type": "string"
				},
				"key": {
					"description": "A key that defines the relationship of the parameter to the common set of sensitivity parameters.",
					"type": "string"
				},
				"measurement": {
					"description": "Measurement type of a sensitivity parameter.",
					"type": "string"
				},
				"name": {
					"description": "Name of a sensitivity parameter that will be displayed.",
					"type": "string"
				},
				"result_type": {
					"$ref": "#/definitions/ResultType",
					"description": "Type of Sensitivity Parameter."
				},
				"unit": {
					"description": "Unit type of the sensitivity parameter.",
					"type": "string"
				},
				"value": {
					"description": "Value of a sensitivity parameter.",
					"type": [
						"string",
						"number"
					]
				}
			},
			"type": "object"
		}
	},
	"description": "Defines a data model to be consumed by the Drillplan Chart component.\n\nIt mostly reflects the data model from CalcServer DataSeriesResult.",
	"properties": {
		"$type": {
			"description": "Type of a calculation.",
			"type": "string"
		},
		"index": {
			"$ref": "#/definitions/IndexSeries",
			"description": "Defines data that is used to build index axes."
		},
		"key": {
			"description": "A dataset key to link it with provided metadata.",
			"type": "string"
		},
		"name": {
			"description": "Name of a dataset.\n\nIt could be used as a title for a Drillplan Chart.",
			"type": "string"
		},
		"result_type": {
			"description": "Type of result.",
			"enum": [
				"DataSeries"
			],
			"type": "string"
		},
		"series": {
			"description": "A set of data series definitions to use as data for Drillplan Chart graphics.",
			"items": {
				"$ref": "#/definitions/DataSeries"
			},
			"type": "array"
		}
	},
	"required": [
		"index",
		"key",
		"name",
		"series"
	],
	"type": "object"
}

