JsonPropertyOrderAttribute
Specifies the property order that is present in the JSON when serializing. Lower values are serialized first.
If the attribute is not specified, the default value is 0.
namespace System.Text.Json.Serialization
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public sealed class JsonPropertyOrderAttribute : JsonAttribute
{
public int Order { get; }
public JsonPropertyOrderAttribute(int order)
{
Order = order;
}
}
}