-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Arrays in SystemText #44
Conversation
@@ -14,25 +15,23 @@ private static object ToObject(this JsonElement jsonElement) | |||
case JsonValueKind.Null: return null; | |||
case JsonValueKind.String: return jsonElement.GetString(); | |||
case JsonValueKind.Number: return jsonElement.GetGenericNumber(); | |||
case JsonValueKind.Array: return jsonElement.EnumerateArray().Select(j => j.ToObject()).ToArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leads to an exception when an array contains complex objects. When ToObject
is called with such array element, it throws NotSupportedException.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did any of you manage to make some progress with this?
@OleksandrHorbunovVP what was the end solution that you used?
Currently working on a project where this would be useful but immediately hit this problem.
@Morcatko Can you please merge this? Currently, without this, you are completely unable to use [] or List in PATCH DTOs because the following exception occurs: "Unsupported ValueKind - Array" It seems your fix may at least work with primitive types which is more than enough in most cases. |
This will be part of 6.0.3 version. It fixes primitive types only |
No description provided.