Skip to content

fix: allow empty predicate in query APIs#54

Open
fulviocazzanti wants to merge 1 commit intomainfrom
fix/15-allow-empty-predicate
Open

fix: allow empty predicate in query APIs#54
fulviocazzanti wants to merge 1 commit intomainfrom
fix/15-allow-empty-predicate

Conversation

@fulviocazzanti
Copy link
Copy Markdown
Contributor

Summary

  • Empty, whitespace-only, or omitted predicates are now treated as match-all filters instead of returning 400 errors
  • ParsePredicate returns MatchAllPredicate for empty/whitespace input (early return before ANTLR parsing)
  • Removed required:"true" tag from the Predicate field in the Query model
  • Updated edge case tests to verify new behavior

Closes #15

Test plan

  • TestParse_EdgeCases — empty string and whitespace return MatchAllPredicate
  • TestParseTrueKeyword — existing true keyword behavior preserved
  • Full test suite passes (go test ./common/... ./pmanager/... ./tmanager/...)

🤖 Generated with Claude Code

An empty, whitespace-only, or omitted predicate is now treated as a
match-all filter instead of returning a 400 error. This makes the API
more intuitive: omitting the predicate means "return all results"
within the bounds of offset/limit pagination.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Query APIs: allow empty predicate

1 participant