So, I did eventually figure out what was causing t...
# talk-kratos
c
So, I did eventually figure out what was causing the indefinite response, it being me setting bcrypt cost to 24 for some ungodly reason. Another question though, I'm now getting
Copy code
{
  "error": {
    "code": 400,
    "status": "Bad Request",
    "reason": "I[#] S[#/required] missing properties: \"email\"",
    "message": "The request was malformed or contained invalid parameters"
  }
}
But my thing very obviously contains
email
?
Copy code
{
  "credentials": {
    "password": {
      "config": {
        "password": "password123"
      }
    }
  },
  "schema_id": "student",
  "traits": {
    "email": "<mailto:[email protected]|[email protected]>",
    "name": {
      "first": "John",
      "last": "Smith"
    }
  },
  "verifiable_addresses": [
    {
      "status": "verified",
      "value": "<mailto:[email protected]|[email protected]>",
      "verified": true,
      "via": "email"
    }
  ]
}
Here's the schema, for added effect
Copy code
{
  "$schema": "<http://json-schema.org/draft-07/schema#>",
  "$id": "<https://nukohon.jessnuko.bid/student.schema.json>",
  "title": "Student v1",
  "type": "object",
  "properties": {
    "traits": {
      "type": "object",
      "properties": {
        "name": {
          "type": "object",
          "properties": {
            "first": {
              "type": "string"
            },
            "last": {
              "type": "string"
            }
          }
        },
        "email": {
          "type": "string",
          "format": "email",
          "title": "E-Mail",
          "<http://ory.sh/kratos|ory.sh/kratos>": {
            "credentials": {
              "password": {
                "identifier": true
              }
            },
            "recovery": {
              "via": "email"
            },
            "verification": {
              "via": "email"
            }
          }
        }
      }
    }
  },
  "required": [
    "email"
  ],
  "additionalProperties": false
}
b
I think the key needs to be
traits.email
(the actual string
"traits.email"
).
b
I have the
required
nested inside
traits
, not root
properties
directly and it works well
Copy code
{
  ...
  "properties": {
    "traits": {
      "type": "object",
      "properties": {
         ...
      },
      "required": ["email", "name"],
      "additionalProperties": false
    }
  }
}
c
The required being in the wrong place was the issue. Thanks for that!