Skip to content

Produce deprecated property in JsonSchema for obsolete types#130665

Open
Youssef1313 wants to merge 4 commits into
mainfrom
dev/ygerges/deprecated-schema
Open

Produce deprecated property in JsonSchema for obsolete types#130665
Youssef1313 wants to merge 4 commits into
mainfrom
dev/ygerges/deprecated-schema

Conversation

@Youssef1313

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings July 14, 2026 06:41
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:41 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:41 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:43 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:43 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:44 — with GitHub Actions Inactive

Copilot AI left a comment

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.

Pull request overview

This PR updates the System.Text.Json JSON Schema exporter to emit the JSON Schema deprecated keyword when exporting schemas for [Obsolete] .NET types, and adds a regression test covering the new behavior.

Changes:

  • Detect [Obsolete] on exported types and set deprecated: true in the generated schema.
  • Add Deprecated support to the internal JsonSchema model and include it in JSON output.
  • Add a unit test validating deprecated is emitted for an obsolete type.

Reviewed changes

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

File Description
src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.cs Adds a test case validating deprecated is produced for an [Obsolete] type.
src/libraries/System.Text.Json/src/System/Text/Json/Schema/JsonSchemaExporter.cs Marks exported schemas as deprecated when the associated .NET type has [Obsolete].
src/libraries/System.Text.Json/src/System/Text/Json/Schema/JsonSchema.cs Adds a Deprecated keyword to the schema model, counts it, and emits it during JSON serialization.

Comment thread src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.cs Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 06:50
@Youssef1313 Youssef1313 force-pushed the dev/ygerges/deprecated-schema branch from 2e895bf to a5d6c2d Compare July 14, 2026 06:50
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:50 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:50 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 force-pushed the dev/ygerges/deprecated-schema branch from a5d6c2d to 0460d8b Compare July 14, 2026 06:51
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:51 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:52 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 06:54 — with GitHub Actions Inactive

Copilot AI left a comment

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.

Pull request overview

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

Comment thread src/libraries/System.Text.Json/src/System/Text/Json/Schema/JsonSchemaExporter.cs Outdated
Comment thread src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.cs Outdated
Comment thread src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.cs Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 06:54
@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.

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/libraries/System.Text.Json/src/System/Text/Json/Schema/JsonSchemaExporter.cs Outdated
Comment thread src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.cs Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 07:01
@Youssef1313 Youssef1313 force-pushed the dev/ygerges/deprecated-schema branch from 0460d8b to 76a2de7 Compare July 14, 2026 07:01
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 07:01 — with GitHub Actions Inactive
Comment thread src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.cs Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 13:17
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 13:17 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 13:17 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 13:19 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 13:20 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 14, 2026 13:21 — with GitHub Actions Inactive

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.cs Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 08:23
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 15, 2026 08:24 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 15, 2026 08:24 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 15, 2026 08:26 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 15, 2026 08:26 — with GitHub Actions Inactive
@Youssef1313 Youssef1313 temporarily deployed to copilot-pat-pool July 15, 2026 08:27 — with GitHub Actions Inactive

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

@eiriktsarpalis eiriktsarpalis 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.

Thanks

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.

4 participants