Skip to content

Commit 82746cb

Browse files
committed
Remove several upsert which are useless
1 parent 3cb1722 commit 82746cb

File tree

6 files changed

+29
-243
lines changed

6 files changed

+29
-243
lines changed

content/rest-api/resources.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,11 @@ Format for the `reference entity single link` and `reference entity multiple lin
12201220
}
12211221
```
12221222

1223+
::: warning
1224+
You can have at max 100 attributes to describe the structure of one given reference entity.
1225+
As a consequence, when you ask for the list of attributes of one given reference entity, you'll see that the response is not paginated. It won't cause any performance issue, since you can't have more than 100 attributes per reference entity.
1226+
:::
1227+
12231228
::: panel-link Want more details about the reference entity attribute resource? [Check its endpoints here!](/api-reference.html#Referenceentityattribute)
12241229
:::
12251230

@@ -1260,6 +1265,11 @@ Below is the JSON format representing these reference entity attribute options.
12601265
}
12611266
```
12621267

1268+
::: warning
1269+
You can have at max 100 options per attribute. If you want to have more, it makes totally sense to create a new reference entity that you can then use as an attribute.
1270+
As a consequence of this limit, when you ask for the list of attribute options of one given attribute, you'll see that the response is not paginated. It won't cause any performance issue, since you can't have more than 100 options per attribute.
1271+
:::
1272+
12631273
::: panel-link Want more details about the reference entity attribute option resource? [Check its endpoints here!](/api-reference.html#Referenceentityattributeoption)
12641274
:::
12651275

content/swagger/definitions.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ ReferenceEntityAttributeList:
5757
ReferenceEntityAttributeOption:
5858
$ref: ./resources/reference_entity_attributes/definitions/reference_entity_attribute_option.yaml
5959
ReferenceEntityAttributeOptionList:
60-
type: object
61-
allOf:
62-
- $ref: '#/definitions/ItemList'
63-
- $ref: ./resources/reference_entity_attributes/definitions/reference_entity_attribute_option.yaml
60+
type: array
61+
items:
62+
$ref: ./resources/reference_entity_attributes/definitions/reference_entity_attribute_option.yaml
6463

6564
ReferenceEntityRecord:
6665
type: object

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

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

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

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

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

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ get:
1717
$ref: '#/definitions/ReferenceEntityAttributeList'
1818
x-examples: [
1919
{
20-
"_links": {
21-
"self": {
22-
"href": "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/attributes/description"
23-
}
24-
},
2520
"code": "description",
2621
"labels": {
2722
"en_US": "Description",
@@ -38,11 +33,6 @@ get:
3833
"validation_regexp": null
3934
},
4035
{
41-
"_links": {
42-
"self": {
43-
"href": "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/attributes/country"
44-
}
45-
},
4636
"code": "country",
4737
"labels": {
4838
"en_US": "Country",
@@ -54,11 +44,6 @@ get:
5444
"is_required_for_completeness": false
5545
},
5646
{
57-
"_links": {
58-
"self": {
59-
"href": "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/attributes/collection_overview"
60-
}
61-
},
6247
"code": "collection_overview",
6348
"labels": {
6449
"en_US": "Collection overview",
@@ -76,47 +61,3 @@ get:
7661
$ref: "#/responses/401Error"
7762
406:
7863
$ref: "#/responses/406Error"
79-
patch:
80-
summary: Update/create several attributes of a given reference entity
81-
operationId: "patch_reference_entity_attributes"
82-
tags:
83-
- Reference entity attribute
84-
x-versions:
85-
- "3.0"
86-
x-ee: true
87-
description: This endpoint allows you to update and/or create several reference entity attributes at once. Note that if the attribute does not already exist for the given reference entity, it creates it.
88-
parameters:
89-
- $ref: '#/parameters/reference_entity_code'
90-
- name: body
91-
in: body
92-
required: true
93-
schema:
94-
$ref: ../definitions/reference_entity_attributes.yaml
95-
responses:
96-
200:
97-
description: OK
98-
x-details: Returns an JSON array in which each object gives you the status of each attribute creation or update
99-
x-no-entity: true
100-
schema:
101-
$ref: '#/definitions/ErrorByObject'
102-
x-examples: [
103-
{
104-
"code": "description",
105-
"status_code": 204
106-
},
107-
{
108-
"code": "country",
109-
"status_code": 422,
110-
"message": "Property 'group' does not exist."
111-
},
112-
{
113-
"code": "collection_overview",
114-
"status_code": 201
115-
}
116-
]
117-
401:
118-
$ref: "#/responses/401Error"
119-
413:
120-
$ref: "#/responses/413Error"
121-
415:
122-
$ref: "#/responses/415ErrorStream"

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

Lines changed: 16 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -10,124 +10,36 @@ get:
1010
parameters:
1111
- $ref: '#/parameters/reference_entity_code'
1212
- $ref: '#/parameters/attribute_code'
13-
- $ref: '#/parameters/search_after'
1413
responses:
1514
200:
16-
description: Return reference entity attribute options paginated
17-
schema:
18-
title: Entity Reference Attribute Options
19-
type: object
20-
allOf:
21-
- $ref: '#/definitions/SearchAfterPagination'
22-
- properties:
23-
_embedded:
24-
type: object
25-
properties:
26-
_items:
27-
type: array
28-
items:
29-
$ref: '#/definitions/ReferenceEntityAttributeOptionList'
30-
examples: {
31-
_links: {
32-
self: {
33-
href: "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/attributes/trends/options"
34-
},
35-
first: {
36-
href: "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/attributes/trends/options"
37-
},
38-
next: {
39-
href: "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/attributes/trends/options?search_after=4x088w%5D%5D"
40-
}
41-
},
42-
_embedded: {
43-
_items: [
44-
{
45-
"_links": {
46-
"self": {
47-
"href": "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/attributes/trends/options/woodland_retreat"
48-
}
49-
},
50-
"code": "woodland_retreat",
51-
"labels": {
52-
"en_US": "Woodland Retreat",
53-
"fr_FR": "Retraite dans les Bois"
54-
}
55-
},
56-
{
57-
"_links": {
58-
"self": {
59-
"href": "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/attributes/trends/options/new_nordic"
60-
}
61-
},
62-
"code": "new_nordic",
63-
"labels": {
64-
"en_US": "New Nordic",
65-
"fr_FR": "Renouveau Scandinave"
66-
}
67-
},
68-
{
69-
"_links": {
70-
"self": {
71-
"href": "https://demo.akeneo.com/api/rest/v1/reference-entities/brands/attributes/trends/options/global_nomad"
72-
}
73-
},
74-
"code": "global_nomad",
75-
"labels": {
76-
"en_US": "Global Nomad",
77-
"fr_FR": "Nomade du Monde"
78-
}
79-
}
80-
]
81-
}
82-
}
83-
401:
84-
$ref: "#/responses/401Error"
85-
406:
86-
$ref: "#/responses/406Error"
87-
patch:
88-
summary: Update/create several reference entity attribute options
89-
operationId: "patch_reference_entity_attributes__attribute_code__options"
90-
tags:
91-
- Reference entity attribute option
92-
x-versions:
93-
- "3.0"
94-
x-ee: true
95-
description: This endpoint allows you to update several options for a given attribute and a given reference entity at once.
96-
x-body-by-line: Contains several lines, each line is a reference entity attribute option in JSON standard format
97-
parameters:
98-
- $ref: '#/parameters/reference_entity_code'
99-
- $ref: '#/parameters/attribute_code'
100-
- name: body
101-
in: body
102-
schema:
103-
$ref: ../definitions/reference_entity_attribute_options.yaml
104-
responses:
105-
200:
106-
description: OK
107-
x-details: Returns an JSON array in which each object gives you the status of each reference entity attribute option creation or update
15+
description: Return the options of the given attributes of the given reference entity
10816
x-no-entity: true
10917
schema:
110-
$ref: '#/definitions/ErrorByObject'
18+
$ref: '#/definitions/ReferenceEntityAttributeOptionList'
11119
x-examples: [
11220
{
11321
"code": "woodland_retreat",
114-
"status_code": 204
22+
"labels": {
23+
"en_US": "Woodland Retreat",
24+
"fr_FR": "Retraite dans les Bois"
25+
}
11526
},
11627
{
11728
"code": "new_nordic",
118-
"status_code": 422,
119-
"message": "Property 'group' does not exist."
29+
"labels": {
30+
"en_US": "New Nordic",
31+
"fr_FR": "Renouveau Scandinave"
32+
}
12033
},
12134
{
12235
"code": "global_nomad",
123-
"status_code": 201
36+
"labels": {
37+
"en_US": "Global Nomad",
38+
"fr_FR": "Nomade du Monde"
39+
}
12440
}
12541
]
12642
401:
12743
$ref: "#/responses/401Error"
128-
403:
129-
$ref: "#/responses/403Error"
130-
413:
131-
$ref: "#/responses/413Error"
132-
415:
133-
$ref: "#/responses/415ErrorStream"
44+
406:
45+
$ref: "#/responses/406Error"

0 commit comments

Comments
 (0)