diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs b/Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs index c3790709d..e3386a52f 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs @@ -47,7 +47,7 @@ namespace Flow.Launcher.Core.Plugin public abstract List LoadContextMenus(Result selectedResult); - protected static readonly JsonSerializerOptions options = new() + protected static readonly JsonSerializerOptions DeserializeOption = new() { PropertyNameCaseInsensitive = true, #pragma warning disable SYSLIB0020 @@ -63,13 +63,11 @@ namespace Flow.Launcher.Core.Plugin } }; - private static readonly JsonSerializerOptions settingSerializeOption = new() + protected static readonly JsonSerializerOptions RequestSerializeOption = new() { - WriteIndented = true + PropertyNameCaseInsensitive = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase, }; - private readonly Dictionary _settingControls = new(); - protected abstract Task ExecuteResultAsync(JsonRPCResult result); protected abstract Task> QueryRequestAsync(JsonRPCRequestModel request, CancellationToken token); diff --git a/Flow.Launcher.Core/Plugin/PythonPlugin.cs b/Flow.Launcher.Core/Plugin/PythonPlugin.cs index 4aea1ee29..fbe5edc7c 100644 --- a/Flow.Launcher.Core/Plugin/PythonPlugin.cs +++ b/Flow.Launcher.Core/Plugin/PythonPlugin.cs @@ -39,7 +39,7 @@ namespace Flow.Launcher.Core.Plugin protected override Task RequestAsync(JsonRPCRequestModel request, CancellationToken token = default) { - _startInfo.ArgumentList[2] = JsonSerializer.Serialize(request); + _startInfo.ArgumentList[2] = JsonSerializer.Serialize(request, RequestSerializeOption); return ExecuteAsync(_startInfo, token); } @@ -47,7 +47,7 @@ namespace Flow.Launcher.Core.Plugin protected override string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default) { // since this is not static, request strings will build up in ArgumentList if index is not specified - _startInfo.ArgumentList[2] = JsonSerializer.Serialize(rpcRequest); + _startInfo.ArgumentList[2] = JsonSerializer.Serialize(rpcRequest, RequestSerializeOption); _startInfo.WorkingDirectory = Context.CurrentPluginMetadata.PluginDirectory; // TODO: Async Action return Execute(_startInfo);