{
  "$schema": "http://json-schema.org/draft-04/schema",
  "id": "field-definition.json",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 50,
      "pattern": "^[0-9a-zA-ZñÑ]+$"
    },
    "predefined": {
      "type": "boolean"
    },
    "private": {
      "type": "boolean"
    },
    "readonly": {
      "type": "boolean"
    },
    "type": {
      "type": "string",
      "enum": [
        "boolean",
        "number",
        "string",
        "date",
        "email",
        "gender",
        "country"
      ]
    },
    "sampleValue": {
      "type": "string",
      "maxLength": 50
    },
    "_links": {
      "$ref": "link-collection.json"
    }
  },
  "required": [ "name", "private", "readonly", "type" ]
}
