-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Describe the bug
An error occurred while a model which is inherited by another model has a "tag" type mapping e.g.
{
"name": "Product",
"fields": [
...
{
"name": "keywords",
"type": "Text",
"many": true
}
]
}
where Product.keywords is a collection of strings and Vehicle model inherits Product without overriding keywords attribute
{
"name": "Vehicle",
"inherits": "Product"
"fields": [
...
]
}
DataModel.inferMapping() throws an exception of an undefined attribute. Overriding an attribute is an optional action and should be used here without throwing error.
Workaround
Override attribute but also define associationAdapter e.g.
{
"name": "Product",
"fields": [
...
{
"name": "keywords",
"type": "Text",
"many": true,
"mapping": {
"associationAdapter": "ProductKeywords",
}
}
]
}
and
{
"name": "Vehicle",
"fields": [
...
{
"name": "keywords",
"type": "Text",
"many": true,
"mapping": {
"associationAdapter": "ProductKeywords",
}
}
]
}
Metadata
Metadata
Assignees
Labels
No labels