-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ksqlDB.RestApi.Client]: added HasColumnName to Fluent API for custom…
…izing column names
- Loading branch information
1 parent
910042c
commit 37845cc
Showing
16 changed files
with
190 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
ksqlDb.RestApi.Client/KSql/RestApi/Json/JsonTypeInfoResolver.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization.Metadata; | ||
|
||
namespace ksqlDb.RestApi.Client.KSql.RestApi.Json | ||
{ | ||
internal class JsonTypeInfoResolver(IJsonTypeInfoResolver typeInfoResolver) : IJsonTypeInfoResolver | ||
{ | ||
private readonly IJsonTypeInfoResolver typeInfoResolver = typeInfoResolver ?? throw new ArgumentNullException(nameof(typeInfoResolver)); | ||
|
||
public IList<Action<JsonTypeInfo>> Modifiers => modifiers ??= new List<Action<JsonTypeInfo>>(); | ||
private IList<Action<JsonTypeInfo>>? modifiers; | ||
|
||
public virtual JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options) | ||
{ | ||
var typeInfo = typeInfoResolver.GetTypeInfo(type, options); | ||
|
||
if (modifiers != null) | ||
{ | ||
foreach (Action<JsonTypeInfo> modifier in modifiers) | ||
{ | ||
modifier(typeInfo); | ||
Check warning on line 21 in ksqlDb.RestApi.Client/KSql/RestApi/Json/JsonTypeInfoResolver.cs
|
||
} | ||
} | ||
|
||
return typeInfo; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.