diff --git a/Directory.Build.props b/Directory.Build.props index 6167325428..0b8967068a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -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 @@ -100,7 +99,7 @@ [SYSLIB0012] 'Assembly.CodeBase' is obsolete --> $(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);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);CA1200;CA1304;CA1305;CA1310;CA1311;CA1507;CA1510;CA1514;CA1710;CA1716;CA1720;CA1725;CA1834;CA1845;CA1847;CA1861;CA1862;CA1865;CA1866;CA1870;CA2249;CA2263;SYSLIB0012 diff --git a/src/NSwag.AspNetCore/SwaggerUiSettings.cs b/src/NSwag.AspNetCore/SwaggerUiSettings.cs index 64edcffb11..663ff302db 100644 --- a/src/NSwag.AspNetCore/SwaggerUiSettings.cs +++ b/src/NSwag.AspNetCore/SwaggerUiSettings.cs @@ -66,7 +66,7 @@ public bool EnableTryItOut public string CustomHeadContent { get; set; } = ""; /// Gets or sets a value indicating whether the Swagger specification should be validated. - public bool ValidateSpecification { get; set; } = false; + public bool ValidateSpecification { get; set; } /// Gets the additional Swagger UI 3 settings. public IDictionary AdditionalSettings { get; } = new Dictionary(); diff --git a/src/NSwag.CodeGeneration.TypeScript/TypeScriptClientGeneratorSettings.cs b/src/NSwag.CodeGeneration.TypeScript/TypeScriptClientGeneratorSettings.cs index 944cdbb08f..7b159d6c56 100644 --- a/src/NSwag.CodeGeneration.TypeScript/TypeScriptClientGeneratorSettings.cs +++ b/src/NSwag.CodeGeneration.TypeScript/TypeScriptClientGeneratorSettings.cs @@ -91,7 +91,7 @@ public TypeScriptClientGeneratorSettings() public string ExceptionClass { get; set; } /// Gets or sets a value indicating whether to use the AbortSignal (Aurelia/Axios/Fetch template only, default: false). - public bool UseAbortSignal { get; set; } = false; + public bool UseAbortSignal { get; set; } // TODO: Angular specific => move @@ -99,19 +99,19 @@ public TypeScriptClientGeneratorSettings() public HttpClass HttpClass { get; set; } = HttpClass.HttpClient; /// Gets or sets a value indicating whether to set the withCredentials flag. - public bool WithCredentials { get; set; } = false; + public bool WithCredentials { get; set; } /// Gets the RxJs version (Angular template only, default: 6.0). public decimal RxJsVersion { get; set; } = 6.0m; /// Gets a value indicating whether to use the Angular 6 Singleton Provider (Angular template only, default: false). - public bool UseSingletonProvider { get; set; } = false; + public bool UseSingletonProvider { get; set; } /// Gets or sets the injection token type (applies only for the Angular template). public InjectionTokenType InjectionTokenType { get; set; } = InjectionTokenType.OpaqueToken; /// Gets a value indicating whether to include the httpContext parameter (Angular template only, default: false). - public bool IncludeHttpContext { get; set; } = false; + public bool IncludeHttpContext { get; set; } internal ITemplate CreateTemplate(object model) { diff --git a/src/NSwag.Core/OpenApiOperation.cs b/src/NSwag.Core/OpenApiOperation.cs index edbb1efe94..beb123a6fb 100644 --- a/src/NSwag.Core/OpenApiOperation.cs +++ b/src/NSwag.Core/OpenApiOperation.cs @@ -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; /// Initializes a new instance of the class. public OpenApiOperation() diff --git a/src/NSwag.Core/OpenApiParameter.cs b/src/NSwag.Core/OpenApiParameter.cs index 0ad36aac3e..176ff11ceb 100644 --- a/src/NSwag.Core/OpenApiParameter.cs +++ b/src/NSwag.Core/OpenApiParameter.cs @@ -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 _examples; private bool _explode; diff --git a/src/NSwag.Generation/OpenApiDocumentGeneratorSettings.cs b/src/NSwag.Generation/OpenApiDocumentGeneratorSettings.cs index 090eb6b3c4..6330bd9e76 100644 --- a/src/NSwag.Generation/OpenApiDocumentGeneratorSettings.cs +++ b/src/NSwag.Generation/OpenApiDocumentGeneratorSettings.cs @@ -79,7 +79,7 @@ public OpenApiDocumentGeneratorSettings() public bool UseControllerSummaryAsTagDescription { get; set; } /// Gets or sets a value indicating whether the HttpMethodAttribute Name property shall be used as OperationId. - public bool UseHttpAttributeNameAsOperationId { get; set; } = false; + public bool UseHttpAttributeNameAsOperationId { get; set; } /// Inserts a function based operation processor at the beginning of the pipeline to be used to filter operations. /// The processor filter.