From 8e97261608ee1bed2e02b7f8a06376870d7967e1 Mon Sep 17 00:00:00 2001 From: David Kallesen Date: Mon, 8 Jul 2024 23:15:12 +0200 Subject: [PATCH] chore: Add override ToString on options classes --- .../Options/ApiOptionsValidation.cs | 3 +++ src/Atc.Rest.ApiGenerator/Options/ApiOptions.cs | 3 +++ src/Atc.Rest.ApiGenerator/Options/ApiOptionsGenerator.cs | 3 +++ src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorClient.cs | 3 +++ .../Options/ApiOptionsGeneratorResponse.cs | 3 +++ 5 files changed, 15 insertions(+) diff --git a/src/Atc.Rest.ApiGenerator.Contracts/Options/ApiOptionsValidation.cs b/src/Atc.Rest.ApiGenerator.Contracts/Options/ApiOptionsValidation.cs index 9eb49e0b..3a8f2d0d 100644 --- a/src/Atc.Rest.ApiGenerator.Contracts/Options/ApiOptionsValidation.cs +++ b/src/Atc.Rest.ApiGenerator.Contracts/Options/ApiOptionsValidation.cs @@ -11,4 +11,7 @@ public class ApiOptionsValidation public CasingStyle ModelNameCasingStyle { get; set; } = CasingStyle.PascalCase; public CasingStyle ModelPropertyNameCasingStyle { get; set; } = CasingStyle.CamelCase; + + public override string ToString() + => $"{nameof(StrictMode)}: {StrictMode}, {nameof(OperationIdValidation)}: {OperationIdValidation}, {nameof(OperationIdCasingStyle)}: {OperationIdCasingStyle}, {nameof(ModelNameCasingStyle)}: {ModelNameCasingStyle}, {nameof(ModelPropertyNameCasingStyle)}: {ModelPropertyNameCasingStyle}"; } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Options/ApiOptions.cs b/src/Atc.Rest.ApiGenerator/Options/ApiOptions.cs index a006e795..99bbbe08 100644 --- a/src/Atc.Rest.ApiGenerator/Options/ApiOptions.cs +++ b/src/Atc.Rest.ApiGenerator/Options/ApiOptions.cs @@ -7,4 +7,7 @@ public class ApiOptions public ApiOptionsValidation Validation { get; set; } = new(); public bool IncludeDeprecated { get; set; } + + public override string ToString() + => $"{nameof(Generator)}: {Generator}, {nameof(Validation)}: ({Validation}), {nameof(IncludeDeprecated)}: ({IncludeDeprecated})"; } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGenerator.cs b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGenerator.cs index 351b71be..8a5e328e 100644 --- a/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGenerator.cs +++ b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGenerator.cs @@ -21,4 +21,7 @@ public class ApiOptionsGenerator public ApiOptionsGeneratorResponse Response { get; set; } = new(); public ApiOptionsGeneratorClient? Client { get; set; } + + public override string ToString() + => $"{nameof(AspNetOutputType)}: {AspNetOutputType}, {nameof(SwaggerThemeMode)}: {SwaggerThemeMode}, {nameof(UseRestExtended)}: {UseRestExtended}, {nameof(IncludeDeprecated)}: {IncludeDeprecated}, {nameof(ProjectName)}: {ProjectName}, {nameof(ProjectSuffixName)}: {ProjectSuffixName}, {nameof(RemoveNamespaceGroupSeparatorInGlobalUsings)}: {RemoveNamespaceGroupSeparatorInGlobalUsings}, {nameof(Request)}: ({Request}), {nameof(Response)}: ({Response}), {nameof(Client)}: ({Client})"; } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorClient.cs b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorClient.cs index b2bbff90..f88e7923 100644 --- a/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorClient.cs +++ b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorClient.cs @@ -7,4 +7,7 @@ public class ApiOptionsGeneratorClient public bool ExcludeEndpointGeneration { get; set; } public string HttpClientName { get; set; } = "ApiClient"; + + public override string ToString() + => $"{nameof(FolderName)}: {FolderName}, {nameof(ExcludeEndpointGeneration)}: {ExcludeEndpointGeneration}, {nameof(HttpClientName)}: {HttpClientName}"; } \ No newline at end of file diff --git a/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorResponse.cs b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorResponse.cs index c0c3ed7c..9fddd0c5 100644 --- a/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorResponse.cs +++ b/src/Atc.Rest.ApiGenerator/Options/ApiOptionsGeneratorResponse.cs @@ -5,4 +5,7 @@ public class ApiOptionsGeneratorResponse public bool UseProblemDetailsAsDefaultBody { get; set; } public CustomErrorResponseModel? CustomErrorResponseModel { get; set; } + + public override string ToString() + => $"{nameof(UseProblemDetailsAsDefaultBody)}: {UseProblemDetailsAsDefaultBody}, {nameof(CustomErrorResponseModel)}: {CustomErrorResponseModel}"; } \ No newline at end of file