Skip to content

Support for range size predicate - #18

Merged
numbata merged 2 commits into
numbata:mainfrom
slbug:array_size_range_support
Dec 21, 2025
Merged

Support for range size predicate#18
numbata merged 2 commits into
numbata:mainfrom
slbug:array_size_range_support

Conversation

@slbug

@slbug slbug commented Dec 21, 2025

Copy link
Copy Markdown
Contributor
  • size: (1..10) not supported for arrays

extracted from #17

@slbug slbug mentioned this pull request Dec 21, 2025

@numbata numbata left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Overall this is a nice, tight improvement! Thanks for adding range support for size?.

One blocker: exclusive ranges map incorrectly to OpenAPI’s inclusive maxItems/maxLength (e.g., 3...5 emits max_size = 5, allowing 5 items). Please adjust to respect exclusivity (using rng.max is a clean fix) and add a test for the exclusive case
alongside the new inclusive one to lock the behavior. Once that’s in, I’m good.

P.S.: don’t forget to add a line in CHANGELOG.

Comment thread test/grape_oas/introspectors/dry_introspector_test.rb
Comment thread lib/grape_oas/introspectors/dry_introspector_support/predicate_handler.rb Outdated
@slbug
slbug force-pushed the array_size_range_support branch 4 times, most recently from e640305 to aaa6fa6 Compare December 21, 2025 21:32
@slbug
slbug requested a review from numbata December 21, 2025 21:32
@numbata

numbata commented Dec 21, 2025

Copy link
Copy Markdown
Owner

🚀

@numbata

numbata commented Dec 21, 2025

Copy link
Copy Markdown
Owner

I fixed the RuboCop offense and temporarily disabled the memory profiler workflow on main branch.
Please rebase and I’ll merge your PR.

@slbug
slbug force-pushed the array_size_range_support branch from aaa6fa6 to 8677911 Compare December 21, 2025 21:44
@numbata
numbata merged commit 0849eaf into numbata:main Dec 21, 2025
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