Skip to content

Review JsonSourceGenerationOptions configurations#2598

Open
alzimmermsft wants to merge 11 commits into
microsoft:mainfrom
alzimmermsft:ReviewJsonHandling
Open

Review JsonSourceGenerationOptions configurations#2598
alzimmermsft wants to merge 11 commits into
microsoft:mainfrom
alzimmermsft:ReviewJsonHandling

Conversation

@alzimmermsft
Copy link
Copy Markdown
Contributor

@alzimmermsft alzimmermsft commented May 6, 2026

What does this PR do?

Standardizes behaviors of JsonSourceGenerationOptions across all tools.

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@alzimmermsft alzimmermsft marked this pull request as ready for review May 11, 2026 21:52
Copilot AI review requested due to automatic review settings May 11, 2026 21:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Standardizes JsonSourceGenerationOptions usage across MCP tools to produce consistent camelCase JSON and omit null-valued properties.

Changes:

  • Added DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull (and camelCase naming) across multiple JsonSerializerContext implementations.
  • Refactored many JSON context declarations to file-scoped/semicolon style for consistency.
  • Updated several live tests to assert camelCase JSON property names and handle omitted null properties in some cases.

Reviewed changes

Copilot reviewed 99 out of 99 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/Fabric.Mcp.Tools.OneLake/src/Models/OneLakeJsonContext.cs Standardize source-gen options (camelCase + ignore nulls).
tools/Fabric.Mcp.Tools.OneLake/src/Models/MinimalJsonContext.cs Standardize source-gen options (camelCase + ignore nulls).
tools/Fabric.Mcp.Tools.Docs/src/Commands/FabricJsonContext.cs Add standardized source-gen options and simplify context declaration.
tools/Fabric.Mcp.Tools.Core/src/Models/CoreJsonContext.cs Reorder/standardize attributes and simplify context declaration.
tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/WorkbooksCommandTests.cs Update assertions to use camelCase JSON properties and adjust null-handling in one case.
tools/Azure.Mcp.Tools.Workbooks/src/Commands/WorkbooksJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.WellArchitectedFramework/src/Commands/WellArchitectedFrameworkJsonContext.cs Standardize source-gen options and simplify context declaration.
tools/Azure.Mcp.Tools.VirtualDesktop/src/Commands/VirtualDesktopJsonContext.cs Standardize source-gen options and simplify context declaration.
tools/Azure.Mcp.Tools.StorageSync/src/StorageSyncJsonContext.cs Standardize source-gen options and simplify context declaration.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupGetCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupDeleteCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/SyncGroup/SyncGroupCreateCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceUpdateCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceGetCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceDeleteCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/StorageSyncService/StorageSyncServiceCreateCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointUpdateCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointGetCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointDeleteCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/ServerEndpoint/ServerEndpointCreateCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUpdateCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerUnregisterCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/RegisteredServer/RegisteredServerGetCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointTriggerChangeDetectionCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointGetCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointDeleteCommand.cs Remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.StorageSync/src/Commands/CloudEndpoint/CloudEndpointCreateCommand.cs Use target-typed new(...) and remove per-record JsonSerializable attribute usage.
tools/Azure.Mcp.Tools.Storage/src/Commands/StorageJsonContext.cs Standardize source-gen options (switch ignore condition to null) and simplify context declaration.
tools/Azure.Mcp.Tools.Sql/src/Commands/SqlJsonContext.cs Formatting-only change to options attribute.
tools/Azure.Mcp.Tools.Speech/src/Commands/SpeechJsonContext.cs Formatting-only change to options attribute.
tools/Azure.Mcp.Tools.SignalR/src/Commands/SignalRJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.ServiceFabric/tests/Azure.Mcp.Tools.ServiceFabric.LiveTests/ServiceFabricCommandTests.cs Update assertions to use camelCase JSON properties.
tools/Azure.Mcp.Tools.ServiceFabric/src/Commands/ServiceFabricJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.ServiceBus/src/Commands/ServiceBusJsonContext.cs Standardize source-gen options and simplify context declaration.
tools/Azure.Mcp.Tools.Search/src/Commands/SearchJsonContext.cs Standardize source-gen options and simplify context declaration.
tools/Azure.Mcp.Tools.ResourceHealth/src/ResourceHealthJsonContext.cs Standardize source-gen options (add ignore nulls) while preserving generation mode.
tools/Azure.Mcp.Tools.Redis/src/Commands/RedisJsonContext.cs Switch ignore condition from default to null and keep camelCase.
tools/Azure.Mcp.Tools.Quota/src/Commands/QuotaJsonContext.cs Reorder attributes and simplify context declaration; keep case-insensitive + ignore nulls.
tools/Azure.Mcp.Tools.Pricing/src/Commands/PricingJsonContext.cs Formatting-only change to options attribute.
tools/Azure.Mcp.Tools.Postgres/src/Commands/PostgresJsonContext.cs Add camelCase + ignore nulls and simplify context declaration.
tools/Azure.Mcp.Tools.Policy/src/Commands/PolicyJsonContext.cs Remove WriteIndented and standardize ignore nulls.
tools/Azure.Mcp.Tools.MySql/src/Commands/MySqlJsonContext.cs Add camelCase + ignore nulls and simplify context declaration.
tools/Azure.Mcp.Tools.Monitor/src/Models/Instrumentation/OnboardingJsonContext.cs Reorder options and keep existing indentation/case-insensitive behavior.
tools/Azure.Mcp.Tools.Monitor/src/Commands/MonitorJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.Monitor/src/Commands/Instrumentation/MonitorInstrumentationJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.Marketplace/src/Commands/MarketplaceJsonContext.cs Formatting + keep enum converter; add ignore nulls.
tools/Azure.Mcp.Tools.ManagedLustre/src/Commands/ManagedLustreJsonContext.cs Remove WriteIndented and standardize ignore nulls.
tools/Azure.Mcp.Tools.LoadTesting/tests/Azure.Mcp.Tools.LoadTesting.LiveTests/LoadTestingCommandTests.cs Update assertions to use camelCase JSON properties.
tools/Azure.Mcp.Tools.LoadTesting/src/Commands/LoadTestingJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.Kusto/src/Commands/KustoJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.KeyVault/src/Commands/KeyVaultJsonContext.cs Simplify context declaration; formatting-only options tweak.
tools/Azure.Mcp.Tools.Grafana/src/Commands/GrafanaJsonContext.cs Switch ignore condition from default to null and keep camelCase.
tools/Azure.Mcp.Tools.Functions/src/Commands/FunctionsJsonContext.cs Remove unused using; standardize options formatting.
tools/Azure.Mcp.Tools.FunctionApp/src/Commands/FunctionAppJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.FoundryExtensions/src/Commands/FoundryExtensionsJsonContext.cs Switch ignore condition from default to null and keep camelCase.
tools/Azure.Mcp.Tools.FileShares/src/FileSharesJsonContext.cs Add ignore nulls and simplify context declaration.
tools/Azure.Mcp.Tools.Extension/src/Commands/ExtensionJsonContext.cs Add ignore nulls and simplify context declaration.
tools/Azure.Mcp.Tools.EventHubs/src/Commands/EventHubsJsonContext.cs Formatting-only change to options attribute.
tools/Azure.Mcp.Tools.EventGrid/src/Commands/EventGridJsonContext.cs Standardize options and simplify context declaration.
tools/Azure.Mcp.Tools.DeviceRegistry/src/Commands/DeviceRegistryJsonContext.cs Switch ignore condition from default to null and keep camelCase.
tools/Azure.Mcp.Tools.Deploy/src/Commands/DeployJsonContext.cs Reorder attributes and simplify context declaration; keep case-insensitive + ignore nulls.
tools/Azure.Mcp.Tools.Cosmos/src/Commands/CosmosJsonContext.cs Simplify context declaration; formatting-only options tweak.
tools/Azure.Mcp.Tools.ContainerApps/src/Commands/ContainerAppsJsonContext.cs Simplify context declaration; formatting-only options tweak.
tools/Azure.Mcp.Tools.ConfidentialLedger/src/Commands/ConfidentialLedgerJsonContext.cs Add standardized source-gen options and simplify context declaration.
tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/ComputeCommandTests.cs Update assertions to use camelCase JSON properties.
tools/Azure.Mcp.Tools.Compute/src/Commands/ComputeJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.Communication/src/CommunicationJsonContext.cs Add ignore nulls to metadata generation mode and simplify context declaration.
tools/Azure.Mcp.Tools.CloudArchitect/src/CloudArchitectJsonContext.cs Add ignore nulls while keeping case-insensitive; simplify context declaration.
tools/Azure.Mcp.Tools.BicepSchema/src/Commands/BicepSchemaJsonContext.cs Add standardized source-gen options and simplify context declaration.
tools/Azure.Mcp.Tools.AzureTerraformBestPractices/src/Commands/AzureTerraformBestPracticesJsonContext.cs Add ignore nulls and simplify context declaration.
tools/Azure.Mcp.Tools.AzureTerraform/src/Services/AzApiExamplesJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.AzureTerraform/src/Services/AvmJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.AzureTerraform/src/Commands/AzureTerraformJsonContext.cs Add ignore nulls and format options attribute.
tools/Azure.Mcp.Tools.AzureMigrate/src/Helpers/AzureMigrateSerializerContext.cs Formatting-only change to options attribute.
tools/Azure.Mcp.Tools.AzureMigrate/src/Commands/AzureMigrateJsonContext.cs Formatting-only change to options attribute.
tools/Azure.Mcp.Tools.AzureIsv/src/Commands/Datadog/DatadogJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/AzureBestPracticesJsonContext.cs Add ignore nulls and simplify context declaration.
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/AzureBackupJsonContext.cs Switch ignore condition from default to null and simplify context declaration.
tools/Azure.Mcp.Tools.AzureBackup/docs/architecture.md Update documentation snippet for source-gen options / context declaration.
tools/Azure.Mcp.Tools.Authorization/src/Commands/AuthorizationJsonContext.cs Formatting-only change to options attribute.
tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/ApplicationInsightsJsonContext.cs Add ignore nulls and simplify context declaration.
tools/Azure.Mcp.Tools.AppService/src/Commands/AppServiceJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.AppLens/src/Models/AppLensJsonContext.cs Add ignore nulls and simplify context declaration.
tools/Azure.Mcp.Tools.AppConfig/src/Commands/AppConfigJsonContext.cs Simplify context declaration; formatting-only options tweak.
tools/Azure.Mcp.Tools.Aks/tests/Azure.Mcp.Tools.Aks.LiveTests/AksCommandTests.cs Tighten value-kind assertions and adjust optional-property checks.
tools/Azure.Mcp.Tools.Aks/src/Commands/AksJsonContext.cs Add standardized source-gen options (camelCase + ignore nulls).
tools/Azure.Mcp.Tools.Advisor/src/Commands/AdvisorJsonContext.cs Add license header and formatting-only change to options attribute.
tools/Azure.Mcp.Tools.Acr/src/Commands/AcrJsonContext.cs Simplify context declaration; formatting-only options tweak.
core/Microsoft.ModelContextProtocol.HttpServer.Distributed/src/SerializerContext.cs Simplify context declaration.
core/Microsoft.Mcp.Core/src/Services/ServicesJsonContext.cs Add ignore nulls and simplify context declaration.
core/Microsoft.Mcp.Core/src/Models/ModelsJsonContext.cs Add ignore nulls and simplify context declaration.
core/Microsoft.Mcp.Core/src/CoreJsonContext.cs Simplify context declaration.
core/Microsoft.Mcp.Core/src/Commands/JsonSourceGenerationContext.cs Add ignore nulls and simplify context declaration.
core/Microsoft.Mcp.Core/src/Areas/Server/ServerJsonContext.cs Use JsonIgnoreCondition alias and simplify context declaration.
core/Microsoft.Mcp.Core/src/Areas/Server/Models/OAuthProtectedResourceMetadata.cs Add standardized source-gen options and simplify context declaration.
core/Microsoft.Mcp.Core/src/Areas/Server/Commands/ServiceInfoJsonContext.cs Add ignore nulls and simplify context declaration.
core/Azure.Mcp.Core/src/Areas/Subscription/Commands/SubscriptionJsonContext.cs Add ignore nulls and simplify context declaration.
core/Azure.Mcp.Core/src/Areas/Group/Commands/GroupJsonContext.cs Add ignore nulls and simplify context declaration.
AGENTS.md Update documentation snippet to include ignore-nulls option.
Comments suppressed due to low confidence (2)

