Skip to content

Commit f2fa136

Browse files
authored
Apply IJsonmodel<> changes from Azure.Core (#5347)
1 parent cbcb3ba commit f2fa136

File tree

444 files changed

+3519
-3120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

444 files changed

+3519
-3120
lines changed

Packages.Data.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737

3838
<!-- All csproj dependencies. -->
3939
<ItemGroup>
40-
<PackageReference Update="Azure.Core" Version="1.46.1" />
40+
<PackageReference Update="Azure.Core" Version="1.47.0" />
4141
<PackageReference Update="Azure.Core.Experimental" Version="0.1.0-preview.18" />
4242
<PackageReference Update="Azure.Core.Expressions.DataFactory" Version="1.0.0" />
43-
<PackageReference Update="Azure.ResourceManager" Version="1.13.0" />
43+
<PackageReference Update="Azure.ResourceManager" Version="1.14.0-beta.1" />
4444
<PackageReference Update="CommandLineParser" Version="2.9.1" />
4545
<PackageReference Update="Humanizer.Core" Version="2.13.14" />
4646
<PackageReference Update="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
@@ -49,7 +49,7 @@
4949
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" />
5050
<PackageReference Update="NuGet.Configuration" Version="6.8.0" />
5151
<PackageReference Update="NUnit" Version="3.13.2" />
52-
<PackageReference Update="System.ClientModel" Version="1.4.1" />
52+
<PackageReference Update="System.ClientModel" Version="1.5.0" />
5353
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
5454
<PackageReference Update="System.Memory" Version="4.5.4" />
5555
<PackageReference Update="System.Text.Json" Version="8.0.5" />

eng/DownloadSharedSource.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Get-ChildItem $destinationPath -Filter *.cs | Remove-Item;
8585
CopyAll $files $sourcePath $destinationPath
8686

8787
#Download management Shared
88-
$files = 'SharedExtensions.cs', 'ManagedServiceIdentityTypeV3Converter.cs'
88+
$files = 'SharedExtensions.cs'
8989
$sourcePath = "$clonedPath/sdk/resourcemanager/Azure.ResourceManager/src/Shared"
9090
$destinationPath = "$repoRoot/src/assets/Management.Shared"
9191

eng/scripts/Download-SharedSource.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ CopyAll $files $sourcePath $destinationPath
9494

9595
#Download management Shared
9696
$files = @(
97-
'SharedExtensions.cs',
98-
'ManagedServiceIdentityTypeV3Converter.cs'
97+
'SharedExtensions.cs'
9998
)
10099

101100
$sourcePath = "$clonedPath/sdk/resourcemanager/Azure.ResourceManager/src/Shared"

samples/AnomalyDetector/src/Generated/Internal/ModelSerializationExtensions.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using System.ClientModel.Primitives;
1010
using System.Collections.Generic;
1111
using System.Diagnostics;
12-
using System.Diagnostics.CodeAnalysis;
1312
using System.Globalization;
1413
using System.Text.Json;
1514
using System.Xml;
@@ -22,7 +21,6 @@ internal static class ModelSerializationExtensions
2221
internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 };
2322
internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W");
2423
internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray());
25-
internal static readonly JsonSerializerOptions Options = new JsonSerializerOptions { Converters = { new JsonModelConverter(WireOptions, AnomalyDetectorContext.Default) } };
2624

2725
public static object GetObject(this JsonElement element)
2826
{
@@ -267,20 +265,6 @@ internal static bool IsSentinelValue(BinaryData value)
267265
return sentinelSpan.SequenceEqual(valueSpan);
268266
}
269267

270-
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")]
271-
[UnconditionalSuppressMessage("Trimming", "IL3050", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")]
272-
public static T JsonDeserialize<T>(string json, JsonSerializerOptions options)
273-
{
274-
return JsonSerializer.Deserialize<T>(json, options);
275-
}
276-
277-
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")]
278-
[UnconditionalSuppressMessage("Trimming", "IL3050", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")]
279-
public static void JsonSerialize<T>(Utf8JsonWriter writer, T data, JsonSerializerOptions options)
280-
{
281-
JsonSerializer.Serialize(writer, data, options);
282-
}
283-
284268
internal static class TypeFormatters
285269
{
286270
private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ";

samples/AzureSample.ResourceManager.Sample/src/Generated/AvailabilitySetData.Serialization.cs

Lines changed: 24 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/AzureSample.ResourceManager.Sample/src/Generated/DedicatedHostData.Serialization.cs

Lines changed: 16 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/AzureSample.ResourceManager.Sample/src/Generated/DedicatedHostGroupData.Serialization.cs

Lines changed: 16 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/AzureSample.ResourceManager.Sample/src/Generated/ImageData.Serialization.cs

Lines changed: 16 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)