Skip to content

Commit f3d107b

Browse files
committed
add new property and add examples of the different formats
1 parent 798aa8b commit f3d107b

File tree

6 files changed

+100
-9
lines changed

6 files changed

+100
-9
lines changed
-77 Bytes
Loading
-1.38 KB
Loading
-4.07 KB
Loading

content/rest-api/resources.md

Lines changed: 92 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,10 +1096,10 @@ Below is the JSON format representing a reference entity.
10961096

10971097
```json
10981098
{
1099-
"code": "brands",
1099+
"code": "brand",
11001100
"labels": {
1101-
"en_US": "Brands",
1102-
"fr_FR": "Marques"
1101+
"en_US": "Brand",
1102+
"fr_FR": "Marque"
11031103
},
11041104
"image": "0/2/d/6/54d81dc888ba1501a8g765f3ab5797569f3bv756c_ref_img.png"
11051105
}
@@ -1120,8 +1120,9 @@ In the Akeneo UI, you can find the attributes that compose a given reference ent
11201120

11211121
![Reference entity attributes](/img/screenshots/v3.0/reference_entity_attribute.png)
11221122

1123-
Below is the JSON standard format representing a reference entity attribute.
1123+
The JSON format for the reference entity attribute can differ according to its type. Below are some examples for each attribute type.
11241124

1125+
Format for the `text` attribute type
11251126
```json
11261127
{
11271128
"code": "description",
@@ -1132,12 +1133,87 @@ Below is the JSON standard format representing a reference entity attribute.
11321133
"type": "text",
11331134
"localizable": true,
11341135
"scopable": false,
1136+
"is_required_for_completeness": true,
11351137
"max_characters": null,
11361138
"is_textarea": true,
11371139
"is_rich_text_editor": true,
11381140
"validation_rule": null,
1139-
"validation_regexp": null,
1140-
"reference_entity_code": null
1141+
"validation_regexp": null
1142+
}
1143+
```
1144+
1145+
Format for the `image` attribute type
1146+
```json
1147+
{
1148+
"code": "photo",
1149+
"labels": {
1150+
"en_US": "Photo",
1151+
"fr_FR": "Photo"
1152+
},
1153+
"type": "image",
1154+
"localizable": false,
1155+
"scopable": false,
1156+
"is_required_for_completeness": true,
1157+
"allowed_extensions": ["jpg"],
1158+
"max_file_size": "10"
1159+
}
1160+
```
1161+
1162+
Format for the `single option` and `multiple options` attribute types
1163+
```json
1164+
{
1165+
"code": "nationality",
1166+
"labels": {
1167+
"en_US": "Nationality",
1168+
"fr_FR": "Nationalité"
1169+
},
1170+
"type": "single_option",
1171+
"localizable": false,
1172+
"scopable": false,
1173+
"is_required_for_completeness": false
1174+
}
1175+
```
1176+
```json
1177+
{
1178+
"code": "sales_areas",
1179+
"labels": {
1180+
"en_US": "Sales areas",
1181+
"fr_FR": "Zones de vente"
1182+
},
1183+
"type": "multiple_options",
1184+
"localizable": false,
1185+
"scopable": false,
1186+
"is_required_for_completeness": true
1187+
}
1188+
```
1189+
1190+
Format for the `reference entity single link` and `reference entity multiple links` attribute types
1191+
```json
1192+
{
1193+
"code": "country",
1194+
"labels": {
1195+
"en_US": "Country",
1196+
"fr_FR": "Pays"
1197+
},
1198+
"type": "reference_entity_single_link",
1199+
"localizable": false,
1200+
"scopable": false,
1201+
"is_required_for_completeness": false,
1202+
"reference_entity_code": "country"
1203+
}
1204+
```
1205+
```json
1206+
{
1207+
"code": "designers",
1208+
"labels": {
1209+
"en_US": "Designers",
1210+
"fr_FR": "Designeurs"
1211+
},
1212+
"type": "reference_entity_multiple_links",
1213+
"localizable": false,
1214+
"scopable": false,
1215+
"is_required_for_completeness": true,
1216+
"reference_entity_code": "designer"
11411217
}
11421218
```
11431219

@@ -1217,6 +1293,13 @@ Below is the JSON standard format representing a reference entity record.
12171293
"data": "Kartell, l'éditeur de meuble italien spécialisé dans la signature de belle pièces au design contemporain."
12181294
}
12191295
],
1296+
"designer":[
1297+
{
1298+
"locale": null,
1299+
"channel": null,
1300+
"data": "starck"
1301+
}
1302+
],
12201303
"country": [
12211304
{
12221305
"locale": null,
@@ -1231,7 +1314,7 @@ Below is the JSON standard format representing a reference entity record.
12311314
"data": "1949"
12321315
}
12331316
],
1234-
"collection_overview":[
1317+
"photo":[
12351318
{
12361319
"locale": null,
12371320
"channel": null,
@@ -1312,12 +1395,12 @@ The `image` attribute is scopable but not localizable, so it can hold several da
13121395
{
13131396
"locale": null,
13141397
"channel": "ecommerce",
1315-
"data": //TODO
1398+
"data": "5/1/d/8/51d81dc778ba1501a8f998f3ab5797569f3b9e25_img_ecommerce.png"
13161399
},
13171400
{
13181401
"locale": null,
13191402
"channel": "mobile",
1320-
"data": //TODO
1403+
"data": "c/4/d/8/51d81dc778ba1501a8f998f3ab57975610g7867i_img_mobile.png"
13211404
}
13221405
]
13231406
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ properties:
2828
description: Whether the attribute is scopable, i.e. can have one value by channel
2929
default : false
3030
x-immutable: true
31+
is_required_for_completeness:
32+
type: boolean
33+
description: Whether the attribute should be part of the records completeness calculation
34+
default : false
3135
max_characters:
3236
type: integer
3337
description: Maximum number of characters allowed for the value of the attribute when the attribute type is `text`
@@ -80,6 +84,7 @@ example: {
8084
"type": "text",
8185
"localizable": true,
8286
"scopable": false,
87+
"is_required_for_completeness": true,
8388
"max_characters": null,
8489
"is_textarea": true,
8590
"is_rich_text_editor": true,

content/swagger/resources/reference_entity_attributes/routes/reference_entity_attributes.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ get:
3030
"type": "text",
3131
"localizable": true,
3232
"scopable": false,
33+
"is_required_for_completeness": true,
3334
"max_characters": null,
3435
"is_textarea": true,
3536
"is_rich_text_editor": true,
@@ -50,6 +51,7 @@ get:
5051
"type": "text",
5152
"localizable": false,
5253
"scopable": false,
54+
"is_required_for_completeness": false,
5355
"reference_entity_code": null
5456
},
5557
{
@@ -66,6 +68,7 @@ get:
6668
"type": "image",
6769
"localizable": true,
6870
"scopable": false,
71+
"is_required_for_completeness": true,
6972
"allowed_extensions": ["png"],
7073
"max_file_size": "1000"
7174
}

0 commit comments

Comments
 (0)