Skip to content

Fix JsonSchemaExporter handling of extension data with global Disallow - #135271

Merged
eiriktsarpalis merged 1 commit into
dotnet:mainfrom
eiriktsarpalis:eiriktsarpalis-json-schema-triage
Oct 6, 2026
Merged

eiriktsarpalis merged 1 commit into
dotnet:mainfrom
eiriktsarpalis:eiriktsarpalis-json-schema-triage

Conversation

@eiriktsarpalis

Copy link
Copy Markdown
Member

With global UnmappedMemberHandling = Disallow, JsonSchemaExporter emits additionalProperties: false for types with [JsonExtensionData], although JsonSerializer accepts and round-trips their extra properties. Use JsonTypeInfo.EffectiveUnmappedMemberHandling so the exporter honors the same extension-data override while ordinary types remain strict.

Shared regression coverage checks both exporter overloads and serializer round-tripping for global Skip and Disallow, with reflection and source generation. The regression fails before the fix and passes afterward on CoreCLR and .NET Framework 4.8.1. Full affected inner-loop suites: 131,214 passed, zero failed, 17 existing skips.

Resolves #135258

Note

This pull request was generated with GitHub Copilot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-text-json
See info in area-owners.md if you want to be subscribed.

@alexaka1

alexaka1 commented Oct 6, 2026

Copy link
Copy Markdown

Thanks for the quick PR ❤️! Any chance this will land in .NET 11 (or even 10)? I'm okay with not making to release day, but let's say by February? Or is this one of those things again, that will only make it to .NET Next?

@eiriktsarpalis

Copy link
Copy Markdown
Member Author

Hi @alexaka1, hoping to get this backported in time for GA in November.

@adamsitnik adamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@eiriktsarpalis
eiriktsarpalis merged commit 14fb767 into dotnet:main Oct 6, 2026
87 checks passed
@eiriktsarpalis
eiriktsarpalis deleted the eiriktsarpalis-json-schema-triage branch October 6, 2026 15:11
@eiriktsarpalis

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JsonSchemaExporter forbids extension data with global Disallow

3 participants