From 56dea23275889bd31f72c65157d6ee7c6fa9f9f3 Mon Sep 17 00:00:00 2001 From: Oleg Shevchenko Date: Thu, 11 Apr 2024 10:39:37 +0300 Subject: [PATCH] Fix JSON serialization in BranchRestriction model Changed the 'BranchType' property in the BranchRestriction model to now be nullable, and to ignore default values when serializing using JsonProperty. This change helps to better handle cases where the 'branch_type' field might not be set. --- src/Bitbucket.Cloud.Net/Models/v2/BranchRestriction.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bitbucket.Cloud.Net/Models/v2/BranchRestriction.cs b/src/Bitbucket.Cloud.Net/Models/v2/BranchRestriction.cs index f2ab67c..9c76614 100644 --- a/src/Bitbucket.Cloud.Net/Models/v2/BranchRestriction.cs +++ b/src/Bitbucket.Cloud.Net/Models/v2/BranchRestriction.cs @@ -20,9 +20,9 @@ public class BranchRestriction public IEnumerable Groups { get; set; } - [JsonProperty("branch_type")] + [JsonProperty("branch_type", DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonConverter(typeof(BranchTypesConverter))] - public BranchTypes BranchType { get; set; } + public BranchTypes? BranchType { get; set; } public string Type { get; set; } public int Id { get; set; }