Skip to content

feat(api): define filter limits in openapi spec#3809

Open
tothandras wants to merge 1 commit intomainfrom
feat/api-improvements
Open

feat(api): define filter limits in openapi spec#3809
tothandras wants to merge 1 commit intomainfrom
feat/api-improvements

Conversation

@tothandras
Copy link
Contributor

@tothandras tothandras commented Jan 24, 2026

Summary by CodeRabbit

  • New Features
    • Added validation constraints to array-based filter operations, enforcing minimum and maximum item limits to ensure valid filter requests and prevent malformed queries.

✏️ Tip: You can customize this high-level summary in your review settings.

@tothandras tothandras requested a review from a team as a code owner January 24, 2026 12:17
@tothandras tothandras added the release-note/feature Release note: Exciting New Features label Jan 24, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2026

📝 Walkthrough

Walkthrough

Added @minItems and @maxItems validation annotations to array-typed filter properties in the TypeSpec filter definition file, enforcing item count constraints (1-100 for $in/$nin, 1-10 for $and/$or) across five filter model types.

Changes

Cohort / File(s) Summary
Filter validation constraints
api/spec/src/filter.tsp
Added @minItems and @maxItems annotations to array properties: $in and $nin now enforce 1–100 items, while $and and $or enforce 1–10 items. Applied across FilterString, FilterIDExact, FilterInteger, FilterFloat, and FilterTime models.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding filter limits (minItems/maxItems constraints) to the OpenAPI specification for filter properties.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/api-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/feature Release note: Exciting New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants