-
Notifications
You must be signed in to change notification settings - Fork 81
IBX-9452: Describe segment and segment group REST endpoints #2624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
73998f8
IBX-9452: Describe segment and segment group endpoints
dabrt 71b57ed
POST and PATCH segment group methods added
dabrt 6afb616
Add endpoint descriptions for segments
dabrt d263017
Implement review comments
dabrt 4491a33
Upload modified HTML
dabrt e924724
Move example files and update imports
dabrt c31c346
Changes after peer review
dabrt e2786f5
Updated HTML file
dabrt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
.../rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroup.json.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "SegmentGroup": { | ||
| "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", | ||
| "_href": "/api/ibexa/v2/segment_groups/segment_group_identifier", | ||
| "id": 3, | ||
| "identifier": "segment_group_identifier", | ||
| "name": "Segment Group Name" | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
...i/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroup.xml.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <SegmentGroup media-type="application/vnd.ibexa.api.SegmentGroup+xml" href="/api/ibexa/v2/segment_groups/segment_group_identifier"> | ||
| <id>3</id> | ||
| <identifier>segment_group_identifier</identifier> | ||
| <name>Segment Group Name</name> | ||
| </SegmentGroup> |
6 changes: 6 additions & 0 deletions
6
...api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroupCreate.json.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "SegmentGroupCreate": { | ||
| "identifier": "segment_group_identifier", | ||
| "name": "Segment Group Name" | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
..._api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroupCreate.xml.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <SegmentGroupCreate> | ||
| <identifier>segment_group_identifier</identifier> | ||
| <name>Segment Group Name</name> | ||
| </SegmentGroupCreate> |
9 changes: 9 additions & 0 deletions
9
...t_api/rest_api_reference/input/examples/segment_groups/id/PATCH/SegmentGroup.json.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "SegmentGroup": { | ||
| "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", | ||
| "_href": "/api/ibexa/v2/segment_groups/modified_segment_group_identifier", | ||
| "id": 3, | ||
| "identifier": "modified_segment_group_identifier", | ||
| "name": "Modified Segment Group Name" | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
...st_api/rest_api_reference/input/examples/segment_groups/id/PATCH/SegmentGroup.xml.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <SegmentGroup media-type="application/vnd.ibexa.api.SegmentGroup+xml" href="/api/ibexa/v2/segment_groups/modified_segment_group_identifier"> | ||
| <id>4</id> | ||
| <identifier>modified_segment_group_identifier</identifier> | ||
| <name>Modified Segment Group Name</name> | ||
| </SegmentGroup> |
6 changes: 6 additions & 0 deletions
6
...rest_api_reference/input/examples/segment_groups/id/PATCH/SegmentGroupUpdate.json.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "SegmentGroupUpdate": { | ||
| "identifier": "modified_segment_group_identifier", | ||
| "name": "Modified Segment Group Name" | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
.../rest_api_reference/input/examples/segment_groups/id/PATCH/SegmentGroupUpdate.xml.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <SegmentGroupUpdate> | ||
| <identifier>modified_segment_group_identifier</identifier> | ||
| <name>Modified Segment Group Name</name> | ||
| </SegmentGroupUpdate> |
13 changes: 13 additions & 0 deletions
13
docs/api/rest_api/rest_api_reference/input/examples/segments/POST/Segment.json.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "Segment": { | ||
| "_media-type": "application/vnd.ibexa.api.Segment+json", | ||
| "_href": "/api/ibexa/v2/segments/segment_identifier", | ||
| "id": 3, | ||
| "identifier": "segment_identifier", | ||
| "name": "Segment Name", | ||
| "SegmentGroup": { | ||
| "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", | ||
| "_href": "/api/ibexa/v2/segment_groups/corporate_accounts" | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
docs/api/rest_api/rest_api_reference/input/examples/segments/POST/Segment.xml.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <Segment media-type="application/vnd.ibexa.api.Segment+xml" href="/api/ibexa/v2/segments/segment_identifier"> | ||
| <id>3</id> | ||
| <identifier>segment_identifier</identifier> | ||
| <name>Segment Name</name> | ||
| <SegmentGroup media-type="application/vnd.ibexa.api.SegmentGroup+xml" href="/api/ibexa/v2/segment_groups/corporate_accounts"/> | ||
| </Segment> |
7 changes: 7 additions & 0 deletions
7
docs/api/rest_api/rest_api_reference/input/examples/segments/POST/SegmentCreate.json.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "SegmentCreate": { | ||
| "identifier": "segment_identifier", | ||
| "name": "Segment Name", | ||
| "group": "corporate_accounts" | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
docs/api/rest_api/rest_api_reference/input/examples/segments/POST/SegmentCreate.xml.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <SegmentCreate> | ||
| <identifier>segment_identifier</identifier> | ||
| <name>Segment Name</name> | ||
| <group>corporate_accounts</group> | ||
| </SegmentCreate> |
13 changes: 13 additions & 0 deletions
13
docs/api/rest_api/rest_api_reference/input/examples/segments/id/PATCH/Segment.json.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "Segment": { | ||
| "_media-type": "application/vnd.ibexa.api.Segment+json", | ||
| "_href": "/api/ibexa/v2/segments/modified_segment_identifier", | ||
| "id": 3, | ||
| "identifier": "modified_segment_identifier", | ||
| "name": "Modified Segment Name", | ||
| "SegmentGroup": { | ||
| "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", | ||
| "_href": "/api/ibexa/v2/segment_groups/small_companies" | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
docs/api/rest_api/rest_api_reference/input/examples/segments/id/PATCH/Segment.xml.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <Segment media-type="application/vnd.ibexa.api.Segment+xml" href="/api/ibexa/v2/segments/modified_segment_identifier"> | ||
| <id>3</id> | ||
| <identifier>modified_segment_identifier</identifier> | ||
| <name>Modified Segment Name</name> | ||
| <SegmentGroup media-type="application/vnd.ibexa.api.SegmentGroup+xml" href="/api/ibexa/v2/segment_groups/small_companies"/> | ||
| </Segment> |
7 changes: 7 additions & 0 deletions
7
...i/rest_api/rest_api_reference/input/examples/segments/id/PATCH/SegmentUpdate.json.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "SegmentUpdate": { | ||
| "identifier": "modified_segment_identifier", | ||
| "name": "Modified Segment Name", | ||
| "group": "small_companies" | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
...pi/rest_api/rest_api_reference/input/examples/segments/id/PATCH/SegmentUpdate.xml.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <SegmentUpdate> | ||
| <identifier>modified_segment_identifier</identifier> | ||
| <name>Modified Segment Name</name> | ||
| <group>small_companies</group> | ||
| </SegmentUpdate> |
13 changes: 13 additions & 0 deletions
13
...i/rest_api/rest_api_reference/input/examples/segments/identifier/GET/Segment.json.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "Segment": { | ||
| "_media-type": "application/vnd.ibexa.api.Segment+json", | ||
| "_href": "/api/ibexa/v2/segments/segment_identifier", | ||
| "id": 3, | ||
| "identifier": "segment_identifier", | ||
| "name": "Segment Name", | ||
| "SegmentGroup": { | ||
| "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", | ||
| "_href": "/api/ibexa/v2/segment_groups/corporate_accounts" | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
...pi/rest_api/rest_api_reference/input/examples/segments/identifier/GET/Segment.xml.example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <Segment media-type="application/vnd.ibexa.api.Segment+xml" href="/api/ibexa/v2/segments/segment_identifier"> | ||
| <id>3</id> | ||
| <identifier>segment_identifier</identifier> | ||
| <name>Segment Name</name> | ||
| <SegmentGroup media-type="application/vnd.ibexa.api.SegmentGroup+xml" href="/api/ibexa/v2/segment_groups/corporate_accounts"/> | ||
| </Segment> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to be consistent, I imagine the endpoint returns 406 if we were trying to change the identifier to a one that already exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, in such case I am getting 500:
An exception occurred while executing 'UPDATE ibexa_segment_groups SETidentifier= ?,name= ? WHEREid= ?' with params [\"Tojesttest7\", \"Modified Segment Group Name\", 6]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Tojesttest7' for key 'ibexa_segment_groups.ibexa_segment_groups_identifier'"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so let's not document this 😉
But it's probably a bug - ping @micszo @wiewiurdp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check and report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micszo @wiewiurdp The same happens for
'UPDATE ibexa_segmentsafter changing identifier to an existing one. 500 is thrown withIntegrity constraint violation: 1062 Duplicate entry 'modified_segment_identifier' for key 'ibexa_segments.ibexa_segments_identifier'There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reported as https://issues.ibexa.co/browse/IBX-9634.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the real issue is in
Ibexa\Segmentation\Service\SegmentationService😞