Skip to content

fix: removes extraneous default value constant #2433

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 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/Microsoft.OpenApi/Models/OpenApiOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
/// </summary>
public class OpenApiOperation : IOpenApiSerializable, IOpenApiExtensible, IMetadataContainer
{
/// <summary>
/// Default value for <see cref="Deprecated"/>.
/// </summary>
public const bool DeprecatedDefault = false;

private ISet<OpenApiTagReference>? _tags;
/// <summary>
/// A list of tags for API documentation control.
Expand Down Expand Up @@ -97,7 +92,7 @@
/// <summary>
/// Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation.
/// </summary>
public bool Deprecated { get; set; } = DeprecatedDefault;
public bool Deprecated { get; set; }

/// <summary>
/// A declaration of which security mechanisms can be used for this operation.
Expand Down Expand Up @@ -223,7 +218,7 @@
/// <summary>
/// Serialize <see cref="OpenApiOperation"/> to Open Api v2.0.
/// </summary>
public virtual void SerializeAsV2(IOpenApiWriter writer)

Check warning on line 221 in src/Microsoft.OpenApi/Models/OpenApiOperation.cs

View workflow job for this annotation

GitHub Actions / Build

Refactor this method to reduce its Cognitive Complexity from 28 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)

Check warning on line 221 in src/Microsoft.OpenApi/Models/OpenApiOperation.cs

View workflow job for this annotation

GitHub Actions / Build

Refactor this method to reduce its Cognitive Complexity from 28 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)

Check warning on line 221 in src/Microsoft.OpenApi/Models/OpenApiOperation.cs

View workflow job for this annotation

GitHub Actions / Build

Refactor this method to reduce its Cognitive Complexity from 28 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
Utils.CheckArgumentNull(writer);

Expand Down Expand Up @@ -333,7 +328,7 @@

writer.WriteOptionalCollection(OpenApiConstants.Schemes, schemes, (w, s) =>
{
if (!string.IsNullOrEmpty(s) && s is not null)

Check warning on line 331 in src/Microsoft.OpenApi/Models/OpenApiOperation.cs

View workflow job for this annotation

GitHub Actions / Build

Change this condition so that it does not always evaluate to 'True'. (https://rules.sonarsource.com/csharp/RSPEC-2589)

Check warning on line 331 in src/Microsoft.OpenApi/Models/OpenApiOperation.cs

View workflow job for this annotation

GitHub Actions / Build

Change this condition so that it does not always evaluate to 'True'. (https://rules.sonarsource.com/csharp/RSPEC-2589)

Check warning on line 331 in src/Microsoft.OpenApi/Models/OpenApiOperation.cs

View workflow job for this annotation

GitHub Actions / Build

Change this condition so that it does not always evaluate to 'True'. (https://rules.sonarsource.com/csharp/RSPEC-2589)
{
w.WriteValue(s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,6 @@ namespace Microsoft.OpenApi
}
public class OpenApiOperation : Microsoft.OpenApi.IMetadataContainer, Microsoft.OpenApi.IOpenApiElement, Microsoft.OpenApi.IOpenApiExtensible, Microsoft.OpenApi.IOpenApiSerializable
{
public const bool DeprecatedDefault = false;
public OpenApiOperation() { }
public OpenApiOperation(Microsoft.OpenApi.OpenApiOperation operation) { }
public System.Collections.Generic.IDictionary<string, Microsoft.OpenApi.IOpenApiCallback>? Callbacks { get; set; }
Expand Down
Loading