Skip to content

Add additionalProperties for JsonExtensionData schemas#67456

Open
mete0rfish wants to merge 4 commits into
dotnet:mainfrom
mete0rfish:fix-66338
Open

Add additionalProperties for JsonExtensionData schemas#67456
mete0rfish wants to merge 4 commits into
dotnet:mainfrom
mete0rfish:fix-66338

Conversation

@mete0rfish

Copy link
Copy Markdown

Add additionalProperties for JsonExtensionData schemas

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Added support for JsonExtensionData in OpenAPI schema generation by setting additionalProperties for object schemas that accept extension data.

Description

OpenAPI schema generation was not reflecting JsonExtensionData properties, so DTOs that can deserialize undeclared JSON properties were still emitted as schemas without free-form additional properties.

This changes the schema generation logic to detect JsonTypeInfo object types with extension data and add an empty additionalProperties schema when one has not already been set. This preserves any existing additionalProperties value while making the generated schema match the runtime JSON behavior.

Fixes #66338

@mete0rfish mete0rfish requested a review from a team as a code owner June 29, 2026 12:01
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 29, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @mete0rfish. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@mete0rfish

Copy link
Copy Markdown
Author

@mete0rfish please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

@dotnet-policy-service agree

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

Labels

community-contribution Indicates that the PR has been added by a community member

1 participant