Skip to content

Commit

Permalink
allow saving null to json
Browse files Browse the repository at this point in the history
  • Loading branch information
rrelyea committed Jun 27, 2024
1 parent 9f08bcd commit 530c73c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Shared/BrowserProfileUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public async Task Save(string? key, FamilyData? familyData)
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault,
IgnoreReadOnlyProperties = true,
WriteIndented = true,
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
Converters =
{
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase)
Expand Down Expand Up @@ -54,6 +55,7 @@ public async Task Load(IAppData appData)
StoredJson = await LocalStorageAccessor!.GetValueAsync<string>(appData.CurrentProfileName);
var options = new JsonSerializerOptions()
{
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
Converters =
{
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase)
Expand Down
2 changes: 1 addition & 1 deletion src.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "src", "src.csproj", "{28B10
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "api", "api\api.csproj", "{519B0E10-3FC1-4F2D-9A6D-EC465728C8E9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "library", "library\25XLibrary.csproj", "{EA2E6D14-91D2-4580-8994-A414F18DDDFF}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "library", "library\Folio.Library.csproj", "{EA2E6D14-91D2-4580-8994-A414F18DDDFF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

0 comments on commit 530c73c

Please sign in to comment.