Closed jrandolf-2 closed 1 year ago
Even with the fix here, if I tried to pass { tiltX: 1.234 }
, would it also match AngleProperties
and therefore match the type union? If that's the case, removing ranges is not addressing the root cause, so I agree with @OrKoN we should try to fix it completely.
I don't know what is the best solution to fix it, I would prefer to get feedback from @jgraham here.
Even with the fix here, if I tried to pass
{ tiltX: 1.234 }
, would it also matchAngleProperties
and therefore match the type union? If that's the case, removing ranges is not addressing the root cause, so I agree with @OrKoN we should try to fix it completely.I don't know what is the best solution to fix it, I would prefer to get feedback from @jgraham here.
With the fix here, tiltX will match TiltProperties, therefore implementations can validate tiltX independently during performActions.
Although the ranges for
AngleProperties
andTiltProperties
are correct, adding them to the schema creates the incorrect type.More specifically, for a given value, the type union will match the value if the value matches any of the productions in the union. In particular, if the value is
{tiltX: 91}
, value will not matchTiltProperties
, but it will matchAngleProperties
.Preview | Diff