Umlaute, fix
This commit is contained in:
@@ -12,26 +12,18 @@ namespace AICore.Context.SummaryParser
|
||||
{
|
||||
internal class JsonContextSummaryParser : BaseContextSummaryParser
|
||||
{
|
||||
private readonly JsonSerializerOptions JsonOptions = new JsonSerializerOptions()
|
||||
{
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
|
||||
IncludeFields = true,
|
||||
};
|
||||
|
||||
public override string Parse(AiActionType actionType, IContextSummary context)
|
||||
{
|
||||
var options = new JsonSerializerOptions { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, IncludeFields = true };
|
||||
if (context is null)
|
||||
return "{}";
|
||||
|
||||
var json = "{}";
|
||||
|
||||
if(context is ServiceRecordDocumantationFCS fcs)
|
||||
{
|
||||
json = JsonSerializer.Serialize(fcs, options);
|
||||
}
|
||||
else if(context is ServiceRecordNavigationCS ncs)
|
||||
{
|
||||
json = JsonSerializer.Serialize(ncs, options);
|
||||
}
|
||||
else
|
||||
{
|
||||
json = JsonSerializer.Serialize(context, options);
|
||||
}
|
||||
|
||||
return json;
|
||||
return JsonSerializer.Serialize(context, context.GetType(), JsonOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user