Skip to content

Handle non-optional nullable type #72

Open
@nrigaudiere

Description

@nrigaudiere

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>) a null 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions