{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.opengis.net/json-fg/coordrefsys.json",
  "title": "the value of the 'coordRefSys' member",
  "description": "This JSON Schema is part of JSON-FG version 1.0.0.",
  "oneOf": [
    {"$ref": "#/$defs/single-refsys"},
    {
      "type": "array",
      "items": {"$ref": "#/$defs/single-refsys"},
      "minItems": 2
    }
  ],
  "$defs": {
    "single-refsys": {
      "oneOf": [
        {"$ref": "#/$defs/refsys-simpleref"},
        {"$ref": "#/$defs/refsys-byref"    },
        {"$ref": "#/$defs/refsys-custom"   }
      ]
    },
    "refsys-simpleref": {"type": "string", "format": "uri-reference"},
    "refsys-byref": {
      "type": "object",
      "required": ["type", "href"],
      "properties": {
        "type" : {"type": "string", "const": "Reference"}     ,
        "href" : {"type": "string", "format": "uri-reference"},
        "epoch": {"type": "number"}
      }
    },
    "refsys-custom": {
      "type": "object",
      "required": ["type"],
      "properties": {
        "type": { "type": "string", "not": {"const": "Reference"} }
      }
    }
  }
}
