Skip to content

Commit 3374875

Browse files
committed
Change record format
1 parent bdafabf commit 3374875

File tree

7 files changed

+114
-130
lines changed

7 files changed

+114
-130
lines changed

content/rest-api/resources.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,12 +1290,21 @@ Below is the JSON standard format representing a reference entity record.
12901290
```json
12911291
{
12921292
"code": "kartell",
1293-
"labels": {
1294-
"en_US": "Kartell",
1295-
"fr_FR": "Kartell"
1296-
},
1297-
"main_image": "0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg",
12981293
"values": {
1294+
"labels": [
1295+
{
1296+
"locale": "en_US",
1297+
"channel": null,
1298+
"data": "Kartell"
1299+
}
1300+
],
1301+
"main_image": [
1302+
{
1303+
"locale": null,
1304+
"channel": null,
1305+
"data": "0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg"
1306+
}
1307+
],
12991308
"description": [
13001309
{
13011310
"locale": "en_US",

content/swagger/definitions.yaml

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -62,57 +62,7 @@ ReferenceEntityAttributeOptionList:
6262
$ref: ./resources/reference_entity_attributes/definitions/reference_entity_attribute_option.yaml
6363

6464
ReferenceEntityRecord:
65-
type: object
66-
allOf:
67-
- $ref: ./resources/reference_entity_records/definitions/reference_entity_record_links.yaml
68-
- $ref: ./resources/reference_entity_records/definitions/reference_entity_record.yaml
69-
example: {
70-
"_links": {
71-
"main_image_download": {
72-
"href": "https://demo.cloud.akeneo.com/api/rest/v1/reference-entity-media-files/0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg"
73-
}
74-
},
75-
"code": "kartell",
76-
"labels": {
77-
"en_US": "Kartell",
78-
"fr_FR": "Kartell"
79-
},
80-
"main_image": "0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg",
81-
"values": {
82-
"description": [
83-
{
84-
"locale": "en_US",
85-
"channel": null,
86-
"data": "Kartell, the Italian furniture company that sells modern and remarkable pieces of furnitures."
87-
},
88-
{
89-
"locale": "fr_FR",
90-
"channel": null,
91-
"data": "Kartell, l'éditeur de meuble italien spécialisé dans la signature de belle pièces au design contemporain."
92-
}
93-
],
94-
"country": [
95-
{
96-
"locale": null,
97-
"channel": null,
98-
"data": "italy"
99-
}
100-
],
101-
"collection_overview":[
102-
{
103-
"locale": null,
104-
"channel": null,
105-
"data": "5/1/d/8/51d81dc778ba1501a8f998f3ab5797569f3b9e25_img.png",
106-
"_links": {
107-
"download": {
108-
"href": "https://demo.cloud.akeneo.com/api/rest/v1/reference-entities-media-files/5/1/d/8/51d81dc778ba1501a8f998f3ab5797569f3b9e25_img.png"
109-
}
110-
}
111-
}
112-
]
113-
}
114-
}
115-
65+
$ref: ./resources/reference_entity_records/definitions/reference_entity_record.yaml
11666
ReferenceEntityRecordList:
11767
type: object
11868
allOf:
@@ -437,9 +387,3 @@ ReferenceEntityRecordItemList:
437387
href:
438388
type: string
439389
description: URI of the resource
440-
main_image_download:
441-
type: object
442-
properties:
443-
href:
444-
type: string
445-
description: URI to download the binaries of the record's main image file

content/swagger/resources/reference_entity_attributes/definitions/reference_entity_attribute.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ properties:
7474
type: string
7575
description: Code of the linked reference entity when the attribute type is `reference_entity_single_link` or `reference_entity_multiple_links`
7676
default : null
77+
x-validation-rules: Required when the attribute type is either `reference_entity_single_link` or `reference_entity_multiple_links`
7778
x-warning: Only for `reference_entity_single_link` and `reference_entity_multiple_links` attribute type
7879
example: {
7980
"code": "description",

content/swagger/resources/reference_entity_records/definitions/reference_entity_record.yaml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@ properties:
55
type: string
66
description: Code of the record
77
x-immutable: true
8-
labels:
9-
type: object
10-
description: Labels for each locale of the record
11-
x-validation-rules: The `localeCode` is the code of an existing and activated locale
12-
default: {}
13-
properties:
14-
localeCode:
15-
type: string
16-
description: Record label for the locale `localeCode`
17-
main_image:
18-
type: string
19-
description: Code of the main image of the record
208
values:
219
type: object
2210
description: "Record attributes values, see <a href='/documentation/resources.html#reference-entity-record-values'>Reference entity record values</a> section for more details"
@@ -38,12 +26,21 @@ properties:
3826
description: Reference entity record value
3927
example: {
4028
"code": "kartell",
41-
"labels": {
42-
"en_US": "Kartell",
43-
"fr_FR": "Kartell"
44-
},
45-
"main_image": "0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg",
4629
"values": {
30+
"label": [
31+
{
32+
"locale": "en_US",
33+
"channel": null,
34+
"data": "Kartell"
35+
}
36+
],
37+
"main_image": [
38+
{
39+
"locale": null,
40+
"channel": null,
41+
"data": "0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg"
42+
}
43+
],
4744
"description": [
4845
{
4946
"locale": "en_US",

content/swagger/resources/reference_entity_records/definitions/reference_entity_record_links.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

content/swagger/resources/reference_entity_records/definitions/reference_entity_records.yaml

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ items:
44
example: [
55
{
66
"code": "kartell",
7-
"labels": {
8-
"en_US": "Kartell",
9-
"fr_FR": "Kartell"
10-
},
11-
"main_image": "0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg",
127
"values": {
8+
"label": [
9+
{
10+
"locale": "en_US",
11+
"channel": null,
12+
"data": "Kartell"
13+
}
14+
],
15+
"main_image": [
16+
{
17+
"locale": null,
18+
"channel": null,
19+
"data": "0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg"
20+
}
21+
],
1322
"description": [
1423
{
1524
"locale": "en_US",
@@ -40,12 +49,21 @@ example: [
4049
},
4150
{
4251
"code": "ligneroset",
43-
"labels":{
44-
"en_US": "Ligne roset",
45-
"fr_FR": "Ligne roset"
46-
},
47-
"main_image": "4/b/0/1/0cb0c0e115dedde78b8d1ad8343ec980cd5daa54_image.jpg",
4852
"values": {
53+
"label": [
54+
{
55+
"locale": "en_US",
56+
"channel": null,
57+
"data": "Ligne Roset"
58+
}
59+
],
60+
"main_image": [
61+
{
62+
"locale": null,
63+
"channel": null,
64+
"data": "4/b/0/1/0cb0c0e115dedde78b8d1ad8343ec980cd5daa54_image.jpg"
65+
}
66+
],
4967
"description": [
5068
{
5169
"data": "Very well known French brand of modern and luxury furniture",
@@ -69,12 +87,21 @@ example: [
6987
},
7088
{
7189
"code": "usm",
72-
"labels":{
73-
"en_US": "USM",
74-
"fr_FR": "USM"
75-
},
76-
"main_image": "9/c/g/1/0cb0c0e115dedba76f8d1ad8343ec897abc43bv4_image.jpg",
7790
"values": {
91+
"label": [
92+
{
93+
"locale": "en_US",
94+
"channel": null,
95+
"data": "USM"
96+
}
97+
],
98+
"main_image": [
99+
{
100+
"locale": null,
101+
"channel": null,
102+
"data": "9/c/g/1/0cb0c0e115dedba76f8d1ad8343ec897abc43bv4_image.jpg"
103+
}
104+
],
78105
"description": [
79106
{
80107
"data": "Modular furniture from Switzerland for your home and office",

content/swagger/resources/reference_entity_records/routes/reference_entity_records.yaml

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,24 @@ get:
5959
"_links": {
6060
"self": {
6161
"href": "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/records/kartell"
62-
},
63-
"main_image_download": {
64-
"href": "https://demo.cloud.akeneo.com/api/rest/v1/reference-entities-media-files/0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg"
6562
}
6663
},
6764
"code": "kartell",
68-
"labels":{
69-
"en_US": "Kartell",
70-
"fr_FR": "Kartell"
71-
},
72-
"main_image": "0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg",
7365
"values": {
66+
"label": [
67+
{
68+
"locale": "en_US",
69+
"channel": null,
70+
"data": "Kartell"
71+
}
72+
],
73+
"main_image": [
74+
{
75+
"locale": null,
76+
"channel": null,
77+
"data": "0/c/b/0/0cb0c0e115dedba676f8d1ad8343ec207ab54c7b_image.jpg"
78+
}
79+
],
7480
"description": [
7581
{
7682
"data": "The contemporary Italian furniture brand",
@@ -96,18 +102,24 @@ get:
96102
"_links": {
97103
"self": {
98104
"href": "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/records/usm"
99-
},
100-
"main_image_download": {
101-
"href": "https://demo.cloud.akeneo.com/api/rest/v1/reference-entities-media-files/9/c/g/1/0cb0c0e115dedba76f8d1ad8343ec897abc43bv4_image.jpg"
102105
}
103106
},
104107
"code": "usm",
105-
"labels":{
106-
"en_US": "USM",
107-
"fr_FR": "USM"
108-
},
109-
"main_image": "9/c/g/1/0cb0c0e115dedba76f8d1ad8343ec897abc43bv4_image.jpg",
110108
"values": {
109+
"label": [
110+
{
111+
"locale": "en_US",
112+
"channel": null,
113+
"data": "USM"
114+
}
115+
],
116+
"main_image": [
117+
{
118+
"locale": null,
119+
"channel": null,
120+
"data": "9/c/g/1/0cb0c0e115dedba76f8d1ad8343ec897abc43bv4_image.jpg"
121+
}
122+
],
111123
"description": [
112124
{
113125
"data": "Modular furniture from Switzerland for your home and office",
@@ -133,18 +145,24 @@ get:
133145
"_links": {
134146
"self": {
135147
"href": "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/records/ligneroset"
136-
},
137-
"main_image_download": {
138-
"href": "https://demo.cloud.akeneo.com/api/rest/v1/reference-entities-media-files/4/b/0/1/0cb0c0e115dedde78b8d1ad8343ec980cd5daa54_image.jpg"
139148
}
140149
},
141150
"code": "ligneroset",
142-
"labels":{
143-
"en_US": "Ligne roset",
144-
"fr_FR": "Ligne roset"
145-
},
146-
"main_image": "4/b/0/1/0cb0c0e115dedde78b8d1ad8343ec980cd5daa54_image.jpg",
147151
"values": {
152+
"label": [
153+
{
154+
"locale": "en_US",
155+
"channel": null,
156+
"data": "Ligne Roset"
157+
}
158+
],
159+
"main_image": [
160+
{
161+
"locale": null,
162+
"channel": null,
163+
"data": "4/b/0/1/0cb0c0e115dedde78b8d1ad8343ec980cd5daa54_image.jpg"
164+
}
165+
],
148166
"description": [
149167
{
150168
"data": "Very well known French brand of modern and luxury furniture",

0 commit comments

Comments
 (0)