Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the default ignore condition for serializer #152

Merged
merged 3 commits into from
Jul 26, 2023

Conversation

dkovalenkoI
Copy link
Contributor

Summary

dotnet/UnloadUtil.cs(98,18) warning SYSLIB0020: 'JsonSerializerOptions.IgnoreNullValues' is obsolete

Description

Currently, during building .NET sample application warning messages are produced in the log files. This PR addresses this issue by changing default json configuration that uses in the latest versions of .Net

The following configuration was added to support ignore values.
{
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
};

Related Issue

awslabs#140

Tests performed / created

Following Tests has been executed manually:
.net Version - <3.0>

  • Navigate to folder for .NET sample app "sample_apps/dotnet"
  • Add all required dependency from README.md
  • Run the project with sample csv: dotnet run -- -f ../data/sample.csv
  • Check logs

Before Fix:

The following errors shown in logs:
/workspaces/amazon-timestream-tools/sample_apps/dotnet/UnloadUtil.cs(98,18): warning SYSLIB0020: 'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' [/workspaces/amazon-timestream-tools/sample_apps/dotnet/TimestreamDotNetSample.csproj]
/workspaces/amazon-timestream-tools/sample_apps/dotnet/QueryExample.cs(281,17): warning SYSLIB0020: 'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' [/workspaces/amazon-timestream-tools/sample_apps/dotnet/TimestreamDotNetSample.csproj]

After Fix:

No error messages in logs
JSON writer do not write null values

Additional Reviewers

@alexeytemnikov

@sethusrinivasan sethusrinivasan merged commit 749c535 into awslabs:mainline Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants