Closed marstamm closed 8 months ago
I tried this out and it seems that the implementation sets the value like "feel: static":
Further edits add the equal sign in the front of expression =
Consider moving test templates to test/spec/fixtures
so that they are accessible via npm start
script.
Alternatively, we could force the template developers to set value
to expression if feel
is set to required
.
Something like:
{
"if" {
"required": [ "feel" ]
"properties": {
"feel": {
"const": "required"
}
}
},
"then": {
"properties": {
"value": {
"type": "string",
"pattern": "^="
}
}
}
}
IMO, we should not do magic to default values as well, it is confusing enough as it is. If you are using feel: required
, the default value should be a feel expression. This fix is to prevent blowing up the editor when an unexpected value is provided.
I think we should add this check to the schema as well
Will you add this to the JSON schema then? It will make the test case invalid.
Yes, I will add the JSON schema
I removed the previous implementation since it is now enforced via the schema. It would have made more sense to do the type casting at the lower level code editor implementation anyway.
closes #70