{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "drillplan://aea/section/1.0.0",
  "title": "Section (section-v1)",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": [
        "null",
        "string"
      ],
      "description": ""
    },
    "name": {
      "type": [
        "null",
        "string"
      ],
      "description": ""
    },
    "display_name": {
      "type": [
        "null",
        "string"
      ],
      "description": ""
    },
    "od": {
      "type": "number",
      "description": "hole size (CylinderDiameter,meter,m).",
      "format": "double"
    },
    "components": {
      "type": [
        "array",
        "null"
      ],
      "description": "",
      "items": {
        "$ref": "#/definitions/SectionComponent"
      }
    },
    "lock_to_trajectory": {
      "type": "boolean",
      "description": ""
    },
    "comments": {
      "type": [
        "null",
        "string"
      ],
      "description": ""
    },
    "anchor_formation_top": {
      "type": [
        "null",
        "string"
      ],
      "description": ""
    },
    "offset_from_formation_top": {
      "type": [
        "null",
        "number"
      ],
      "description": "offset from formation top (StandardDepthIndex,meter,m).",
      "format": "double"
    },
    "reference_elevation": {
      "type": [
        "null",
        "number"
      ],
      "description": "reference elevation (StandardDepthIndex,meter,m).",
      "format": "double"
    },
    "__relation__": {
      "description": "",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/ContractRelation"
        }
      ]
    },
    "start_md": {
      "type": [
        "null",
        "number"
      ],
      "description": "start md (StandardDepthIndex,meter,m).",
      "format": "double"
    },
    "start_Tvd": {
      "type": [
        "null",
        "number"
      ],
      "description": "start tvd (StandardDepthIndex,meter,m).",
      "format": "double"
    },
    "start_depth_lock_type": {
      "description": "",
      "$ref": "#/definitions/DepthLockType"
    },
    "end_md": {
      "type": [
        "null",
        "number"
      ],
      "description": "end md (StandardDepthIndex,meter,m).",
      "format": "double"
    },
    "end_Tvd": {
      "type": [
        "null",
        "number"
      ],
      "description": "end tvd (StandardDepthIndex,meter,m).",
      "format": "double"
    },
    "end_depth_lock_type": {
      "description": "",
      "$ref": "#/definitions/DepthLockType"
    },
    "max_hole_size": {
      "type": "number",
      "description": "max hole size (CylinderDiameter,meter,m).",
      "format": "double"
    },
    "hole_segments": {
      "type": [
        "array",
        "null"
      ],
      "description": "",
      "items": {
        "$ref": "#/definitions/HoleSegment"
      }
    },
    "effective_kop": {
      "type": [
        "null",
        "number"
      ],
      "description": "effective kop (StandardDepthIndex,meter,m).",
      "format": "double"
    },
    "is_inherited": {
      "type": "boolean",
      "description": ""
    },
    "with_riser": {
      "type": [
        "boolean",
        "null"
      ],
      "description": ""
    }
  },
  "definitions": {
    "SectionComponent": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "component_type": {
          "$ref": "#/definitions/SectionComponentType"
        },
        "conductor_type": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/definitions/ConductorType"
            }
          ]
        },
        "reference_catalog_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "start_depth_lock_type": {
          "$ref": "#/definitions/DepthLockType"
        },
        "start_md": {
          "type": [
            "null",
            "number"
          ],
		  "description": "start md (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "start_tvd": {
          "type": [
            "null",
            "number"
          ],
		  "description": "start tvd (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "end_depth_lock_type": {
          "$ref": "#/definitions/DepthLockType"
        },
        "end_md": {
          "type": [
            "null",
            "number"
          ],
		  "description": "end md (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "end_tvd": {
          "type": [
            "null",
            "number"
          ],
		  "description": "end tvd (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "top_of_cement": {
          "type": [
            "null",
            "number"
          ],
		  "description": "top of cement (StandardDepthIndex,meter,m).",
          "format": "double"
        }
      }
    },
    "SectionComponentType": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Casing",
        "Conductor",
        "Liner",
        "OpenHole",
        "Riser",
        "ProductionCasing",
        "ProductionLiner",
        "TieBack",
        "ProductionTieBack",
        "SurfaceCasing"
      ],
      "enum": [
        "Casing",
        "Conductor",
        "Liner",
        "OpenHole",
        "Riser",
        "ProductionCasing",
        "ProductionLiner",
        "TieBack",
        "ProductionTieBack",
        "SurfaceCasing"
      ]
    },
    "ConductorType": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Drilled",
        "Driven",
        "Jetted",
        "PreInstalled"
      ],
      "enum": [
        "Drilled",
        "Driven",
        "Jetted",
        "PreInstalled"
      ]
    },
    "DepthLockType": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "MD",
        "TVD",
        "FormationTop"
      ],
      "enum": [
        "MD",
        "TVD",
        "FormationTop"
      ]
    },
    "ContractRelation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "null",
            "string"
          ]
        },
        "parent_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "run_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "section_id": {
          "type": [
            "null",
            "string"
          ]
        },
        "wellbore_id": {
          "type": [
            "null",
            "string"
          ]
        },
		"well_id": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "HoleSegment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "end_md": {
          "type": [
            "null",
            "number"
          ],
		  "description": "end md (StandardDepthIndex,meter,m).",
          "format": "double"
        },
        "hole_size": {
          "type": "number",
		  "description": "hole size (CylinderDiameter,meter,m).",
          "format": "double"
        },
        "is_inherited": {
          "type": "boolean"
        }
      }
    }
  }
}