Skip to content

Commit

Permalink
fix Unsafe Tyehandling issue (#1165)
Browse files Browse the repository at this point in the history
* fix #pragma warning disable CA2327

* Update test/Integration/test-csharp/Startup.cs

Co-authored-by: Charles Gagnon <[email protected]>

* remove TypeNameHandling

---------

Co-authored-by: Charles Gagnon <[email protected]>
  • Loading branch information
MaddyDev and Charles-Gagnon authored Feb 5, 2025
1 parent 2c606fd commit 6697e7b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/Integration/test-csharp/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
#pragma warning disable CA2327 // Test code, safe to ignore
// Set default settings for JsonConvert to simulate a user doing the same in their function.
// This will cause test failures if serialization/deserialization isn't done correctly
// (using the helper methods in Utils.cs)
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
var settings = new JsonSerializerSettings
{
Formatting = Formatting.Indented,
TypeNameHandling = TypeNameHandling.Objects,
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
#pragma warning restore CA2327
JsonConvert.DefaultSettings = () => settings;
}
}
}
Expand Down

0 comments on commit 6697e7b

Please sign in to comment.