Skip to content

Apply IJsonmodel<> changes from Azure.Core #5347

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

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2b7baa6
generate helper method for json deserialize
live1206 May 28, 2025
b8253de
Use IJsonModel serialization
live1206 May 29, 2025
8e39b1e
wip
live1206 May 29, 2025
3ab4a79
wip
live1206 May 30, 2025
333b0b8
regen
live1206 May 30, 2025
17db189
TODO
live1206 May 30, 2025
5d09b38
refine
live1206 Jun 4, 2025
ce316e9
Merge remote-tracking branch 'origin/main' into json-model
live1206 Jun 12, 2025
f936c5e
cleanup
live1206 Jun 13, 2025
555df7c
regen
live1206 Jun 13, 2025
db31bd1
regen
live1206 Jun 13, 2025
f4a191d
regen
live1206 Jun 13, 2025
88a3e1b
revert unexpected changes
live1206 Jun 13, 2025
dc3892c
fix generation for useManagedServiceIdentityV3
live1206 Jun 13, 2025
a88e322
regen
live1206 Jun 13, 2025
3c10858
revert change for BinaryData serialization
live1206 Jun 13, 2025
d57869a
regen
live1206 Jun 13, 2025
7a1a3e1
fix namespace
live1206 Jun 13, 2025
69d150e
apply azure.core changes
live1206 Jun 13, 2025
4a004a6
regen
live1206 Jun 13, 2025
fd8167a
writer jsonSerializerContext
live1206 Jun 17, 2025
8aba698
use MRWOptions to indicate v3 usage for ManagedServiceIdentity
live1206 Jun 18, 2025
92050d4
regen
live1206 Jun 18, 2025
51c3f1d
Merge remote-tracking branch 'origin/main' into apply-jsonmodel-azure…
live1206 Jun 18, 2025
27f1533
regen
live1206 Jun 18, 2025
f8ed66f
revert serialization method generation
live1206 Jun 18, 2025
1830f6e
regen
live1206 Jun 18, 2025
3cc68a2
Merge branch 'main' into apply-jsonmodel-azure-core
live1206 Jun 20, 2025
90c7f43
apply latest Azure.ResourceManager
live1206 Jun 23, 2025
8aa1c80
regen
live1206 Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@

<!-- All csproj dependencies. -->
<ItemGroup>
<PackageReference Update="Azure.Core" Version="1.46.1" />
<PackageReference Update="Azure.Core" Version="1.47.0-alpha.20250613.1" />
<PackageReference Update="Azure.Core.Experimental" Version="0.1.0-preview.18" />
<PackageReference Update="Azure.Core.Expressions.DataFactory" Version="1.0.0" />
<PackageReference Update="Azure.ResourceManager" Version="1.13.0" />
<PackageReference Update="Azure.Core.Expressions.DataFactory" Version="1.1.0-alpha.20250613.1" />
<PackageReference Update="Azure.ResourceManager" Version="1.14.0-beta.1" />
<PackageReference Update="CommandLineParser" Version="2.9.1" />
<PackageReference Update="Humanizer.Core" Version="2.13.14" />
<PackageReference Update="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
Expand All @@ -49,7 +49,7 @@
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" />
<PackageReference Update="NuGet.Configuration" Version="6.8.0" />
<PackageReference Update="NUnit" Version="3.13.2" />
<PackageReference Update="System.ClientModel" Version="1.4.1" />
<PackageReference Update="System.ClientModel" Version="1.5.0-alpha.20250613.1" />
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
<PackageReference Update="System.Memory" Version="4.5.4" />
<PackageReference Update="System.Text.Json" Version="8.0.5" />
Expand Down
2 changes: 1 addition & 1 deletion eng/DownloadSharedSource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Get-ChildItem $destinationPath -Filter *.cs | Remove-Item;
CopyAll $files $sourcePath $destinationPath

#Download management Shared
$files = 'SharedExtensions.cs', 'ManagedServiceIdentityTypeV3Converter.cs'
$files = 'SharedExtensions.cs'
$sourcePath = "$clonedPath/sdk/resourcemanager/Azure.ResourceManager/src/Shared"
$destinationPath = "$repoRoot/src/assets/Management.Shared"

Expand Down
3 changes: 1 addition & 2 deletions eng/scripts/Download-SharedSource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ CopyAll $files $sourcePath $destinationPath

#Download management Shared
$files = @(
'SharedExtensions.cs',
'ManagedServiceIdentityTypeV3Converter.cs'
'SharedExtensions.cs'
)

$sourcePath = "$clonedPath/sdk/resourcemanager/Azure.ResourceManager/src/Shared"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text.Json;
using System.Xml;
Expand All @@ -22,7 +21,6 @@ internal static class ModelSerializationExtensions
internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 };
internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W");
internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray());
internal static readonly JsonSerializerOptions Options = new JsonSerializerOptions { Converters = { new JsonModelConverter(WireOptions, AnomalyDetectorContext.Default) } };

public static object GetObject(this JsonElement element)
{
Expand Down Expand Up @@ -267,20 +265,6 @@ internal static bool IsSentinelValue(BinaryData value)
return sentinelSpan.SequenceEqual(valueSpan);
}

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")]
[UnconditionalSuppressMessage("Trimming", "IL3050", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")]
public static T JsonDeserialize<T>(string json, JsonSerializerOptions options)
{
return JsonSerializer.Deserialize<T>(json, options);
}

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")]
[UnconditionalSuppressMessage("Trimming", "IL3050", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")]
public static void JsonSerialize<T>(Utf8JsonWriter writer, T data, JsonSerializerOptions options)
{
JsonSerializer.Serialize(writer, data, options);
}

internal static class TypeFormatters
{
private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading