Open stelcheck opened 6 years ago
If you know the property names of hello, then make it a class.
class NestedParentClass {
prop1: NestedClass;
prop2: NestedClass;
}
class Something {
public hello: NestedParentClass;
}
In this case, I would not know the names. I want to use an anonymous object as a key-value store but still validate the entries (and, eventually, the keys).
I am not an expert in class-validator but as much as I know this is not possible yet.
I already have a prototype that does just what I want, except that there is no documentation on how to create custom validators for nested data. From what I could see in the code, dealing with nesting is hard-coded in this code base.
I would like to create a decorator that deals with nested values.
Essentially:
How could I potentially approach that?