Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made Boolean fields in IndexField null-able to match API so defaults can... #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/RedDog.Search/Http/ApiConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using RedDog.Search.Model.Internal;
Expand All @@ -32,6 +33,7 @@ internal ApiConnection(Uri baseUri, string apiKey, HttpClientHandler handler)
_formatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
_formatter.SerializerSettings.Converters.Add(new StringEnumConverter { CamelCaseText = true });
_formatter.SerializerSettings.Converters.Add(new XsdDurationConverter());
_formatter.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
}

public Uri BaseUri
Expand Down
14 changes: 7 additions & 7 deletions src/RedDog.Search/Model/IndexField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,50 +30,50 @@ public string Type
}

[JsonProperty("searchable")]
public bool Searchable
public bool? Searchable
{
get;
set;
}

[JsonProperty("filterable")]
public bool Filterable
public bool? Filterable
{
get;
set;
}

[JsonProperty("sortable")]
public bool Sortable
public bool? Sortable
{
get;
set;
}

[JsonProperty("facetable")]
public bool Facetable
public bool? Facetable
{
get;
set;
}

[ObsoleteAttribute("Consider using the suggesters property introduced in version 2014-10-20-Preview instead of this option for suggestions. In a future version the suggestions property will be deprecated in favor of using a separate suggesters specification.")]
[JsonProperty("suggestions")]
public bool Suggestions
public bool? Suggestions
{
get;
set;
}

[JsonProperty("key")]
public bool Key
public bool? Key
{
get;
set;
}

[JsonProperty("retrievable")]
public bool Retrievable
public bool? Retrievable
{
get;
set;
Expand Down