Altinn / Altinn/app-frontend-react
Validate numbers in frontend when there is a `totalDigits` constraint
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
For a XSD schema like this:

We will generate this (in Studio):

But it seems that is not being validated. A workaround would be setting `maximum` and `minimum` instead if the type of the number is `integer`, but it doesn't work decimal numbers. There is not JSONSchema equivalent of `xs:totalDigits` (since it accounts for digits on both sides of the decimal point). The backend C# classes are annotated with regex validation attributes, so it seems to work on the backend. So options:
* Manually validate `totalDigits` in frontend
* ???
Contributor guide
Assessment
This issue has not been assessed yet.