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

tv4 Required / Additional Properties Errors with latest alpha 4 #46

Open
mark007 opened this issue Oct 25, 2017 · 0 comments
Open

tv4 Required / Additional Properties Errors with latest alpha 4 #46

mark007 opened this issue Oct 25, 2017 · 0 comments

Comments

@mark007
Copy link

mark007 commented Oct 25, 2017

Enhancement

As a user/developer, when I use asf-bootstrap alpha 4 with a schema with arrays of objects

Expected behaviour

I expected the form to validate

Actual behaviour

It actually see either "Required" error at the bottom of the form (which looks like tv4) or errors about Additional Fields depending on if I give default values or not.

Gist/Plunker/Demo

I'm not sure the easiest way to bring these in with plunker / gist so I have pasted the example schema below. Which has additionalProperties false for each object, and also does not have default values for some keys. Both of these cause me to not be able to get a valid form.

{ "$schema": "http://json-schema.org/draft-06/schema#", "additionalProperties": false, "type": "object", "properties": { "vms": { "type": "array", "items": { "additionalProperties": false, "type": "object", "properties": { "hostname": { "description": "This must be a valid hostname", "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$", "type": "string" }, "users": { "additionalProperties": false, "type": "object", "properties": { "username": { "type": "string", "default": "admin" }, "password": { "type": "string", "default": "admin" }, "type": { "type": "string", "default": "admin" } }, "required": [ "username", "password", "type" ] }, "active": { "title": "Active", "type": "boolean", "default": false } }, "required": [ "ip", "hostname", "active", "users" ] } } }, "required": [ "vms" ] }

@json-schema-form/angular-schema-form-bootstrap-lead

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

No branches or pull requests

1 participant