json-lenses icon indicating copy to clipboard operation
json-lenses copied to clipboard

Type conversion doesn't handle explicit nulls

Open ianp opened this issue 9 years ago • 3 comments

If I have a field which may be null then it blows up on extraction:

val json = """{ "url": null }""".parseJson
json.extract[String]("url".?)

This causes a runtime exception with root cause:

spray.json.DeserializationException: Expected String as JsString, but got null

Is this an issue with son-lenses, or am I doing something wrong (a strong possibility)?

ianp avatar Nov 19 '14 15:11 ianp