Skip to content

Commit

Permalink
Merge pull request #194 from SainsburyWellcomeCentre/json-lines
Browse files Browse the repository at this point in the history
Set default camel case naming strategy
  • Loading branch information
glopesdev authored Dec 9, 2023
2 parents 3c78cc0 + c29c807 commit 338d0ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Aeon.Acquisition/Aeon.Acquisition.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PackageTags>Bonsai Rx Project Aeon Acquisition</PackageTags>
<TargetFramework>net472</TargetFramework>
<VersionPrefix>0.5.0</VersionPrefix>
<VersionSuffix>build231203</VersionSuffix>
<VersionSuffix>build231204</VersionSuffix>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 10 additions & 1 deletion src/Aeon.Acquisition/FormatJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Reactive.Linq;
using Bonsai;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Aeon.Acquisition
{
Expand All @@ -12,9 +13,17 @@ namespace Aeon.Acquisition
[WorkflowElementCategory(ElementCategory.Transform)]
public class FormatJson
{
static readonly JsonSerializerSettings DefaultSettings = new()
{
ContractResolver = new DefaultContractResolver
{
NamingStrategy = new CamelCaseNamingStrategy()
}
};

public IObservable<string> Process<TSource>(IObservable<TSource> source)
{
return source.Select(value => JsonConvert.SerializeObject(value));
return source.Select(value => JsonConvert.SerializeObject(value, DefaultSettings));
}
}
}

0 comments on commit 338d0ea

Please sign in to comment.