Hey, I’m having issues with adding a new property ...
# ory-network
v
Hey, I’m having issues with adding a new property to user identity schema. When trying to register a user with the following schema :
Copy code
{
  "$id": "https://schemas.ory.sh/presets/kratos/identity.email.schema.json",
  "title": "Person",
  "type": "object",
  "properties": {
    "traits": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "title": "E-Mail",
          "ory.sh/kratos": {
            "credentials": {
              "password": {
                "identifier": true
              },
              "webauthn": {
                "identifier": true
              },
              "totp": {
                "account_name": true
              }
            },
            "recovery": {
              "via": "email"
            },
            "verification": {
              "via": "email"
            }
          },
          "maxLength": 320
        },
        "firstName": {
          "type": "string",
          "title": "Firstname",
          "maxLength": 200
        },
        "lastName": {
          "type": "string",
          "title": "Lastname",
          "maxLength": 200
        },
        "phone_number": {
          "type": "string",
          "title": "Phone number 1"
        },
        "company": {
          "type": "string",
          "title": "Company",
          "maxLength": 200
        },
        "marketing": {
          "type": "boolean",
          "title": "Allow marketing",
          "description": "I allow marketing for this email"
        },
        "accept_tos": {
          "type": "boolean",
          "title": "I accept terms of service"
        }
      },
      "required": [
        "email",
        "firstName",
        "lastName",
        "accept_tos",
        "phone_number"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
I get the error:
Copy code
I[#/traits] S[#/properties/traits/required] missing properties: "phone_number"