You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's because you're giving the method a string. This method and its overrides take objects and give the JsonElement equivalent of the object. It is not a shortcut for parsing or deserialization.
To get an empty array, use new JsonElement[].ToJsonElement(). This will give a single element containing an empty JSON array.
Describe the bug
"[]".AsJsonElement() will not return as array. It will return as a string;
To Reproduce
"[]".AsJsonElement() != JsonDocument.Parse("[]").RootElement
Expected behavior
A clear and concise description of what you expected to happen.
It should be a json array
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: