Open
Description
Some Web APIs says “This parameter is not optional, but can be set to null”.
jsruntime does not support this for now:
- a nullable parameter (ie.
?<Type>
) is translated as an optional parameter - and if you remove the nullable modifier (ie.
<Type>
) anull
value is not allowed
The easiest way to handle that would be to keep ?<Type>
for optional parameter and create custom type for mandatory nullable parameter <NullableType>
, eg. NullableNumber
or NullableNode
.
It’s a bit verbose but we can use a comptime function generator to help with that.
Maybe another solution is possible.