Hello!
Using
-
Angular 7 with jsonforms/core@2.3.0 / jsonforms/angular-material@2.3.0
-
Angular 9 with jsonforms/core@2.4.0 / jsonforms/angular-material@2.4.0
Given a very simple data object
{
"name": "",
"age": 12
}
And using the API to generate the default schema and uischema
// schema
{
"type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" }},
"additionalProperties": true,
"required": [ "name", "age" ]
}
// uischema
{
"type": "VerticalLayout",
"elements": [
{ "type": "Control", "scope": "#/properties/name" },
{ "type": "Control", "scope": "#/properties/age" }
]
}
Expected behavior
The generated form will validate BOTH properties when they are not provided.
Actual behavior
Only non-string data types are validated.
NOTE: If I set minLength to 1 in the schema that validation does fire.
Any input on where I have gone wrong would be great. I can share the Angular 7 app - it was based on a clone of the make-it-happen-angular repository altered to get familiar with JSON forms and used to test different schema layouts…
[original thread by Thad Peiffer]