Skip to content

Commit c47de21

Browse files
[Network] Fix for issue Azure#46767 (Azure#47527)
* Fix and add test * Update CHANGELOG.md * Update Azure.ResourceManager.Network.csproj * Update UnitTest.cs * Update sdk/network/Azure.ResourceManager.Network/tests/Tests/UnitTest.cs Co-authored-by: Dapeng Zhang <[email protected]> * Update sdk/network/Azure.ResourceManager.Network/tests/Tests/UnitTest.cs Co-authored-by: Dapeng Zhang <[email protected]> --------- Co-authored-by: Dapeng Zhang <[email protected]>
1 parent 1eaa696 commit c47de21

File tree

6 files changed

+434
-1
lines changed

6 files changed

+434
-1
lines changed

sdk/network/Azure.ResourceManager.Network/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bugs Fixed
1010

11+
- Fixed an issue that the `AzureFirewallIPGroups` can't handle number type `ChangeNumber`.
12+
1113
### Other Changes
1214

1315
## 1.10.0-beta.1 (2024-12-11)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System.Runtime.CompilerServices;
7+
using System.Text.Json;
8+
using Azure.Core;
9+
10+
namespace Azure.ResourceManager.Network.Models
11+
{
12+
// This is a fix for issue: https://github.com/Azure/azure-sdk-for-net/issues/46767
13+
[CodeGenSerialization(nameof(ChangeNumber), DeserializationValueHook = nameof(DeserializeNumberValue))]
14+
public partial class AzureFirewallIPGroups
15+
{
16+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
17+
private static void DeserializeNumberValue(JsonProperty property, ref string changeNumber)
18+
{
19+
changeNumber = property.Value.ValueKind == JsonValueKind.Number ? property.Value.GetUInt64().ToString() : property.Value.GetString();
20+
}
21+
}
22+
}

sdk/network/Azure.ResourceManager.Network/src/Generated/Models/AzureFirewallIPGroups.Serialization.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/network/Azure.ResourceManager.Network/tests/Azure.ResourceManager.Network.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<None Update="TestData\VmssDeploymentTemplateAsync.json">
1818
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1919
</None>
20+
<None Update="TestData\ServiceTags.json">
21+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
22+
</None>
2023
</ItemGroup>
2124
<ItemGroup>
2225
<Compile Include="$(TestFrameworkSupportFiles)" LinkBase="Shared\TestFramework" />

0 commit comments

Comments
 (0)