If I have a startval that is invalid, I the form will:
Load with a validation, even if show_errors: "never" is set
Render any root key, required objects uneditable.
Example
Schema
{
"type": "object",
"properties": {
"clientId": {
"type": "string",
"description": "The api key that identifies your client.",
"required": true,
"location": "query"
},
"id": {
"description": "The uuid for this deal",
"format": "uuid",
"required": true,
"location": "url",
"type": "string"
},
"deal": {
"description": "Deal data",
"required": true,
"properties": {
"id": {
"description": "The uuid for this deal",
"format": "uuid",
"type": "string"
}
},
"type": "object"
}
}
}
startval
{
"clientId": "1234-foobar"
}
Initial Rendering
I think this is not specific to startval, but more-so to how setValue works. I suspected it was an undefined vs {}, but have not had any luck poking through the source code.
Am I doing something wrong? Is it possible to set one default parameter, without clearing out all the other fields?
In your example schema, deal.id is not required, so it is not displayed by default when it's missing in the JSON value you set. Adding required: true will fix it.
Issue
If I have a startval that is invalid, I the form will:
show_errors: "never"
is setExample
Schema
startval
Initial Rendering
I think this is not specific to startval, but more-so to how setValue works. I suspected it was an
undefined
vs{}
, but have not had any luck poking through the source code.Am I doing something wrong? Is it possible to set one default parameter, without clearing out all the other fields?
PS - this tool rocks. Thank you thank you.