Open fugufish opened 3 weeks ago
The $$type
is a shorthand form for object validation schema.
Full schema:
const schema = {
point: {
type: "object",
properties: {
x: "number",
y: "number",
}
},
}
Shorthand:
const schema = {
point: {
$$type: "object",
x: "number",
y: "number",
},
}
The documentaiton is ambiguous about the difference between `type and $$type. For example this test on enum:
fails with the following result:
However this
falis with
this means that
$$type
andtype
are not interchangable.$$type
triggers the enum rule to be run, but the schema of the rule is changed causing it to throw an exception (i have a fix for that if needed), buttype
will not cause the rule to be run at all.What is the expected behavior?