-
Notifications
You must be signed in to change notification settings - Fork 370
Closed
Labels
analyzer 👓A new analyzer being implemented or updatedA new analyzer being implemented or updatedby designSome behavior that is intended and not an issueSome behavior that is intended and not an issuemvvm-toolkit 🧰Issues/PRs for the MVVM ToolkitIssues/PRs for the MVVM Toolkit
Description
Describe the bug
Using this, the property is not populated with the json value.
[ObservableProperty]
[property: JsonPropertyName("from_uuid")]
[property: JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
private string? fromUuid;However, if I write it manually it works.
[JsonPropertyName("from_uuid")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? FromUuid
{
get => fromUuid;
set
{
if (!EqualityComparer<string?>.Default.Equals(fromUuid, value))
{
fromUuid = value;
OnPropertyChanged(nameof(FromUuid));
}
}
}
private string? fromUuid;Regression
No response
Steps to reproduce
See description above. Use source-generation based serialization rather than reflection.
Expected behavior
I would expect it to deserialize. Not sure if it's Mvvm issue or System.Text.Json. But reported it here.
Screenshots
No response
IDE and version
VS 2022
IDE version
No response
Nuget packages
- CommunityToolkit.Common
- CommunityToolkit.Diagnostics
- CommunityToolkit.HighPerformance
- CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)
8.2.2
Additional context
Probably serialization also doesn't work.
Help us help you
No, just wanted to report this
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
analyzer 👓A new analyzer being implemented or updatedA new analyzer being implemented or updatedby designSome behavior that is intended and not an issueSome behavior that is intended and not an issuemvvm-toolkit 🧰Issues/PRs for the MVVM ToolkitIssues/PRs for the MVVM Toolkit