Change the default ignore condition for serializer #152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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>
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