tools/Azure.Mcp.Tools.Workbooks/tests/Azure.Mcp.Tools.Workbooks.LiveTests/WorkbooksCommandTests.cs:1

  • WorkbooksJsonContext now ignores null properties when serializing, so if serializedData is null it will likely be omitted entirely (not present as "serializedData": null). This assertion can fail against real responses; update the test to accept an omitted serializedData (e.g., TryGetProperty) or only assert presence when the value is expected to be non-null.
    tools/Azure.Mcp.Tools.Storage/src/Commands/StorageJsonContext.cs:1
  • This changes the ignore behavior from WhenWritingDefault to WhenWritingNull, which will cause default values of non-nullable value types (e.g., 0, false, empty structs) to be serialized instead of omitted. If any tool responses previously relied on default-omission for payload size or schema shape, this is a behavior change for API consumers; consider either keeping WhenWritingDefault where it mattered, or ensuring optional fields are nullable (so they can still be omitted) and documenting/changelogging the output change.

Copy link
Copy Markdown
Contributor

@vcolin7 vcolin7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good. I just left a small comment.

[JsonSerializable(typeof(BrownfieldFindings))]
[JsonSerializable(typeof(AnalysisTemplate))]
[JsonSourceGenerationOptions(
WriteIndented = true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We removed this from some places but kept it here. Is there a particular reason we'd like to keep this one around?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept it as I know it returns user instructions, but we can remove it and see what happens.

@vcolin7
Copy link
Copy Markdown
Contributor

vcolin7 commented May 12, 2026

Oh, there's something else: there are classes like PostgresCommandTests where we still expect PascalCase for deserialized properties (like here and here). I think the recorded tests ran just fine because the recordings still return that, but I wonder if the live tests will behave well.

It's possible we'll have to re-record for test classes modified in this PR.

@alzimmermsft
Copy link
Copy Markdown
Contributor Author

Oh, there's something else: there are classes like PostgresCommandTests where we still expect PascalCase for deserialized properties (like here and here). I think the recorded tests ran just fine because the recordings still return that, but I wonder if the live tests will behave well.

It's possible we'll have to re-record for test classes modified in this PR.

There are some model types that explicitly define their JSON property names which overrides the behavior specified in JsonSourceGenerationOptions. This is something that'll need to be reconciled in a follow-up PR.

Copy link
Copy Markdown
Contributor

@jongio jongio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardization effort looks solid overall - consistent formatting, semicolon bodies, and adding DefaultIgnoreCondition everywhere. A few behavioral concerns worth confirming:

WhenWritingDefault vs WhenWritingNull - Several tools (AzureBackup, DeviceRegistry, FoundryExtensions, Grafana, Redis, Storage) changed from WhenWritingDefault to WhenWritingNull. These have different semantics: WhenWritingDefault omits default-valued fields (0, false, empty Guid), while WhenWritingNull only omits null. After this change, fields like "count": 0 and "isEnabled": false will now appear in tool responses where they were previously omitted. This is additive (not field-removing), so likely safe for MCP consumers, but worth being aware of.

Contexts gaining options for the first time - A few contexts (AppService, SignalR, AvmJsonContext, AzApiExamplesJsonContext, etc.) previously had no JsonSourceGenerationOptions. Adding CamelCase naming policy means their source-generated serializers will now produce camelCase property names. If these were already using runtime options that specified camelCase, no change. If they relied on the source-gen defaults (PascalCase), this changes output shape.

WriteIndented removal - ManagedLustre and Policy lost WriteIndented = true. Output will no longer be pretty-printed. Functionally fine, but might affect debugging readability.

internal sealed partial class AzureBackupJsonContext : JsonSerializerContext { }
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault
)]
internal sealed partial class AzureBackupJsonContext : JsonSerializerContext;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs snippet still shows WhenWritingDefault but the actual code (AzureBackupJsonContext.cs) was changed to WhenWritingNull. Should update the docs to match.

DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault
)]
internal sealed partial class AzureBackupJsonContext : JsonSerializerContext;
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the closing )] here has 2 extra spaces of indentation ( )]) while all other files in this PR use no extra indentation on the closing bracket.

Copy link
Copy Markdown
Contributor

@jongio jongio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the new commit (c794930). The architecture.md docs fix addresses my earlier WhenWritingDefault/WhenWritingNull mismatch - now consistent with the code change.

The approach of adding explicit [JsonPropertyName("PascalCase")] attributes to preserve backward compat for Compute, LoadTesting, ServiceFabric, and Workbooks is pragmatic. One concern: models like DiskInfo and TestResource now rely on per-property attributes fighting the context-level CamelCase policy. Any new property added without the attribute will silently serialize as camelCase while existing ones stay PascalCase. A brief code comment in those models would help future contributors avoid mixed output.

Minor nit from last review: architecture.md line 392 still has )] with 2 extra spaces vs the PR's standard )] formatting.

/// <summary>
/// Gets or sets the name of the disk.
/// </summary>
[JsonPropertyName("Name")]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These PascalCase overrides fight the context-level CamelCase policy. Works fine today, but a new property added without [JsonPropertyName] would silently serialize as camelCase while these stay PascalCase. Consider adding a comment at the top of the class (or in the JsonContext) noting that explicit attributes are needed here to preserve backward compat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

4 participants