Hi there got an issue with CreateIdentityAsync in ...
# ory-network
g
Hi there got an issue with CreateIdentityAsync in ASPNET
{"error":{"code":500,"status":"Internal Server Error","request":"691a8edf-9869-9ec0-a6bc-5e1f4faf112b","reason":"Unable to parse validate JSON object against JSON schema.","message":"An internal server error occurred, please contact the system administrator"}}
Copy code
var traits = new Dictionary<string, object> { 
    ["email"] = sourceData.Email ?? "",
    ["name"] = new Dictionary<string, string> {
        ["first"] = firstName,
        ["last"] = lastName
    }
};

var createIdentity = new ClientCreateIdentityBody(
                schemaId: "<https://schemas.ory.sh/presets/kratos/identity.email.schema.json>",  // Required parameter
                traits: traits        // Required parameter
            );
{
"$id": "<https://schemas.ory.sh/presets/kratos/identity.email.schema.json>",
"$schema": "<http://json-schema.org/draft-07/schema#>",
xxx
}
And one example of a user created normally
Copy code
{
  "email": "julien+moreau-antoine@oxygen-solutions.ai",
  "name": {
    "first": "Antoine",
    "last": "Moreau"
  }
}
Where Am I wrong ?
s
the schema id parameter should be the id as in your config, not necessarily the id key in the schema
g
I'm not sure to understand the diff
Ok got it
SchemaID
in my interface
s
yes exactly
g
works this way indeed
thanks
s
I admit it's not easy to get in the console, but it's easy using the Ory CLI: https://www.ory.sh/docs/cli/ory-get-identity-config
np