Skip to content

Fix filter=count output to avoid empty objects#208

Open
dheeraj12347 wants to merge 1 commit intoapache:mainfrom
dheeraj12347:fix-filter-empty-rows
Open

Fix filter=count output to avoid empty objects#208
dheeraj12347 wants to merge 1 commit intoapache:mainfrom
dheeraj12347:fix-filter-empty-rows

Conversation

@dheeraj12347
Copy link

@dheeraj12347 dheeraj12347 commented Mar 26, 2026

Fixes #197 where using filter=count resulted in empty objects being printed in list responses.

Problem

When filter=count is applied, CloudMonkey still iterates over list items and prints empty {} entries.

Fix

  • Skip empty rows after filtering
  • Omit list fields when no valid entries remain
  • Preserve only relevant top-level fields (e.g., "count")

Result

Now the output correctly returns:
{
"count":
}

instead of including empty objects.

Tested locally with CloudMonkey CLI build.

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.

Filter on parameter listing empty objects when filtered parameter doesn't exists

1 participant