strapi-yml-generator
Version:
Script for generation YML/XML feed for the Strapi
70 lines (69 loc) • 3.2 kB
JSON
{
"fields": null,
"populate": [
"picture",
"gallery",
"technical.brand",
"technical.brandChassis",
"technical.brandInstallation",
"categories"
],
"feed": "special-equipment",
"mapping": {
"id": "id",
"available": "${attributes.active}",
"url": "/catalog/${attributes.technical.brand.data.attributes.slug}/${attributes.technical.model.toLowerCase()}/${attributes.slug}",
"price": "${attributes.price}",
"categoryId": "${attributes.categories.data.find(c => c.attributes.isCarType)?.id}",
"categoryName": "${attributes.categories.data.find(c => c.attributes.isCarType)?.attributes?.name}",
"name": "${attributes.name}",
"description": "${attributes.announcement}",
"manufacturerWarranty": "true",
"countryOfOrigin": "${attributes.technical?.brand?.data?.attributes?.country}",
"picture": "${attributes.picture?.data?.attributes?.url}",
"gallery": "gallery",
"type": "${attributes.technical?.type}",
"vendor": "${attributes.technical?.brandChassis?.data?.attributes?.name || data?.attributes.technical?.brand?.data?.attributes?.name}",
"mark": "${attributes.technical?.brandChassis?.data?.attributes?.name || data?.attributes.technical?.brand?.data?.attributes?.name}",
"model": "${attributes.technical?.modelChassis ?? data.attributes.technical?.model}",
"weight": "${attributes.technical?.weight}",
"length": "${attributes.technical?.length}",
"width": "${attributes.technical?.width}",
"height": "${attributes.technical?.height}",
"year": "${attributes.technical?.year}",
"bodyType": "${attributes.technical?.body}",
"color": "${attributes.technical?.color}",
"engineType": "${attributes.technical?.engineType}",
"transmission": "${attributes.technical?.transmission}",
"drive": "${attributes.technical?.drive}",
"horsePowers": "${attributes.technical?.horsePowers}",
"engineCapacity": "${attributes.technical?.engineCapacity}",
"mileage": "${attributes.technical?.mileage}",
"numberOfDoors": "${attributes.technical?.doors}",
"numberOfSeats": "${attributes.technical?.seats}",
"fuelType": "${attributes.technical?.fuelType}",
"fuelConsumption": "${attributes.technical?.fuelConsumption}",
"condition": "${attributes.technical?.condition}",
"ownerCount": "${attributes.technical?.owners}",
"customsCleared": "${attributes.technical?.customsCleared}",
"vin": "${attributes.technical?.vin}",
"dealer": "${attributes.technical?.dealer}",
"equipmentType": "${attributes.technical?.equipmentType}",
"maxLoadCapacity": "${attributes.technical?.maxLoadCapacity}",
"enginePower": "${attributes.technical?.enginePower}",
"engineModel": "${attributes.technical?.engineModel}",
"fuelTankCapacity": "${attributes.technical?.fuelTankCapacity}",
"operatingHours": "${attributes.technical?.operatingHours}"
},
"units": {
"mileage": "км",
"dimensions": "см",
"weight": "кг",
"maxLoadCapacity": "кг",
"enginePower": "кВт",
"fuelTankCapacity": "литров",
"horsePower": "л.с.",
"engineCapacity": "литров",
"fuelConsumption": "л./100км"
}
}