I'm having problems properly validating classes with nested properties, I narrowed the problem to this test:
import { object, string, validateAsClass } from 'joiful';
it("should not throw", () => {
class A {
@object().keys({ c: string().required() }).strict()
b: { c: string; };
}
const obj = new A();
obj.b = { c: "hey" };
const { error } = validateAsClass(obj, A)
assert.isNull(error);
});
Instead of the error being empty it is [ValidationError: "b.c" failed custom validation because ] and it cuts of abruptly there, no stack trace, no other relevant info in the error object. Am I missing something?
I'm having problems properly validating classes with nested properties, I narrowed the problem to this test:
Instead of the error being empty it is
[ValidationError: "b.c" failed custom validation because ]
and it cuts of abruptly there, no stack trace, no other relevant info in the error object. Am I missing something?