diff --git a/CHANGELOG.md b/CHANGELOG.md index 672ace9ea8..353bd6eb47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Escapes language reserved keywords #184 - Replaces custom URL tree node by class provided by OpenAPI.net #179 - Adds support for collections as root responses #191 +- Changes default namespace and class name to api client #199 ## [0.0.4] - 2021-04-28 diff --git a/README.md b/README.md index 6c1267475a..0b73845cc2 100644 --- a/README.md +++ b/README.md @@ -118,10 +118,10 @@ Kiota accepts the following parameters during the generation: | Name | Shorthand | Required | Description | Accepted values | Default Value | | ---- | --------- | -------- | ----------- | --------------- | ------------- | -| class-name | c | no | The class name to use the for main entry point | A valid class name according to the target language specification. | GraphClient | +| class-name | c | no | The class name to use the for main entry point | A valid class name according to the target language specification. | ApiClient | | language | l | no | The programming language to generate the SDK in. | csharp, java, or typescript | csharp | | loglevel | ll | no | The log level to use when logging events to the main output. | Microsoft.Extensions.Logging.LogLevel values | Warning | -| namespace-name | n | no | The namespace name to use the for main entry point. | Valid namespace/module name according to target language specifications. | GraphClient | +| namespace-name | n | no | The namespace name to use the for main entry point. | Valid namespace/module name according to target language specifications. | ApiClient | | openapi | d | no | URI or Path to the OpenAPI description (JSON or YAML) to use to generate the SDK. | A valid URI pointing to an HTTP document or a file on the local file-system. | ./openapi.yml | | output | o | no | The output path of the folder the code will be generated in. The folders will be created during the generation if they don't already exist. | A valid path to a folder. | ./output | diff --git a/src/Kiota.Builder/GenerationConfiguration.cs b/src/Kiota.Builder/GenerationConfiguration.cs index 4f0518227e..66721c76b5 100644 --- a/src/Kiota.Builder/GenerationConfiguration.cs +++ b/src/Kiota.Builder/GenerationConfiguration.cs @@ -4,9 +4,8 @@ namespace Kiota.Builder { public class GenerationConfiguration { public string OpenAPIFilePath { get; set; } = "openapi.yaml"; public string OutputPath { get; set; } = "./output"; - public string ClientClassName { get; set; } = "GraphClient"; - public string ClientNamespaceName { get; set; } = "GraphClient"; - public string SchemaRootNamespaceName { get; set; } = "microsoft.graph"; + public string ClientClassName { get; set; } = "ApiClient"; + public string ClientNamespaceName { get; set; } = "ApiClient"; public GenerationLanguage Language { get; set; } = GenerationLanguage.CSharp; public string ApiRootUrl { get; set; } = "https://graph.microsoft.com/v1.0"; public List PropertiesPrefixToStrip { get; set; } = new() { "@odata."}; diff --git a/src/kiota/KiotaHost.cs b/src/kiota/KiotaHost.cs index 3b91eeafe0..4c9d825560 100644 --- a/src/kiota/KiotaHost.cs +++ b/src/kiota/KiotaHost.cs @@ -20,11 +20,11 @@ public static RootCommand GetRootCommand() var languageOption = new Option("--language", "The target language for the generated code files.") { Argument = new Argument(() => GenerationLanguage.CSharp) }; languageOption.AddAlias("-l"); AddEnumValidator(languageOption.Argument, "language"); - var classOption = new Option("--class-name", "The class name to use for the core client class.") { Argument = new Argument(() => "GraphClient") }; + var classOption = new Option("--class-name", "The class name to use for the core client class.") { Argument = new Argument(() => "ApiClient") }; classOption.AddAlias("-c"); AddStringRegexValidator(classOption.Argument, @"^[a-zA-Z_][\w_-]+", "class name"); - var namespaceOption = new Option("--namespace-name", "The namespace to use for the core client class specified with the --class-name option.") { Argument = new Argument(() => "GraphClient") }; + var namespaceOption = new Option("--namespace-name", "The namespace to use for the core client class specified with the --class-name option.") { Argument = new Argument(() => "ApiClient") }; namespaceOption.AddAlias("-n"); AddStringRegexValidator(namespaceOption.Argument, @"^[\w][\w\._-]+", "namespace name");