Skip to content

Commit 01f16e5

Browse files
authored
Expose Elasticsearch error serialization context so it can be combined with upstream contexts (#160)
1 parent 1242db8 commit 01f16e5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information
4+
5+
using System.Text.Json;
6+
using System.Text.Json.Serialization;
7+
using System.Text.Json.Serialization.Metadata;
8+
9+
namespace Elastic.Transport.Products.Elasticsearch;
10+
11+
/// Adds support for serializing Elasticsearch errors using <see cref="IJsonTypeInfoResolver"/>
12+
[JsonSerializable(typeof(Error))]
13+
[JsonSerializable(typeof(ErrorCause))]
14+
public partial class ErrorSerializerContext : JsonSerializerContext;

0 commit comments

Comments
 (0)