question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IntegerAnswerFormat validation with no max value.

See original GitHub issue

According to the comment on the constructor and on getMaxValue 0 should be used to specify no max value but the validation never checks for a zero value.

@param maxValue maximum allowed value, 0 if no max

Validation:

...
else if(intAnswer > getMaxValue())
{
    return new BodyAnswer(false,
    R.string.rsb_invalid_answer_integer_over,
    String.valueOf(getMaxValue()));
}

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nrlakincommented, Aug 31, 2016

It looks like the corresponding ResearchKit class uses ‘nil’ for unused min/max values. I think that settles it in favor of null, or the same survey JSON will yield different outcomes for the two platforms.

0reactions
nrlakincommented, Sep 2, 2016

Maybe I’ll keep the return type to getMaxValue()/ getMinValue() as ints and return MAX_INT/MIN_INT there to avoid breaking any custom validators.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Min/Max-value validators in asp.net mvc - Stack Overflow
I don't think min/max validations attribute exist. I would use something like [Range(1, Int32.MaxValue)]. for minimum value 1 and
Read more >
Values that exceed max int do not show validation in ... - GitHub
I can see a validation message if I use the Html.ValidationMessageFor method. I will get something like "The value '99999999999999999999999' is invalid." The ......
Read more >
HTML attribute: max - HTML: HyperText Markup Language
The max attribute defines the maximum value that is acceptable and valid for the input containing the attribute. If the value of the...
Read more >
VBCS: inputNumber with max and min values - throw error if ...
We wanted to show some notification to the user if user enters a value greater than the max value and tabs out, so...
Read more >
Add MinValueAttribute and MaxValueAttribute for Model ...
It would be easier to read and write and more similar to string validation, if there would be the attributes MinValue and MaxValue,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found