<@U04UQ68083H> In the identity JSON schema, is it ...
# ory-copilot
b
@chilly-king-10285 In the identity JSON schema, is it possible to have a trait with a list of enumerated values (enum)? Only the enum values are allowed to be used in the trait value.
c
A message from kapa.ai
Yes, it is possible to have a trait with a list of enumerated values in the identity JSON schema. The JSON Schema specification, which Ory uses for validating identity traits, supports the "enum" keyword. This keyword is used to define a list of specific valid values for a field. However, the specific implementation would depend on your use case and the structure of your identity schema. Here is a general example of how you might define an enumerated trait in a JSON schema:
Copy code
json {   "properties": {     "traits": {       "type": "object",       "properties": {         "myTrait": {           "type": "string",           "enum": ["Value1", "Value2", "Value3"]         }       }     }   } }
In this example, "myTrait" can only have the values "Value1", "Value2", or "Value3". Any other value would not pass validation. Please note that this is a general JSON Schema example and you would need to adapt it to fit the specific structure and requirements of your Ory identity schema. For more information on how to customize identity schemas in Ory, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#multiple-identifiers).