-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Deserialize a JSON string with the property name had no quotes #74055
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsDescriptionWhen I try to deserialize a JSON string with the property name had no json sample: { CustomerId: "2929064f-1a22-4ece-947f-00eed7efed35"} Reproduction StepsDeserialize the previous JSON with system text json System.Text.Json.JsonSerializer.Deserialize<JsonObject>(json); Expected behaviorSuccess with Actual behaviorGot an exception likes follows:
Regression?No response Known WorkaroundsNo response Configuration.NET 6 Other informationNo response
|
relates to #32291 |
Property names lacking quotes is not valid JSON, but we might consider offering an optional flag that enables support. Closing as duplicate of #32291. |
Description
When I try to deserialize a JSON string with the property name had no
"
, it would throw an exception now, while it works withNewtonsoft.Json
Not sure if it's a problem, it may not a standard JSON
json sample:
{ CustomerId: "2929064f-1a22-4ece-947f-00eed7efed35"}
Reproduction Steps
Deserialize the previous JSON with system text json
Expected behavior
Success with
JsonObject
returnedActual behavior
Got an exception likes follows:
Regression?
No response
Known Workarounds
No response
Configuration
.NET 6
Other information
No response
The text was updated successfully, but these errors were encountered: