Closed zgrannan closed 1 year ago
Json.parse(String)
is intended for JSON structures only – i.e., JsonObject
and JsonArray
. Although not expressly stated, see return type for Json in scaladoc.
That said, I will consider changing the implementation to parse any JSON value... and will most certainly update the documentation.
Much thanks for your input.
The scaladoc for all parse methods is updated. An annotation is applied indicating that JsonParserError
is thrown if argument cannot be parsed to JSON structure. See commit 9fc45204f1e644cdbf9af00b90f7542b7ce52eeb.
No enhancement is applied to parse other JSON values.
It appears that attempt to parse a string literal (not enclosed in an object), leads to an error:
yields