-
Notifications
You must be signed in to change notification settings - Fork 181
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
ERROR Error: schema is invalid: data/properties/form should be object,boolean #29
Comments
Thank you for using the library. Can you please post the json schema you used to reproduce the issue? |
It was the Hack: Conditions one from the examle. |
{
"schema": {
"type": "object",
"properties": {
"commentary": {
"title": "commentary",
"type": "string",
},
"depCommentary": {
"title": "dependant commentary",
"type": "integer"
},
"notDisplayedcommentary": {
"title": "this commentary will not be displayed no matter what",
"type": "string",
},
},
"required": [
]
},
"form": [
{
"type": "help",
"helpvalue": "<p>This is a work around to use conditions in <b>angular6-json-schema-form</b>. </br> Schema Form does not support oneOf (yet), but you can do a workaround and simulate certain scenarios with 'condition' and 'required' (and/or 'readonly') in the form.</p>"
},
"commentary",
{
"key": "depCommentary",
"condition": "model.commentary",
"required": true
},
{
"key": "depCommentary",
"condition": "!model.commentary"
},
{
"type": "submit",
"style": "btn-info",
"title": "OK"
}
]
} This is only a workaround & doesn't abide by the rules of the Json schema drafts. You still need to use the object "form", where you need to specify the content of you HTML form. In the example above you can see I added the key "commentary". This means that the field "commentary" will be displayed by default. "notDisplayedcommentary" will not be displayed because it doesn't exist in the "form" object. As for "depCommentary", it will display but depending on the condition if "commentary" is not undefined. |
Describe the bug
which template:
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
![image](https://user-images.githubusercontent.com/31612406/47087795-36cba380-d21d-11e8-8e08-6f4aceed5a73.png)
Desktop (please complete the following information):
Log output covering before error and any error statements
Detailed Description
Context
Possible Implementation
The text was updated successfully, but these errors were encountered: