Description
using JsonSerializer.Serialize to Serialize object.
Reproduction Steps
using System.Text.Json;
using System.Text.Json.Serialization;
TestDto t = new() { Items = new() };
string jsonString = JsonSerializer.Serialize(t);
Console.WriteLine(jsonString);
public class TestDto
{
public string? Field1 { get; set; }
[JsonIgnore]
public required List<string> Items { get; set; }
}
Expected behavior
no exception
Actual behavior
exception throws
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Description
using JsonSerializer.Serialize to Serialize object.
Reproduction Steps
Expected behavior
no exception
Actual behavior
exception throws
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response