Open yarkovaleksei opened 10 months ago
I cannot reproduce this issue on the latest strapi version with the provided information. The data is transformed correctly with the data and attributes keys removed.
Can you provide the full schema files for all related content types/components? This should make it easier to reproduce.
// src/api/memorial/content-types/memorial/schema.json
{
"kind": "collectionType",
"collectionName": "memorials",
"info": {
"singularName": "memorial",
"pluralName": "memorials",
"displayName": "Memorials",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string",
"required": true
},
"size": {
"type": "component",
"repeatable": true,
"component": "record.razmer-s-fiksirovannoj-czenoj-3-d", // component with nested component
"required": true
}
}
}
// src/api/additional-product/content-types/additional-product/schema.json
{
"kind": "collectionType",
"collectionName": "additional_products",
"info": {
"singularName": "additional-product",
"pluralName": "additional-products",
"displayName": "Additional products",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string",
"required": true
}
}
}
// src/components/record/razmer-s-fiksirovannoj-czenoj-3-d.json
{
"collectionName": "components_record_razmer_s_fiksirovannoj_czenoj_3_ds",
"info": {
"displayName": "Memorial size",
"description": ""
},
"options": {},
"attributes": {
"length": {
"type": "integer",
"required": true,
"min": 0
},
"width": {
"type": "integer",
"required": true,
"min": 0
},
"height": {
"type": "integer",
"required": true,
"min": 0
},
"price": {
"type": "decimal",
"required": true,
"min": 0
},
"additionalProducts": {
"type": "component",
"repeatable": false,
"component": "memorial.obyazatelnye-dop-tovary", // problem nested component
"required": true
}
}
}
// src/components/memorial/obyazatelnye-dop-tovary.json
{
"collectionName": "components_memorial_obyazatelnye_dop_tovary",
"info": {
"displayName": "Required additional products"
},
"options": {},
"attributes": {
"stand": {
"type": "relation",
"relation": "oneToOne",
"target": "api::additional-product.additional-product" // Objects from this collection not transformed
}
}
}
Thanks for the schema! I was able to reproduce this issue and will look into fixing it.
Relation type "oneToOne".
Response example: