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

Remove obsolete custom service package code #3684

Merged
merged 7 commits into from
Mar 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix DynamoDB tests
  • Loading branch information
normj committed Mar 2, 2025
commit 238ab04944bad30ca10c10fea1ef2af8e0b4d842
Original file line number Diff line number Diff line change
@@ -367,6 +367,8 @@ public static string Interpolate(string template, Dictionary<string, object> ref
/// </summary>
public static string InterpolateJson(string json, Dictionary<string, object> refs)
{
if (string.IsNullOrEmpty(json))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this change to avoid the SDK generating a lot of JsonExceptions being thrown when an empty string is being sent in.

return string.Empty;
try
{
using JsonDocument doc = JsonDocument.Parse(json);
@@ -381,7 +383,7 @@ public static string InterpolateJson(string json, Dictionary<string, object> ref
}
catch (JsonException)
{
return "";
return string.Empty;
}
}

7 changes: 6 additions & 1 deletion sdk/src/Services/DynamoDBv2/Custom/AWSConfigs.DynamoDB.cs
Original file line number Diff line number Diff line change
@@ -57,6 +57,11 @@ static AWSConfigsDynamoDB()

#region DynamoDBContext TableNamePrefix

/// <summary>
/// Key for the DynamoDBContextTableNamePrefix property.
/// </summary>
public const string DynamoDBContextTableNamePrefixKey = "AWS.DynamoDBContext.TableNamePrefix";

#endregion

/// <summary>
@@ -171,7 +176,7 @@ public void AddMapping(TypeMapping typeMapping)

internal DynamoDBContextConfig()
{
this.TableNamePrefix = AWSConfigs.GetConfig(AWSConfigsDynamoDB.Context.TableNamePrefix);
this.TableNamePrefix = AWSConfigs.GetConfig(AWSConfigsDynamoDB.DynamoDBContextTableNamePrefixKey);

TableAliases = new Dictionary<string, string>(StringComparer.Ordinal);
TypeMappings = new Dictionary<Type, TypeMapping>();