Possible values of empty json

An empty string is not a valid json;

string json = "";

While an empty string is not valid JSON two quotes is valid JSON. This is an important distinction.

Which is to say a string that contains two quotes is not the same thing as an empty string.

string json = "{}";
string json = "[]";

Valid minimal JSON strings are

The empty object '{}'

The empty array '[]'

The string that is empty '""'

A number e.g. '123.4'

The boolean value true 'true'

The boolean value false 'false'

The null value 'null'

Resource

https://stackoverflow.com/questions/30621802/why-does-json-parse-fail-with-the-empty-string

FavoriteLoadingAdd to favorites
Spread the love

Author: Shahzad Khan

Software developer / Architect