Skip to content

Commit

Permalink
fix: support preformatted json (JRaw) (#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Jul 27, 2022
1 parent 9d0c338 commit fa59bc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Algolia.Search/Clients/SearchIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ internal SearchIndex(HttpTransport transport, AlgoliaConfig config, string index
throw new ArgumentNullException(nameof(data));
}

if (data is IEnumerable && !(data is JObject))
if (data is IEnumerable && !(data is JObject) && !(data is JRaw))
{
throw new ArgumentException($"{nameof(data)} should not be an IEnumerable/List/Collection");
}
Expand Down Expand Up @@ -152,7 +152,7 @@ internal SearchIndex(HttpTransport transport, AlgoliaConfig config, string index
throw new ArgumentNullException(nameof(data));
}

if (data is IEnumerable && !(data is JObject))
if (data is IEnumerable && !(data is JObject) && !(data is JRaw)))
{
throw new ArgumentException($"{nameof(data)} should not be an IEnumerable/List/Collection");
}
Expand Down

0 comments on commit fa59bc0

Please sign in to comment.