Skip to content

Show deprecation warning for OpenAPI analyzers #49915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

captainsafia
Copy link
Member

@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 16:41
@captainsafia captainsafia requested a review from vijayrkn as a code owner July 23, 2025 16:41
Copy link
Contributor

@Copilot 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

This PR implements a deprecation warning for the OpenAPI analyzers feature in ASP.NET Core projects. The change adds a warning message (ASPDEPR007) that displays when the IncludeOpenAPIAnalyzers property is set to true, indicating that this feature and its associated MVC API analyzers will be removed in a future release.

  • Adds MSBuild target to emit deprecation warning when IncludeOpenAPIAnalyzers is enabled
  • Includes comprehensive test coverage for various scenarios (property not set, false, and true across multiple target frameworks)

Reviewed Changes

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

File Description
src/WebSdk/Web/Targets/Sdk.Server.targets Adds MSBuild target that emits ASPDEPR007 warning when IncludeOpenAPIAnalyzers is true
test/Microsoft.NET.Sdk.Web.Tests/DeprecationTests.cs New test class with comprehensive coverage for deprecation warning scenarios

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable disable
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider enabling nullable reference types instead of disabling them globally. This would improve type safety and align with modern C# practices.

Suggested change
#nullable disable
#nullable enable

Copilot uses AI. Check for mistakes.

@captainsafia captainsafia merged commit 72226a6 into main Jul 23, 2025
28 checks passed
@captainsafia captainsafia deleted the safia/obsolete-api-analyzers branch July 23, 2025 21:43
@captainsafia
Copy link
Member Author

/backport to release/10.0.1xx-preview7

Copy link
Contributor

Started backporting to release/10.0.1xx-preview7: https://github.com/dotnet/sdk/actions/runs/16482466464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Obsolete Mvc.Api.Analyzers shipped in the framework
3 participants