-
Notifications
You must be signed in to change notification settings - Fork 416
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
IntCodec cannot take negative values #2378
Comments
/bounty $100 We can allow parsing of negative values. Since they are, after all, ints. |
💎 $100 bounty created by jdegoes
|
@jdegoes can this condition inside while loop solves our problem ?
|
/attempt #2378 Options |
/attempt #2378 - I think isDefinedAt needs to be modified to account for a potential minus sign at the beginning of the string. def isDefinedAt(value: String): Boolean = { var i = 0 var defined = true Options |
Note: The user @danieletorelli is already attempting to complete issue #2378 and claim the bounty. If you attempt to complete the same issue, there is a chance that @danieletorelli will complete the issue first, and be awarded the bounty. We recommend discussing with @danieletorelli and potentially collaborating on the same solution versus creating an alternate solution. |
💡 @danieletorelli submitted a pull request that claims the bounty. You can visit your org dashboard to reward. |
🎉🎈 @danieletorelli has been awarded $100! 🎈🎊 |
Describe the bug
it's not possible to have negative int query params.
Due to the code above and that
TextCodec
is a sealed trait it's not possible to take a negative integer value as a query param. You also aren't able to create your own. The only workaround is to have as a string and parse yourself - this means that if you tried to generate any documentation in the future it would be wrongly typed.This is quite an opinionated approach, what if -100 was to go back 100 items for example.
The text was updated successfully, but these errors were encountered: