{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Arc Feature with geometry by reference",
  "allOf": [
    {
      "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/features/topo-feature/schema.json"
    },
    {
      "properties": {
        "topology": {
          "allOf": [
            {
              "$ref": "https://ogcincubator.github.io/topo-feature/build/annotated/geo/topo/datatypes/topology/schema.json"
            },
            {
              "oneOf": [
                {
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "Arc"
                    },
                    "references": {
                      "minItems": 3,
                      "maxItems": 3
                    }
                  }
                },
                {
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "ArcWithCenter"
                    },
                    "references": {
                      "minItems": 3,
                      "maxItems": 3
                    },
                    "orientation": {
                      "type": "string",
                      "enum": [
                        "cw",
                        "ccw"
                      ]
                    }
                  },
                  "required": [
                    "orientation"
                  ]
                },
                {
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "ArcByChord"
                    },
                    "references": {
                      "minItems": 2,
                      "maxItems": 2
                    },
                    "radius": {
                      "type": "number"
                    },
                    "orientation": {
                      "type": "string",
                      "enum": [
                        "cw",
                        "ccw"
                      ]
                    }
                  },
                  "required": [
                    "radius",
                    "orientation"
                  ]
                },
                {
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "CircleByCenter"
                    },
                    "references": {
                      "minItems": 1,
                      "maxItems": 1
                    },
                    "radius": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "radius"
                  ]
                },
                {
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "CubicSpline"
                    },
                    "references": {
                      "minItems": 3
                    }
                  },
                  "not": {
                    "required": [
                      "startTangentVector",
                      "endTangentVector"
                    ]
                  }
                },
                {
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "CubicSpline"
                    },
                    "references": {
                      "minItems": 2
                    },
                    "startTangentVector": {
                      "properties": {
                        "references": {
                          "minItems": 2
                        }
                      }
                    },
                    "endTangentVector": {
                      "properties": {
                        "references": {
                          "minItems": 2
                        }
                      }
                    }
                  },
                  "required": [
                    "startTangentVector",
                    "endTangentVector"
                  ]
                }
              ]
            }
          ]
        },
        "radius": {
          "type": "number",
          "description": "optional property of the feature defining radius according to coordinate reference system of the referenced geometry. Note where necessary to define geometry this is a mandatory sub-property of the topology property."
        },
        "arcLength": {
          "type": "number",
          "description": "optional property of the feature defining arcLength according to coordinate reference system of the referenced geometry."
        }
      },
      "required": [
        "topology"
      ]
    }
  ]
}