From b4cde9c585c4606c473a8345c60932c9c0674aa9 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Wed, 22 Jan 2025 10:37:58 +0100 Subject: [PATCH 1/3] docs: fix spelling and spacing in README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d66a0853..edf38901 100644 --- a/README.md +++ b/README.md @@ -390,12 +390,12 @@ By using these options, you can effectively organize generated files into meanin The `projectSuffixName` extend `projectName` like the example: -| projectName | projectSuffixName | Generated project name | Reson | -|-------------|-------------------|------------------------|-------| +| projectName | projectSuffixName | Generated project name | Reason | +|-------------|-------------------|------------------------|----------------------------| | PetStore | | PetStore.Api.Generated | default is `Api.Generated` | -| PetStore | MyApi | PetStore.MyApi | | -| PetStore | Foo.Api | PetStore.Foo.Api | | -| PetStore | Bar-Api | PetStore.Bar.Api | | +| PetStore | MyApi | PetStore.MyApi | | +| PetStore | Foo.Api | PetStore.Foo.Api | | +| PetStore | Bar-Api | PetStore.Bar.Api | | ## PetStore Example From 5b1cb61ec5a7d611aeb804e0c8f0f21a91c1eebf Mon Sep 17 00:00:00 2001 From: Per Kops Date: Wed, 22 Jan 2025 10:38:28 +0100 Subject: [PATCH 2/3] fix: ensure proper reading of ApiOptions in ApiOptionsHelper for AspNetOutputType and SwaggerThemeMode --- src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs b/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs index f441f92e..33e845a3 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs @@ -132,13 +132,13 @@ private static void ApplyGeneratorOverrides( { if (settings is BaseServerCommandSettings serverCommandSettings) { - if (serverCommandSettings.AspNetOutputType.IsSet || + if (serverCommandSettings.AspNetOutputType.IsSet && serverCommandSettings.AspNetOutputType.Value != apiOptions.Generator.AspNetOutputType) { apiOptions.Generator.AspNetOutputType = serverCommandSettings.AspNetOutputType.Value; } - if (serverCommandSettings.SwaggerThemeMode.IsSet || + if (serverCommandSettings.SwaggerThemeMode.IsSet && serverCommandSettings.SwaggerThemeMode.Value != apiOptions.Generator.SwaggerThemeMode) { apiOptions.Generator.SwaggerThemeMode = serverCommandSettings.SwaggerThemeMode.Value; From 0debb5abc7a8f7024e9affe41c0bd2dd8cad74d4 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Wed, 22 Jan 2025 10:38:49 +0100 Subject: [PATCH 3/3] chore: remove superfluous null checks in ApiOptionsHelper --- src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs b/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs index 33e845a3..add9498f 100644 --- a/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs +++ b/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs @@ -149,10 +149,7 @@ private static void ApplyGeneratorOverrides( apiOptions.Generator.Response.UseProblemDetailsAsDefaultBody = serverCommandSettings.UseProblemDetailsAsDefaultResponseBody; } - if (serverCommandSettings.ProjectPrefixName is not null) - { - apiOptions.Generator.ProjectName = serverCommandSettings.ProjectPrefixName; - } + apiOptions.Generator.ProjectName = serverCommandSettings.ProjectPrefixName; if (serverCommandSettings.EndpointsLocation is not null && serverCommandSettings.EndpointsLocation.IsSet) @@ -215,10 +212,7 @@ private static void ApplyGeneratorOverrides( apiOptions.Generator.Response.UseProblemDetailsAsDefaultBody = clientApiCommandSettings.UseProblemDetailsAsDefaultResponseBody; } - if (clientApiCommandSettings.ProjectPrefixName is not null) - { - apiOptions.Generator.ProjectName = clientApiCommandSettings.ProjectPrefixName; - } + apiOptions.Generator.ProjectName = clientApiCommandSettings.ProjectPrefixName; if (clientApiCommandSettings.RemoveNamespaceGroupSeparatorInGlobalUsings) {