forked from EllieBotDevs/elliebot
15 lines
No EOL
426 B
C#
15 lines
No EOL
426 B
C#
#nullable disable
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
namespace EllieBot.Common;
|
|
|
|
public class RequireObjectPropertiesContractResolver : DefaultContractResolver
|
|
{
|
|
protected override JsonObjectContract CreateObjectContract(Type objectType)
|
|
{
|
|
var contract = base.CreateObjectContract(objectType);
|
|
contract.ItemRequired = Required.DisallowNull;
|
|
return contract;
|
|
}
|
|
} |