altinn-studio
altinn-studio copied to clipboard
Datamodelling: Add support for the `format`-keyword
Description
Atm we doesn't support the format keyword which comes with strings in json schemas. In some legacy form this is used to do the validation. Alongside with the format
keyword there is also some extra keywords to handle maximum and minimum:
- formatMaximum
- formatMinimum
- formatExclusiveMaximum
- formatExclusiveMinimum
All keywords need to be added to the string restriction in the schema-model
. I think that the rest of the code should then just behave with the new keywords as intended. The file that needs editing is here: src/studio/src/designer/frontend/packages/schema-model/src/lib/restrictions.ts
Additional Information
https://json-schema.org/understanding-json-schema/reference/string.html#built-in-formats https://github.com/ajv-validator/ajv-formats#keywords-to-compare-values-formatmaximum--formatminimum-and-formatexclusivemaximum--formatexclusiveminimum