Skip to content

Conversation

@rmustafin
Copy link
Contributor

Intent (What)

Sometimes in response for list methods XPM doesn't return a "second-level key". For example, we expect the XML response to have structure Categories -> Category -> content but we receive just Categories.

A real life example of such response:

<Response api-method="List"><Status>OK</Status><Categories /></Response>

I assume it can happen not just with categories but other methods.

Motivation (Why)

gem fails with https://sentry.io/organizations/ignition/issues/2260233094/?project=1314270&referrer=slack

Implementation (How)

Consequence

@rmustafin rmustafin requested a review from a team as a code owner March 17, 2021 11:28
Copy link
Contributor

@rudylee rudylee left a comment

Choose a reason for hiding this comment

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

I assume it can happen not just with categories but other methods.

I guess it's better if you can confirm this since you don't have spec to check if this is true or not.

@rmustafin
Copy link
Contributor Author

@rudylee dig method shouldn't break current logic, it will simply prevent the error if we don't receive what's expected (empty array). i can add specs to the other methods too

@rmustafin rmustafin merged commit 6d7e20a into master Mar 18, 2021
@rmustafin rmustafin deleted the NOJIRA/fix_empty_categoryes branch March 18, 2021 05:19
lankz pushed a commit that referenced this pull request Jun 10, 2025
[NOJIRA] fix when API doesn't return an array for list methods
lankz pushed a commit that referenced this pull request Jun 10, 2025
[NOJIRA] fix when API doesn't return an array for list methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants