Skip to content

Commit ac2f4ba

Browse files
authored
Merge branch 'develop' into dependabot/github_actions/aws-actions/configure-aws-credentials-4.2.1
2 parents 894e51c + e994592 commit ac2f4ba

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

docs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# v9.1.18
2-
FROM squidfunk/mkdocs-material@sha256:f6c81d538499f5755c8d1486f0abcda50bb631be391890ef823fcba18803114a
2+
FROM squidfunk/mkdocs-material@sha256:eb04b60c566a8862be6b553157c16a92fbbfc45d71b7e4e8593526aecca63f52
33

44
COPY requirements.txt /tmp/
55
RUN pip install --require-hashes -r /tmp/requirements.txt

libraries/src/AWS.Lambda.Powertools.BatchProcessing/BatchProcessorAttribute.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
using System;
1717
using System.Collections.Generic;
18+
using System.Diagnostics.CodeAnalysis;
1819
using System.Linq;
1920
using System.Threading;
2021
using System.Threading.Tasks;
@@ -141,21 +142,25 @@ public class BatchProcessorAttribute : UniversalWrapperAttribute
141142
/// <summary>
142143
/// Type of batch processor.
143144
/// </summary>
145+
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
144146
public Type BatchProcessor { get; set; }
145147

146148
/// <summary>
147149
/// Type of batch processor provider.
148150
/// </summary>
151+
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
149152
public Type BatchProcessorProvider { get; set; }
150153

151154
/// <summary>
152155
/// Type of record handler.
153156
/// </summary>
157+
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
154158
public Type RecordHandler { get; set; }
155159

156160
/// <summary>
157161
/// Type of record handler provider.
158162
/// </summary>
163+
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
159164
public Type RecordHandlerProvider { get; set; }
160165

161166
/// <summary>

libraries/src/AWS.Lambda.Powertools.Parameters/Internal/Transform/JsonTransformer.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,31 @@ namespace AWS.Lambda.Powertools.Parameters.Internal.Transform;
2323
/// </summary>
2424
internal class JsonTransformer : ITransformer
2525
{
26+
private readonly JsonSerializerOptions _options;
27+
28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="JsonTransformer"/> class.
30+
/// </summary>
31+
public JsonTransformer()
32+
{
33+
_options = new JsonSerializerOptions
34+
{
35+
PropertyNameCaseInsensitive = true
36+
};
37+
}
38+
2639
/// <summary>
2740
/// Deserialize a JSON value from a JSON string.
2841
/// </summary>
2942
/// <param name="value">JSON string.</param>
3043
/// <typeparam name="T">JSON value type.</typeparam>
3144
/// <returns>JSON value.</returns>
45+
#if NET6_0_OR_GREATER
46+
[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode",
47+
Justification = "Types are expected to be known at compile time")]
48+
[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
49+
Justification = "Types are expected to be preserved")]
50+
#endif
3251
public T? Transform<T>(string value)
3352
{
3453
if (typeof(T) == typeof(string))
@@ -37,6 +56,6 @@ internal class JsonTransformer : ITransformer
3756
if (string.IsNullOrWhiteSpace(value))
3857
return default;
3958

40-
return JsonSerializer.Deserialize<T>(value);
59+
return JsonSerializer.Deserialize<T>(value, _options);
4160
}
4261
}

libraries/tests/AWS.Lambda.Powertools.Parameters.Tests/AppConfig/AppConfigProviderTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16+
using System.Diagnostics.CodeAnalysis;
1617
using System.Text;
1718
using System.Text.Json;
1819
using System.Text.Json.Nodes;
@@ -32,6 +33,7 @@
3233

3334
namespace AWS.Lambda.Powertools.Parameters.Tests.AppConfig;
3435

36+
[SuppressMessage("Usage", "xUnit1030:Do not call ConfigureAwait(false) in test method")]
3537
public class AppConfigProviderTest
3638
{
3739
[Fact]

0 commit comments

Comments
 (0)