"ClientEval:" causes validation errors in the configuration
#3,145 创建于 2020年10月26日
仓库指标
- 星标
- (267 个星标)
- PR 合并指标
- (PR 指标待抓取)
描述
Description
I recently saw that my current Neos project complained about several validation errors, regarding my NodeTypes configuration. This was the error I received for some properties of a custom NodeType:
None of the given schemas null,dictionary matched array
Which confused me a lot, as the corresponding configuration was perfectly valid.
After some testing I now discovered, that this is due to the usage of ClientEval:... in the configuration.
I'm utilizing that feature to make use of "dependent properties" for a complex NodeType. Removing the dynamic configuration, the errors disappear immediately.
This applies to the CLI command configuration:validate as well as for the "Configuration" backend module inside the UI.
This problem seems to occur only inside any property configuration of a NodeType, outside of that it doesn't seem to be a thing. Also this always causes the entire property to become seemingly invalid, not just the key where I make use of it.
I think the validator itself misinterprets dynamic values to some extend and therefore assumes a malformed structure for the property definition. My guess would be that the contained colons confuse the parser, but I'm not really sure about that, it's just a sudden assumption.
Steps to Reproduce
- Create a NodeType with two arbitrary properties
- Make one property visibility depend on the other using
ClientEval:with a ternary operation - Run the
configuration:validatecommand from the Flow CLI
It is possible to reproduce the issue with other property settings as well though, not just with ui.hidden.
Expected behavior
The validator should not raise errors for valid configuration files. Otherwise, if this is technically difficult to distinguish, I'd like to be able to turn these warnings off, at least for the UI.
Actual behavior
The validation fails with a message of the following form:
X errors were found:
- NodeTypes.Vendor.Site:NodeType.property.name -> None of the given schemas null,dictionary matched array
- ...
In addition, the same errors are shown each time the "Configuration" backend module is accessed.
Affected Versions
Neos: v5.3.0
Flow: v6.3.1