[API] [Product] Add path to default serialization

This commit is contained in:
Łukasz 2017-04-11 12:53:45 +02:00
parent bbae298a97
commit 8915e056d1
6 changed files with 28 additions and 17 deletions

View file

@ -14,7 +14,7 @@ Sylius\Component\Core\Model\Image:
path:
expose: true
type: string
groups: [Detailed]
groups: [Default, Detailed]
owner:
expose: true
groups: [Detailed]

View file

@ -1,16 +1,3 @@
Sylius\Component\Core\Model\ProductImage:
exclusion_policy: ALL
xml_root_name: product-image
properties:
id:
expose: true
type: integer
xml_attribute: true
groups: [Default, Detailed]
type:
expose: true
type: string
groups: [Default, Detailed]
owner:
expose: true
groups: [Detailed]

View file

@ -23,6 +23,7 @@ Sylius\Component\Core\Model\Product:
fallbackLocale: 'en_US'
currentLocale: 'en_US'
code: 'MUG_SW'
images: ["@product_thumbnail"]
translations:
- "@productTranslation1"
- "@productTranslation2"
@ -42,3 +43,8 @@ Sylius\Component\Core\Model\Product:
slug: 'mug-breaking-bad'
name: 'Breaking bad mug'
description: <paragraph(2)>
Sylius\Component\Core\Model\ProductImage:
product_thumbnail:
type: "thumbnail"
path: "/uo/product.jpg"

View file

@ -51,7 +51,13 @@
"code": "MUG_SW",
"options": [],
"averageRating": 0,
"images": [],
"images": [
{
"id": @integer@,
"type": "thumbnail",
"path": "\/uo\/product.jpg"
}
],
"_links": {
"self": {
"href": "\/api\/v1\/products\/MUG_SW"

View file

@ -25,7 +25,13 @@
"channels": [],
"reviews": [],
"averageRating": 0,
"images": [],
"images": [
{
"id": @integer@,
"type": "thumbnail",
"path": "\/uo\/product.jpg"
}
],
"_links": {
"self": {
"href": "\/api\/v1\/products\/MUG_SW"

View file

@ -51,7 +51,13 @@
"code": "MUG_SW",
"options": [],
"averageRating": 0,
"images": [],
"images": [
{
"id": @integer@,
"type": "thumbnail",
"path": "\/uo\/product.jpg"
}
],
"_links": {
"self": {
"href": "\/api\/v1\/products\/MUG_SW"