Skip to content

Commit

Permalink
chore: Add override ToString on options classes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkallesen committed Jul 8, 2024
1 parent d0073a0 commit 8e97261
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
}
3 changes: 3 additions & 0 deletions src/Atc.Rest.ApiGenerator/Options/ApiOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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})";
}
3 changes: 3 additions & 0 deletions src/Atc.Rest.ApiGenerator/Options/ApiOptionsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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})";
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
}

0 comments on commit 8e97261

Please sign in to comment.