Extend the default ConfigValidator.cs
What should we add or change to make your life better?
The current ConfigValidator is an internal class, which means we cannot use it in our code.
When we try to implement our own validation logic, we have to replace the IConfigValidator with our own implementation.
What we want is:
- Utilize the default validator to perform a set of default validation.
- Add our extra validation code.
If the ConfigValidator is a public class, we can wrap it inside our own validator implementation.
Why is this important to you?
We do our validation in a Config Filter that we must ensure we register last. While it technically works, its brittle due to the ordering and feels like a misuse when there could be an extension point. I looked at IConfigurationValidator but the default internal one does a lot so replacing it outright would have it's own problems. Would definitely appreciate some sort of extension point meant explicitly for validation that gets called by the built-in config validator.
Can you give examples of the config validations you'd like to add? Transforms for example have extensibility built into the validator.
In our case, we added some Metadata and will use it at runtime. As Metadata itself is a simple text-text key value dict, we want to ensure there is no obvious error in it, like a typo or some required metadata is missing.
@Tratcher thanks for mentioning the validate function in the ITransformProvider. I did not notice that type before.
It looks good for most of our requirement. But in our case, we still want to do some metadata cross validation between routes and clusters. The two validate functions from the transform provider can only validate one part at one time, but not both together.
Validating metadata makes sense, that's one of the only fields not already checked by the validator.
Triage: Sounds like reasonable request, adding to Backlog.