{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://schemas.opengis.net/json-fg/time.json",
    "title": "the value of the 'time' member",
    "description": "This JSON Schema is part of JSON-FG version 1.0.0.",
    "oneOf": [
        {"type": "null"},
        {
            "type": "object",
            "minProperties": 1,
            "properties": {
                "date": {"$ref": "#/$defs/date"     },
                "timestamp": {"$ref": "#/$defs/timestamp"},
                "interval": {"$ref": "#/$defs/interval" }
            }
        }
    ],
    "$defs": {
        "date": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$"},
        "timestamp": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z$"},
        "interval": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
                "anyOf": [
                    {
                        "oneOf": [ {"$ref": "#/$defs/date"}, {"type": "string", "const": ".."} ]
                    },
                    {
                        "oneOf": [ {"$ref": "#/$defs/timestamp"}, {"type": "string", "const": ".."} ]
                    }
                ]
            }
        }
    }
}
