Any particular reason `GsonSerializer.read` casts ...
# ktor
s
Any particular reason
GsonSerializer.read
casts deserialized json to
Any
? And not
Any?
?
I know it is not valid json to send a naked
null
but most support it regardless
Including Gson itself
b
Why isn't
null
valid JSON?? It's valid in RFC 8259 (Dec. 2017) and RFC 7159 (Mar. 2014)
A JSON text is a sequence of tokens. The set of tokens includes six structural characters, strings, numbers, and three literal names.
A JSON text is a serialized value. Note that certain previous specifications of JSON constrained a JSON text to be an object or an array.
...
A JSON value MUST be an object, array, number, or string, or one of the following three literal names:
false null true
See sections 2 and 3 https://tools.ietf.org/html/rfc8259#section-2
s
Copy code
Note that certain previous specifications of JSON constrained a JSON text to be an object or an
   array.
A bug it is then !