Skip to content
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

Remove unnecessary member initialized to its default value #5048

Merged
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
3 changes: 1 addition & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
[CA1716] rename parameter property so that it no longer conflicts with the reserved language keyword
[CA1720] Identifier 'xxx' contains type name
[CA1725] Overriden parameter name mismatch
[CA1805] Member is explicitly initialized to its default value
[CA1834] Use 'StringBuilder.Append(char)' instead of 'StringBuilder.Append(string)' when the input is a constant unit string
[CA1845] Use span-based 'string.Concat' and 'AsSpan' instead of 'Substring'
[CA1847] Use 'string.Contains(char)' instead of 'string.Contains(string)' - needs polyfill
Expand All @@ -100,7 +99,7 @@
[SYSLIB0012] 'Assembly.CodeBase' is obsolete
-->
<NoWarn>$(NoWarn);IDE0005;IDE0008;IDE0011;IDE0017;IDE0021;IDE0022;IDE0025;IDE0027;IDE0029;IDE0032;IDE0039;IDE0045;IDE0046;IDE0055;IDE0056;IDE0057;IDE0059;IDE0060;IDE0061;IDE0090;IDE0130;IDE0160;IDE0200;IDE0270;IDE0290;IDE0330</NoWarn>
<NoWarn>$(NoWarn);CA1200;CA1304;CA1305;CA1310;CA1311;CA1507;CA1510;CA1514;CA1710;CA1716;CA1720;CA1725;CA1805;CA1834;CA1845;CA1847;CA1861;CA1862;CA1865;CA1866;CA1870;CA2249;CA2263;SYSLIB0012</NoWarn>
<NoWarn>$(NoWarn);CA1200;CA1304;CA1305;CA1310;CA1311;CA1507;CA1510;CA1514;CA1710;CA1716;CA1720;CA1725;CA1834;CA1845;CA1847;CA1861;CA1862;CA1865;CA1866;CA1870;CA2249;CA2263;SYSLIB0012</NoWarn>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion src/NSwag.AspNetCore/SwaggerUiSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public bool EnableTryItOut
public string CustomHeadContent { get; set; } = "";

/// <summary>Gets or sets a value indicating whether the Swagger specification should be validated.</summary>
public bool ValidateSpecification { get; set; } = false;
public bool ValidateSpecification { get; set; }

/// <summary>Gets the additional Swagger UI 3 settings.</summary>
public IDictionary<string, object> AdditionalSettings { get; } = new Dictionary<string, object>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,27 @@ public TypeScriptClientGeneratorSettings()
public string ExceptionClass { get; set; }

/// <summary>Gets or sets a value indicating whether to use the AbortSignal (Aurelia/Axios/Fetch template only, default: false).</summary>
public bool UseAbortSignal { get; set; } = false;
public bool UseAbortSignal { get; set; }

// TODO: Angular specific => move

/// <summary>Gets or sets the HTTP service class (applies only for the Angular template, default: HttpClient).</summary>
public HttpClass HttpClass { get; set; } = HttpClass.HttpClient;

/// <summary>Gets or sets a value indicating whether to set the withCredentials flag.</summary>
public bool WithCredentials { get; set; } = false;
public bool WithCredentials { get; set; }

/// <summary>Gets the RxJs version (Angular template only, default: 6.0).</summary>
public decimal RxJsVersion { get; set; } = 6.0m;

/// <summary>Gets a value indicating whether to use the Angular 6 Singleton Provider (Angular template only, default: false).</summary>
public bool UseSingletonProvider { get; set; } = false;
public bool UseSingletonProvider { get; set; }

/// <summary>Gets or sets the injection token type (applies only for the Angular template).</summary>
public InjectionTokenType InjectionTokenType { get; set; } = InjectionTokenType.OpaqueToken;

/// <summary>Gets a value indicating whether to include the httpContext parameter (Angular template only, default: false).</summary>
public bool IncludeHttpContext { get; set; } = false;
public bool IncludeHttpContext { get; set; }

internal ITemplate CreateTemplate(object model)
{
Expand Down
4 changes: 2 additions & 2 deletions src/NSwag.Core/OpenApiOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class OpenApiOperation : JsonExtensionObject
{
private OpenApiRequestBody _requestBody;

private bool _disableRequestBodyUpdate = false;
private bool _disableBodyParameterUpdate = false;
private bool _disableRequestBodyUpdate;
private bool _disableBodyParameterUpdate;

/// <summary>Initializes a new instance of the <see cref="OpenApiPathItem"/> class.</summary>
public OpenApiOperation()
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Core/OpenApiParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class OpenApiParameter : JsonSchema
private string _name;
private OpenApiParameterKind _kind;
private OpenApiParameterStyle _style;
private bool _isRequired = false;
private bool _isRequired;
private JsonSchema _schema;
private IDictionary<string, OpenApiExample> _examples;
private bool _explode;
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Generation/OpenApiDocumentGeneratorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public OpenApiDocumentGeneratorSettings()
public bool UseControllerSummaryAsTagDescription { get; set; }

/// <summary>Gets or sets a value indicating whether the HttpMethodAttribute Name property shall be used as OperationId.</summary>
public bool UseHttpAttributeNameAsOperationId { get; set; } = false;
public bool UseHttpAttributeNameAsOperationId { get; set; }

/// <summary>Inserts a function based operation processor at the beginning of the pipeline to be used to filter operations.</summary>
/// <param name="filter">The processor filter.</param>
Expand Down
Loading