-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Description
Is there a way of handling a parameter that may be null?
To support a JSON that may come as:
{ "key": 2 }
or as
{ "key": null }
I already tried using Option this way:
type
Test = object
key: Option[int]
This works for the first JSON but the second one gives the following error
Error: unhandled exception: Number expected. At offset: 6 [JsonError]
Metadata
Metadata
Assignees
Labels
No labels