Current behavior
Even when explicitly setting JsonSerializerOptions with ReadCommentHandling = JsonCommentHandling.Skip, deserializing a JSON that contains comments throws an exception saying that / is an invalid start of a property name.
Expected behavior
The provided JsonSerializerOptions should respected and skip comments in the JSON when ReadCommentHandling is set to Skip.
How to reproduce it (as minimally and precisely as possible)
- Create a minimal Uno app with
Serialization
- Use
serializer.FromString<T>(json) with JsonSerializerOptions { ReadCommentHandling = JsonCommentHandling.Skip }.
- Pass a JSON string or file that contains comments (e.g.,
// this is a comment).
- Observe that an exception is thrown despite the
ReadCommentHandling setting.
You can find a minimal repro project attached.
serialization.zip
Environment
"Uno.Sdk": "6.0.146"
"Uno.Sdk": "6.2.0-dev.16"
Affected platform(s): I have only tested Skia, WinAppSdk and WASM, but I assume it occurs everywhere.
Visual Studio:
Relevant plugins:
Anything else we need to know?
Current behavior
Even when explicitly setting
JsonSerializerOptionswithReadCommentHandling = JsonCommentHandling.Skip, deserializing a JSON that contains comments throws an exception saying that/is an invalid start of a property name.Expected behavior
The provided
JsonSerializerOptionsshould respected and skip comments in the JSON whenReadCommentHandlingis set toSkip.How to reproduce it (as minimally and precisely as possible)
Serializationserializer.FromString<T>(json)withJsonSerializerOptions { ReadCommentHandling = JsonCommentHandling.Skip }.// this is a comment).ReadCommentHandlingsetting.You can find a minimal repro project attached.
serialization.zip
Environment
"Uno.Sdk": "6.0.146"
"Uno.Sdk": "6.2.0-dev.16"
Affected platform(s): I have only tested Skia, WinAppSdk and WASM, but I assume it occurs everywhere.
Visual Studio:
Relevant plugins:
Anything else we need to know?