{
    "jsonSchema": {
        "title": "Add key",
        "description": "Upload or generate an SSH keypair",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "required": true
          },
          "action": {
              "type": "string",
              "enum": [
                  "upload",
                  "generate"
              ],
              "omit": true
          }
        },
        "allOf": [
            {
              "if": {
                "properties": {
                  "action": {
                    "const": "upload"
                  }
                }
              },
              "then": {
                "properties": {
                  "private": {
                    "title": "Private key",
                    "type": "string",
                    "required": true
                  }
                }
              }
            }
          ]
      },
      "uiSchema": {
          "private": {
              "ui:widget": "textarea",
              "ui:upload": true,
              "ui:placeholder": "Paste your private key material",
              "ui:options": {
                "style": "font-family:monospace; font-size: 10px; width: 420px; min-height:200px; max-height:400px;"
            }

          },
          "action": {
              "ui:widget": "radio"
          }
      },
      "formData": {
          "action": "upload"
      }
}