From d639df17272168d8338b2de575e2d5e5381e8837 Mon Sep 17 00:00:00 2001 From: wcontayon Date: Wed, 2 Jun 2021 10:45:44 +0200 Subject: [PATCH 1/3] Change default name GraphClient => ApiClient --- README.md | 4 ++-- src/Kiota.Builder/GenerationConfiguration.cs | 4 ++-- src/kiota/KiotaHost.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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..b92efadd69 100644 --- a/src/Kiota.Builder/GenerationConfiguration.cs +++ b/src/Kiota.Builder/GenerationConfiguration.cs @@ -4,8 +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 ClientClassName { get; set; } = "ApiClient"; + public string ClientNamespaceName { get; set; } = "ApiClient"; public string SchemaRootNamespaceName { get; set; } = "microsoft.graph"; public GenerationLanguage Language { get; set; } = GenerationLanguage.CSharp; public string ApiRootUrl { get; set; } = "https://graph.microsoft.com/v1.0"; 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"); From 5df37c56e19ddfab01d059c023ba3496cc4f574a Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 3 Jun 2021 08:13:38 -0400 Subject: [PATCH 2/3] - adds changelog entry for namespace name default change --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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 From 4f5cdf98648de3aad794d506e779a6b987c0d3e7 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 3 Jun 2021 08:14:07 -0400 Subject: [PATCH 3/3] - removes unused property --- src/Kiota.Builder/GenerationConfiguration.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Kiota.Builder/GenerationConfiguration.cs b/src/Kiota.Builder/GenerationConfiguration.cs index b92efadd69..66721c76b5 100644 --- a/src/Kiota.Builder/GenerationConfiguration.cs +++ b/src/Kiota.Builder/GenerationConfiguration.cs @@ -6,7 +6,6 @@ public class GenerationConfiguration { public string OutputPath { get; set; } = "./output"; public string ClientClassName { get; set; } = "ApiClient"; public string ClientNamespaceName { get; set; } = "ApiClient"; - public string SchemaRootNamespaceName { get; set; } = "microsoft.graph"; 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."};