From e0711c73ed36842865aa8a40a774c8babb2a7ecf Mon Sep 17 00:00:00 2001 From: Hogne Vevle Date: Tue, 28 Sep 2021 14:06:43 +0200 Subject: [PATCH] Add StringEnumConverter --- Src/Notion.Client/Api/Search/Parameters/SearchFilter.cs | 6 +++++- Src/Notion.Client/Api/Search/Parameters/SearchSort.cs | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Src/Notion.Client/Api/Search/Parameters/SearchFilter.cs b/Src/Notion.Client/Api/Search/Parameters/SearchFilter.cs index 1b8b5500..cc84a9a3 100644 --- a/Src/Notion.Client/Api/Search/Parameters/SearchFilter.cs +++ b/Src/Notion.Client/Api/Search/Parameters/SearchFilter.cs @@ -1,7 +1,11 @@ -namespace Notion.Client +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Notion.Client { public class SearchFilter { + [JsonConverter(typeof(StringEnumConverter))] public SearchObjectType Value { get; set; } public string Property => "object"; } diff --git a/Src/Notion.Client/Api/Search/Parameters/SearchSort.cs b/Src/Notion.Client/Api/Search/Parameters/SearchSort.cs index 7e1189a6..5cc4bbfd 100644 --- a/Src/Notion.Client/Api/Search/Parameters/SearchSort.cs +++ b/Src/Notion.Client/Api/Search/Parameters/SearchSort.cs @@ -1,11 +1,11 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace Notion.Client { public class SearchSort { + [JsonConverter(typeof(StringEnumConverter))] public SearchDirection Direction { get; set; } public string Timestamp { get; set; }