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 diff --git a/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs b/src/Atc.Rest.ApiGenerator.CLI/ApiOptionsHelper.cs index f441f92e..add9498f 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; @@ -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) {