Skip to content
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

Feature request: Number validators should be more specific about integers #876

Open
hsekowski-splunk opened this issue Jul 22, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@hsekowski-splunk
Copy link
Contributor

hsekowski-splunk commented Jul 22, 2022

When defining field validators in globalConfig.json, we should be able to be more specific about numbers that are acceptable.
That are integers in most cases, but JavaScript number (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) accepts floats as well.
Proposed options would be to reflect explicitly the type in validator type - eg. "number.integer" or implicitly in range values - eg. "range": [0, 1.0] if float number is expected; "range": [0, 1] would mean that only value 0 or 1 is expected.

@hsekowski-splunk hsekowski-splunk added the enhancement New feature or request label Jul 22, 2022
@artemrys
Copy link
Member

artemrys commented Aug 5, 2022

We probably can introduce a new type for only integer numbers.

@artemrys artemrys transferred this issue from splunk/addonfactory-ucc-base-ui Oct 4, 2023
@artemrys artemrys changed the title number validators should be more specific about integers Feature request: Number validators should be more specific about integers Oct 10, 2023
@vtsvetkov-splunk
Copy link
Collaborator

one more thing - number validator to support only min or max. Sometimes I want number to be positive (for example, interval), without setting the upper limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants