-
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
Changes from 3 commits
73998f8
71b57ed
6afb616
d263017
4491a33
e924724
c31c346
e2786f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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" | ||
| } | ||
| } |
| 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> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "SegmentGroupCreate": { | ||
| "identifier": "segment_group_identifier", | ||
| "name": "Segment Group Name" | ||
| } | ||
| } |
| 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> |
| 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" | ||
| } | ||
| } |
| 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> |
| 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" | ||
| } | ||
| } |
| 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> |
| 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" | ||
| } | ||
| } | ||
| } |
| 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> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "SegmentCreate": { | ||
| "identifier": "segment_identifier", | ||
| "name": "Segment Name", | ||
| "group": "corporate_accounts" | ||
| } | ||
| } |
| 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> |
| 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" | ||
| } | ||
| } | ||
| } |
| 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> |
| 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" | ||
| } | ||
| } |
| 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> |
| 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" | ||
| } | ||
| } | ||
| } |
| 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> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,110 @@ get: | |
| type: ErrorMessage | ||
| application/vnd.ibexa.api.ErrorMessage+json: | ||
| type: ErrorMessage | ||
| post: | ||
| displayName: Create a segment group | ||
| description: Creates a segment group. | ||
| headers: | ||
| Content-Type: | ||
| description: A SegmentGroupCreate schema encoded in XML or JSON format. | ||
| example: | | ||
| application/vnd.ibexa.api.SegmentGroupCreate+xml | ||
| application/vnd.ibexa.api.SegmentGroupCreate+json | ||
| Accept: | ||
| description: A segment group is returned in XML or JSON format. | ||
| example: | | ||
| application/vnd.ibexa.api.SegmentGroup+xml | ||
| application/vnd.ibexa.api.SegmentGroup+json | ||
| body: | ||
| application/vnd.ibexa.api.SegmentGroupCreate+xml: | ||
| type: SegmentGroupCreate | ||
| example: !include examples/segment_groups/POST/SegmentGroupCreate.xml.example | ||
| application/vnd.ibexa.api.SegmentGroupCreate+json: | ||
| type: SegmentGroupCreateWrapper | ||
| example: !include examples/segment_groups/POST/SegmentGroupCreate.json.example | ||
| responses: | ||
| 200: | ||
| description: OK - list the segment groups. | ||
| body: | ||
| application/vnd.ibexa.api.SegmentGroup+xml: | ||
| type: SegmentGroup | ||
| example: !include examples/segment_groups/POST/SegmentGroup.xml.example | ||
| application/vnd.ibexa.api.SegmentGroup+json: | ||
| type: SegmentGroupWrapper | ||
| example: !include examples/segment_groups/POST/SegmentGroup.json.example | ||
| 400: | ||
| description: Error - input data validation failed. | ||
| body: | ||
| application/vnd.ibexa.api.ErrorMessage+xml: | ||
| type: ErrorMessage | ||
| application/vnd.ibexa.api.ErrorMessage+json: | ||
| type: ErrorMessage | ||
| 401: | ||
| description: Error - the user is not authorized to list segment groups. | ||
| body: | ||
| application/vnd.ibexa.api.ErrorMessage+xml: | ||
| type: ErrorMessage | ||
| application/vnd.ibexa.api.ErrorMessage+json: | ||
| type: ErrorMessage | ||
| 406: | ||
| description: Error - input data is not acceptable. | ||
| body: | ||
| application/vnd.ibexa.api.ErrorMessage+xml: | ||
| type: ErrorMessage | ||
| application/vnd.ibexa.api.ErrorMessage+json: | ||
| type: ErrorMessage | ||
| /{id}: | ||
| patch: | ||
| displayName: Update segment group data | ||
| description: Updates the segment group's data. | ||
| headers: | ||
| Content-Type: | ||
| description: The SegmentGroupUpdate schema encoded in XML or JSON format. | ||
| example: | | ||
| application/vnd.ibexa.api.SegmentGroupUpdate+xml | ||
| application/vnd.ibexa.api.SegmentGroupUpdate+json | ||
| Accept: | ||
| description: A segment group is returned in XML or JSON format. | ||
| example: | | ||
| application/vnd.ibexa.api.SegmentGroup+xml | ||
| application/vnd.ibexa.api.SegmentGroup+json | ||
| body: | ||
| application/vnd.ibexa.api.SegmentGroupUpdate+xml: | ||
| type: SegmentGroupUpdate | ||
| example: !include examples/segment_groups/id/PATCH/SegmentGroupUpdate.xml.example | ||
| application/vnd.ibexa.api.SegmentGroupUpdate+json: | ||
| type: SegmentGroupUpdateWrapper | ||
| example: !include examples/segment_groups/id/PATCH/SegmentGroupUpdate.json.example | ||
| responses: | ||
| 200: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Nope, in such case I am getting 500: There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. @micszo @wiewiurdp The same happens for There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately the real issue is in |
||
| description: OK - list the segment groups. | ||
dabrt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| body: | ||
| application/vnd.ibexa.api.SegmentGroup+xml: | ||
| type: SegmentGroup | ||
| example: !include examples/segment_groups/id/PATCH/SegmentGroup.xml.example | ||
| application/vnd.ibexa.api.SegmentGroup+json: | ||
| type: SegmentGroupWrapper | ||
| example: !include examples/segment_groups/id/PATCH/SegmentGroup.json.example | ||
| delete: | ||
| displayName: Delete a segment group | ||
| description: Deletes the segment group. | ||
| responses: | ||
| 204: | ||
| description: Segment group does not exist. | ||
dabrt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 401: | ||
| description: Error - the user is not authorized to delete segment groups. | ||
| body: | ||
| application/vnd.ibexa.api.ErrorMessage+xml: | ||
| type: ErrorMessage | ||
| application/vnd.ibexa.api.ErrorMessage+json: | ||
| type: ErrorMessage | ||
| 404: | ||
| description: Error - the identifier doesn't match any segment group. | ||
| body: | ||
| application/vnd.ibexa.api.ErrorMessage+xml: | ||
| type: ErrorMessage | ||
| application/vnd.ibexa.api.ErrorMessage+json: | ||
| type: ErrorMessage | ||
| /{identifier}: | ||
| get: | ||
| displayName: Load segment group | ||
|
|
@@ -33,8 +137,8 @@ get: | |
| Accept: | ||
| description: If set, the segment group is returned in XML or JSON format. | ||
| example: | | ||
| vnd.ibexa.api.SegmentGroup+xml | ||
| vnd.ibexa.api.SegmentGroup+json | ||
| application/vnd.ibexa.api.SegmentGroup+xml | ||
| application/vnd.ibexa.api.SegmentGroup+json | ||
| responses: | ||
| 200: | ||
| description: OK - return the segment group. | ||
|
|
@@ -57,8 +161,8 @@ get: | |
| Accept: | ||
| description: If set, the segment group is returned in XML or JSON format. | ||
| example: | | ||
| vnd.ibexa.api.SegmentList+xml | ||
| vnd.ibexa.api.SegmentList+json | ||
| application/vnd.ibexa.api.SegmentList+xml | ||
| application/vnd.ibexa.api.SegmentList+json | ||
| responses: | ||
| 200: | ||
| description: OK - list the group's segments. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.