-
Notifications
You must be signed in to change notification settings - Fork 340
page_limit config must accept null #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
A concise update to the configuration to allow the "page_limit" setting to accept null values, while ensuring non-null values are valid integers.
- Changed the "page_limit" node from integerNode to scalarNode.
- Added a validation block to enforce that non-null values are integers.
- Commented out normalization code remains, which could be removed if no longer needed.
#->beforeNormalization() | ||
#->ifNull() | ||
#->then(static fn (mixed $v): int => 5) | ||
#->end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider removing or finalizing the commented-out normalization block if it is no longer needed to improve code clarity.
#->beforeNormalization() | |
#->ifNull() | |
#->then(static fn (mixed $v): int => 5) | |
#->end() |
Copilot uses AI. Check for mistakes.
7c1b5ab
to
56e02f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses issue #832 by updating the configuration for "page_limit" so that it accepts null values. The changes include switching from an integer node to a scalar node, adding validation for integer or null values, and introducing a normalization step for null values.
->end() | ||
->beforeNormalization() | ||
->ifNull() | ||
->then(static fn (mixed $v): int => 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The normalization step converts an explicit null value to 5, which may override a user's intention to provide a null. Consider preserving null if the goal is to allow 'page_limit' to be explicitly set to null.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes issue #832 by allowing the page_limit
configuration to be explicitly set to null
while still validating integer values.
- Changed
page_limit
node fromintegerNode
toscalarNode
withdefaultNull
and custom validation. - Added a validation rule to ensure values are either
null
or an integer.
661cf16
to
ae78849
Compare
Fix #832