Skip to content

Return empty array if there is no aspects for a category in get_item_aspects_for_category endpoint#7

Merged
ulandj merged 1 commit intosupport-catalog-product-searchfrom
return-empty-array-if-there-is-no-aspects-for-category
Jan 22, 2026
Merged

Return empty array if there is no aspects for a category in get_item_aspects_for_category endpoint#7
ulandj merged 1 commit intosupport-catalog-product-searchfrom
return-empty-array-if-there-is-no-aspects-for-category

Conversation

@ulandj
Copy link
Collaborator

@ulandj ulandj commented Jan 22, 2026

Problem

The get_item_aspects_for_category endpoint returns inconsistent data types:

  • Returns true when eBay responds with HTTP 204 (no aspects available)
  • Returns { "aspects" => [...] } when aspects exist

This inconsistency forces consumers to handle two different data types.

Solution

Override the default 204 handler to always return { "aspects" => [] } when no aspects are available, ensuring a consistent hash structure regardless of the response status.

Changes

  • Added explicit response(204) handler in the operation definition
  • Returns empty aspects array for consistency
  • Added test coverage for the 204 No Content scenario

@ulandj ulandj merged commit dfdd404 into support-catalog-product-search Jan 22, 2026
8 checks passed
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.

2 participants