{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/proxymail-qa/json-schema/proxymail-qa-signup-form-spec-schema.json",
  "title": "SignupFormSpec",
  "description": "The form. Only name and screens are required.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/proxymail-qa-openapi.json#/components/schemas/SignupFormSpec",
  "type": "object",
  "required": [
    "name",
    "screens"
  ],
  "properties": {
    "version": {
      "type": "integer",
      "enum": [
        1
      ]
    },
    "name": {
      "type": "string",
      "maxLength": 80,
      "description": "What the form is called, such as Main sign-up."
    },
    "site": {
      "type": "string",
      "maxLength": 300,
      "description": "The site it's on, as the project lists it, such as https://staging.example.com/*. Leave out to match on every site."
    },
    "language": {
      "type": "string",
      "description": "The form's language, for its default labels: en (the default), de, fr, es, it, pt, nl, zh or ja."
    },
    "country": {
      "type": "string",
      "description": "A two-letter country code for the fields that depend on one (IDs, VAT numbers, phones, addresses)."
    },
    "screens": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "description": "The screens in order, up to 10, with up to 60 fields in all.",
      "items": {
        "type": "object",
        "required": [
          "fields"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 80,
            "description": "The screen's heading."
          },
          "path": {
            "type": "string",
            "description": "The page's path, such as /signup."
          },
          "screen_id": {
            "type": "string",
            "format": "uuid",
            "description": "A sign-up screen the project keeps, from list_sites."
          },
          "fields": {
            "type": "array",
            "minItems": 1,
            "maxItems": 30,
            "description": "The fields in order. Each section once in the form.",
            "items": {
              "type": "object",
              "required": [
                "section"
              ],
              "properties": {
                "section": {
                  "type": "string",
                  "description": "A section id from list_form_sections, such as email, password or business.team_size; or custom, with custom_field, for a question one of the project’s own custom fields answers."
                },
                "custom_field": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Section custom only: the custom field that fills it, by its id from list_custom_fields. It keeps deciding the value; the form puts the field in its code, tests and preview. Give the field the test id or label that custom field looks for."
                },
                "required": {
                  "type": "boolean",
                  "description": "Defaults to true."
                },
                "label": {
                  "type": "string",
                  "maxLength": 80,
                  "description": "The field's label; defaults to the section's label in the form's language. Needed for section custom."
                },
                "testid": {
                  "type": "string",
                  "maxLength": 100,
                  "description": "Its data-testid; defaults to signup- and the section id with dashes, such as signup-business-team-size, or for section custom signup- and the label, such as signup-team-size."
                },
                "options": {
                  "type": "object",
                  "description": "Only what the section takes.",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "text",
                        "select",
                        "checkbox"
                      ],
                      "description": "Section custom only: a text box, a drop-down (with choices) or a tick box. Defaults to select with choices, else text."
                    },
                    "country": {
                      "type": "string",
                      "description": "A two-letter country code, for a country-dependent section."
                    },
                    "min_length": {
                      "type": "integer",
                      "description": "Password only."
                    },
                    "max_length": {
                      "type": "integer",
                      "description": "Password only."
                    },
                    "classes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "lower",
                          "upper",
                          "digit",
                          "symbol"
                        ]
                      },
                      "description": "Password only: the kinds of character it must have."
                    },
                    "min_age": {
                      "type": "integer",
                      "description": "Date of birth only: the youngest age the form accepts."
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The options of a drop-down or radio group (gender, language, how someone heard, role, team size, or a section custom drop-down)."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}