Exception - "The schema must include an 'allOf' attribute..." when creating a schema
arkster opened this issue · comments
Hi, I'm trying to create a schema using aepp and am getting the following exception.
` 474 raise TypeError("Expecting a dictionary")
475 if "allOf" not in schema.keys():
--> 476 raise Exception(
477 "The schema must include an ‘allOf’ attribute (a list) referencing the $id of the base class the schema will implement."
478 )
Exception: The schema must include an ‘allOf’ attribute (a list) referencing the $id of the base class the schema will implement.`
I am creating the schema by running getSchema in a different sandbox and then importing it into another one by using createSchema. I made sure the field groups and other dependencies pre-exist in the new sandbox.
Any ideas on how I can get the allOf attribute that is needed to create the schema?
Hi @arkster you need to reference the field Groups (Mixins) and classes from the new environment in that key.
https://experienceleague.adobe.com/docs/experience-platform/xdm/api/schemas.html?lang=en#create
"allOf": [
{
"$ref": "https://ns.adobe.com/xdm/context/experienceevent",
"meta:xdmType": "object",
"type": "object"
},
{
"$ref": "https://ns.adobe.com/_mytenant/mixins/5924ad9758d080a4c5e7d4493c0356646a38f828d000c98b",
"meta:xdmType": "object",
"type": "object"
},
{
"$ref": "https://ns.adobe.com/_mytenant/mixins/27c9589e21afa8a84d2b2aff9e7e4dddf566e209d8158fe2",
"meta:refProperty": [
"/_mytenant/userID"
],
"meta:xdmType": "object",
"type": "object"
}
],
I think it might be also helpful to post the code you are executing.
Hello @arkster
For some reason I am discovering the issue and @benedikt-buchert actually answered it perfectly.
The allOf is a default parameter that contains the reference to the fieldgroups you want to use in the schema creation.
While this issue is dated, I am closing it.
Feel free to re-open it with additional information.