Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"description": "Fix missing nullable annotations for collection properties in V4",
"versionBumpType": "patch",
"services": ["Core"],
"changelogEntry": "Fixed missing nullable reference type annotations for collection properties that can be null in V4. This enables proper compile-time null checking for Dictionary and List properties that use the AWSConfigs.InitializeCollections pattern."
}
4 changes: 2 additions & 2 deletions generator/ServiceClientGeneratorLib/Member.cs
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,11 @@ private string DetermineType(JsonData extendedData, bool treatEnumsAsString, boo
bool overrideMapTreatEnumsAsString = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ?? true;
var keyType = DetermineType(memberShape["key"], overrideMapTreatEnumsAsString, false);
var valueType = DetermineType(memberShape["value"], overrideMapTreatEnumsAsString, false);
return string.Format("Dictionary<{0}, {1}>", keyType, valueType);
return string.Format("Dictionary<{0}, {1}>{2}", keyType, valueType, nullable);
case "list":
bool overrideListTreatEnumsAsString = this.model.Customizations.OverrideTreatEnumsAsString(this.Extends) ?? true;
var listType = DetermineType(memberShape["member"], overrideListTreatEnumsAsString, false);
return string.Format("List<{0}>", listType);
return string.Format("List<{0}>{1}", listType, nullable);

case "decimal":
throw new Exception(UnhandledTypeDecimalErrorMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public partial class SendMessageBatchResponse : AmazonWebServiceResponse
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
/// </summary>
[AWSProperty(Required=true)]
public List<BatchResultErrorEntry> Failed
public List<BatchResultErrorEntry>? Failed
{
get { return this._failed; }
set { this._failed = value; }
Expand All @@ -76,7 +76,7 @@ internal bool IsSetFailed()
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
/// </summary>
[AWSProperty(Required=true)]
public List<SendMessageBatchResultEntry> Successful
public List<SendMessageBatchResultEntry>? Successful
{
get { return this._successful; }
set { this._successful = value; }
Expand Down
Loading