You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure you are able to repro it on the latest version
Search the existing issues.
Steps to reproduce
As part of #291, discovered that if you have a schema that limits property values (like OSInfo resource), then you can't use an expression that would resolve to a valid value since schema validation happens before expression execution.
Expected behavior
Expressions should be executed before schema is validated
Actual behavior
Schema is validated before expression execution
Error details
No response
Environment data
NA
Version
dsc 3.0.0-alpha.5
Visuals
No response
The text was updated successfully, but these errors were encountered:
This is an interesting problem, because we don't have control over the JSON schemas for the resources, and we do want to pre-validate as much as possible. I think we need to update the implementation so that it always accepts a valid expression for a value in the pre-validation phase, and always re-validates the property bag before calling the resource (optimally, only if it uses an expression, instead of double-validating static values) itself.
I'm not sure how to do that in a way that will work with general schema validation tooling except to define a dialect for the schema to use. I bring this up mostly because of the authoring experience - I'm not sure I see a way to avoid errors and warnings when authoring a configuration without the schema itself supporting the use of expressions in place of validated values.
I would certainly prefer a way to perform static validation before we run any code, but dynamically modifying resource schema seems like a recipe for disaster. For now, my intent is to perform validation after expression invocation before calling the resource, but that means resources may run but validation can fail later leaving in an undesired state.
Prerequisites
Steps to reproduce
As part of #291, discovered that if you have a schema that limits property values (like OSInfo resource), then you can't use an expression that would resolve to a valid value since schema validation happens before expression execution.
Expected behavior
Expressions should be executed before schema is validated
Actual behavior
Schema is validated before expression execution
Error details
No response
Environment data
Version
dsc 3.0.0-alpha.5
Visuals
No response
The text was updated successfully, but these errors were encountered: