Add additional test for STJ Schema deprecated property#131189
Open
Youssef1313 wants to merge 2 commits into
Open
Add additional test for STJ Schema deprecated property#131189Youssef1313 wants to merge 2 commits into
Youssef1313 wants to merge 2 commits into
Conversation
|
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. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-text-json |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds targeted System.Text.Json JsonSchemaExporter test coverage to ensure the deprecated keyword is applied only to obsolete members in scenarios where schema nodes/types could otherwise be shared (including $ref reuse paths).
Changes:
- Adds a new test case covering two properties sharing the same POCO type, where only the obsolete property’s schema should be marked
deprecated. - Adds a new test case covering two collection properties sharing a
$ref’d element schema, ensuringdeprecateddoes not leak into the shared referenced schema. - Introduces small POCO helper types used by the new test cases.
eiriktsarpalis
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only adds additional test coverage. It occurred to me that I could have got this scenario wrong when I added deprecated implementation in #130665, but turned out to be correct already. So I thought it's worth adding a test.
Basically, we want to ensure that for the following case, we don't end up re-using the same
$reffor the two properties. OnlyDeprecatedshould get the deprecated property.