{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "http://www.52north.org/schema/json/swe/Field#",
    "type": "object",
    "required": [
        "name",
        "type",
        "definition"
    ],
    "properties": {
        "name": {
            "type": "string"
        },
        "definition": {
            "type": "string"
        },
        "description": {
            "type": "string"
        },
        "type": {
            "type": "string"
        },
        "identifier": {
            "type": "string"
        },
        "label": {
            "type": "string"
        }
    },
    "oneOf": [
        {
            "properties": {
                "type": {
                    "enum": [
                        "count",
                        "boolean",
                        "countRange",
                        "observableProperty",
                        "quality",
                        "text"
                    ]
                }
            }
        },
        {
            "required": [
                "uom"
            ],
            "properties": {
                "type": {
                    "enum": [
                        "quantity",
                        "quantityRange",
                        "time",
                        "timeRange"
                    ]
                },
                "uom": {
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "codespace"
            ],
            "properties": {
                "type": {
                    "enum": [
                        "category"
                    ]
                },
                "codespace": {
                    "type": "string"
                }
            }
        }
    ]
}