Skip to content

Conversation

dabrt
Copy link
Contributor

@dabrt dabrt commented Feb 19, 2025

Question Answer
JIRA Ticket IBX-9452
Versions 4.6+
Edition all

Describe new segment and segment group endpoints in REST API. Add missing responses.

Here's a link to the updated file: REST API Reference

Checklist

  • Text renders correctly
  • Added link to this PR in relevant JIRA ticket or code PR

@github-actions
Copy link

Preview of modified Markdown: no Markdown change to preview.

@dabrt dabrt requested review from ciastektk, mnocon and wiewiurdp and removed request for ciastektk February 20, 2025 18:37
Copy link
Contributor

@mnocon mnocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for preparing this! Looks good overall, just a couple of small suggestions

type: SegmentGroupUpdateWrapper
example: !include examples/segment_groups/id/PATCH/SegmentGroupUpdate.json.example
responses:
200:
Copy link
Contributor

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.

Copy link
Contributor Author

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 SET identifier= ?,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'"

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor Author

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_segments after changing identifier to an existing one. 500 is thrown with Integrity constraint violation: 1062 Duplicate entry 'modified_segment_identifier' for key 'ibexa_segments.ibexa_segments_identifier'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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 😞

@dabrt dabrt requested a review from mnocon February 25, 2025 10:56
Copy link
Contributor

@mnocon mnocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dabrt dabrt merged commit 01b7461 into master Feb 26, 2025
6 of 7 checks passed
@dabrt dabrt deleted the IBX-9452 branch February 26, 2025 08:51
dabrt added a commit that referenced this pull request Feb 26, 2025
dabrt added a commit that referenced this pull request Feb 27, 2025
dabrt added a commit that referenced this pull request Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants