diff --git a/libraries/src/AWS.Lambda.Powertools.Parameters/Internal/Transform/JsonTransformer.cs b/libraries/src/AWS.Lambda.Powertools.Parameters/Internal/Transform/JsonTransformer.cs
index 36f19a46..136f889f 100644
--- a/libraries/src/AWS.Lambda.Powertools.Parameters/Internal/Transform/JsonTransformer.cs
+++ b/libraries/src/AWS.Lambda.Powertools.Parameters/Internal/Transform/JsonTransformer.cs
@@ -23,12 +23,31 @@ namespace AWS.Lambda.Powertools.Parameters.Internal.Transform;
///
internal class JsonTransformer : ITransformer
{
+ private readonly JsonSerializerOptions _options;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public JsonTransformer()
+ {
+ _options = new JsonSerializerOptions
+ {
+ PropertyNameCaseInsensitive = true
+ };
+ }
+
///
/// Deserialize a JSON value from a JSON string.
///
/// JSON string.
/// JSON value type.
/// JSON value.
+#if NET6_0_OR_GREATER
+ [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode",
+ Justification = "Types are expected to be known at compile time")]
+ [System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
+ Justification = "Types are expected to be preserved")]
+#endif
public T? Transform(string value)
{
if (typeof(T) == typeof(string))
@@ -37,6 +56,6 @@ internal class JsonTransformer : ITransformer
if (string.IsNullOrWhiteSpace(value))
return default;
- return JsonSerializer.Deserialize(value);
+ return JsonSerializer.Deserialize(value, _options);
}
}
\ No newline at end of file
diff --git a/libraries/tests/AWS.Lambda.Powertools.Parameters.Tests/AppConfig/AppConfigProviderTest.cs b/libraries/tests/AWS.Lambda.Powertools.Parameters.Tests/AppConfig/AppConfigProviderTest.cs
index 8c664e4e..1577b5b2 100644
--- a/libraries/tests/AWS.Lambda.Powertools.Parameters.Tests/AppConfig/AppConfigProviderTest.cs
+++ b/libraries/tests/AWS.Lambda.Powertools.Parameters.Tests/AppConfig/AppConfigProviderTest.cs
@@ -13,6 +13,7 @@
* permissions and limitations under the License.
*/
+using System.Diagnostics.CodeAnalysis;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
@@ -32,6 +33,7 @@
namespace AWS.Lambda.Powertools.Parameters.Tests.AppConfig;
+[SuppressMessage("Usage", "xUnit1030:Do not call ConfigureAwait(false) in test method")]
public class AppConfigProviderTest
{
[Fact]