diff --git a/README.md b/README.md index 1ce40d46ad..dc68d45b0d 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,15 @@ The following table provides an overview of the languages supported by Kiota and | Language | Generation | Abstractions | Serialization | Authentication | HTTP | Required tools & dependencies | | -------- | ---------- |--------------------------------|-----------------------------------------------------------------| -------------- | ---- | -------------- | -| CSharp | [✔](https://github.com/microsoft/kiota/projects/5) | [✔](https://github.com/microsoft/kiota-abstractions-dotnet) | [JSON](https://github.com/microsoft/kiota-serialization-json-dotnet), [TEXT](https://github.com/microsoft/kiota-serialization-text-dotnet) | [Anonymous](https://github.com/microsoft/kiota-abstractions-dotnet/blob/main/src/authentication/AnonymousAuthenticationProvider.cs), [API Key](https://github.com/microsoft/kiota-abstractions-dotnet/blob/main/src/authentication/ApiKeyAuthenticationProvider.cs), [Azure](https://github.com/microsoft/kiota-authentication-azure-dotnet) | [✔](https://github.com/microsoft/kiota-http-dotnet) | [link](https://microsoft.github.io/kiota/get-started/dotnet) | -| Go | [✔](https://github.com/microsoft/kiota/projects/8) | [✔](https://github.com/microsoft/kiota-abstractions-go) | [JSON](https://github.com/microsoft/kiota-serialization-json-go), [TEXT](https://github.com/microsoft/kiota-serialization-text-go) | [Anonymous](https://github.com/microsoft/kiota-abstractions-go/blob/main/authentication/anonymous_authentication_provider.go), [API Key](https://github.com/microsoft/kiota-abstractions-go/blob/main/authentication/api_key_authentication_provider.go), [Azure](https://github.com/microsoft/kiota-authentication-azure-go/) | [✔](https://github.com/microsoft/kiota-http-go/) | [link](https://microsoft.github.io/kiota/get-started/go) | -| Java | [✔](https://github.com/microsoft/kiota/projects/7) | [✔](https://github.com/microsoft/kiota-java/tree/main/components/abstractions) | [JSON](https://github.com/microsoft/kiota-java/tree/main/components/serialization/json), [TEXT](https://github.com/microsoft/kiota-java/tree/main/components/serialization/text) | [Anonymous](https://github.com/microsoft/kiota-java/blob/main/components/abstractions/src/main/java/com/microsoft/kiota/authentication/AnonymousAuthenticationProvider.java), [API Key](https://github.com/microsoft/kiota-java/blob/main/components/abstractions/src/main/java/com/microsoft/kiota/authentication/ApiKeyAuthenticationProvider.java), [Azure](https://github.com/microsoft/kiota-java/tree/main/components/authentication/azure) | [✔](https://github.com/microsoft/kiota-java/tree/main/components/http/okHttp) | [link](https://microsoft.github.io/kiota/get-started/java) | -| PHP | [✔](https://github.com/microsoft/kiota/projects/4) | [✔](https://github.com/microsoft/kiota-abstractions-php) | [JSON](https://github.com/microsoft/kiota-serialization-json-php), [TEXT](https://github.com/microsoft/kiota-serialization-text-php) | [Anonymous](https://github.com/microsoft/kiota-abstractions-php/blob/main/src/Authentication/AnonymousAuthenticationProvider.php), [✔️ PHP League](https://github.com/microsoft/kiota-authentication-phpleague-php) | [✔](https://github.com/microsoft/kiota-http-guzzle-php) | [link](https://microsoft.github.io/kiota/get-started/php) | -| Python | [✔](https://github.com/microsoft/kiota/projects/3) | [✔](https://github.com/microsoft/kiota-abstractions-python) | [JSON](https://github.com/microsoft/kiota-serialization-json-python), [TEXT](https://github.com/microsoft/kiota-serialization-text-python) | [Anonymous](https://github.com/microsoft/kiota-abstractions-python/blob/main/kiota_abstractions/authentication/anonymous_authentication_provider.py), [Azure](https://github.com/microsoft/kiota-authentication-azure-python) | [✔](https://github.com/microsoft/kiota-http-python) | [link](https://microsoft.github.io/kiota/get-started/python) | -| Ruby | [✔](https://github.com/microsoft/kiota/projects/6) | [✔](./abstractions/ruby) | [JSON](./serialization/ruby/json/microsoft_kiota_serialization), [❌ TEXT](https://github.com/microsoft/kiota/issues/1049) | [Anonymous](./abstractions/ruby/microsoft_kiota_abstractions/lib/microsoft_kiota_abstractions/authentication/anonymous_authentication_provider.rb), [❌ Azure](https://github.com/microsoft/kiota/issues/421) | [✔](./http/ruby/nethttp/microsoft_kiota_nethttplibrary)| [link](https://microsoft.github.io/kiota/get-started/ruby) | -| TypeScript/JavaScript | [✔](https://github.com/microsoft/kiota/projects/2) | [✔](https://github.com/microsoft/kiota-typescript/tree/main/packages/abstractions) | [JSON](https://github.com/microsoft/kiota-typescript/tree/main/packages/serialization/json), [TEXT](https://github.com/microsoft/kiota-typescript/tree/main/packages/serialization/text) | [Anonymous](https://github.com/microsoft/kiota-typescript/blob/main/packages/abstractions/src/authentication/anonymousAuthenticationProvider.ts), [API Key](https://github.com/microsoft/kiota-typescript/blob/main/packages/abstractions/src/authentication/apiKeyAuthenticationProvider.ts), [Azure](https://github.com/microsoft/kiota-typescript/tree/main/packages/authentication/azure) | [✔](https://github.com/microsoft/kiota-typescript/tree/main/packages/http/fetch) | [link](https://microsoft.github.io/kiota/get-started/typescript) | -| Shell | [✔](https://github.com/microsoft/kiota/projects/10) | [✔](./abstractions/dotnet), [✔](https://github.com/microsoft/kiota-cli-commons) | [JSON](./serialization/dotnet/json), [TEXT](./serialization/dotnet/text) | [Anonymous](./abstractions/dotnet/src/authentication/AnonymousAuthenticationProvider.cs), [Azure](./authentication/dotnet/azure) | [✔](./http/dotnet/httpclient) | [link](https://microsoft.github.io/kiota/get-started/dotnet) | -| Swift | [▶](https://github.com/microsoft/kiota/issues/1449) | [✔](./abstractions/swift) | [❌ JSON](https://github.com/microsoft/kiota/issues/1451), [❌ TEXT](https://github.com/microsoft/kiota/issues/1452) | [Anonymous](./abstractions/swift/Source/MicrosoftKiotaAbstractions/Authentication/AnonymousAuthenticationProvider.swift), [❌ Azure](https://github.com/microsoft/kiota/issues/1453) | [❌](https://github.com/microsoft/kiota/issues/1454)| | +| CSharp | [✔](https://github.com/microsoft/kiota/projects/5) | [✔](https://github.com/microsoft/kiota-abstractions-dotnet) | [FORM](https://github.com/microsoft/kiota-serialization-form-dotnet), [JSON](https://github.com/microsoft/kiota-serialization-json-dotnet), [TEXT](https://github.com/microsoft/kiota-serialization-text-dotnet) | [Anonymous](https://github.com/microsoft/kiota-abstractions-dotnet/blob/main/src/authentication/AnonymousAuthenticationProvider.cs), [API Key](https://github.com/microsoft/kiota-abstractions-dotnet/blob/main/src/authentication/ApiKeyAuthenticationProvider.cs), [Azure](https://github.com/microsoft/kiota-authentication-azure-dotnet) | [✔](https://github.com/microsoft/kiota-http-dotnet) | [link](https://microsoft.github.io/kiota/get-started/dotnet) | +| Go | [✔](https://github.com/microsoft/kiota/projects/8) | [✔](https://github.com/microsoft/kiota-abstractions-go) | [FORM](https://github.com/microsoft/kiota-serialization-form-go), [JSON](https://github.com/microsoft/kiota-serialization-json-go), [TEXT](https://github.com/microsoft/kiota-serialization-text-go) | [Anonymous](https://github.com/microsoft/kiota-abstractions-go/blob/main/authentication/anonymous_authentication_provider.go), [API Key](https://github.com/microsoft/kiota-abstractions-go/blob/main/authentication/api_key_authentication_provider.go), [Azure](https://github.com/microsoft/kiota-authentication-azure-go/) | [✔](https://github.com/microsoft/kiota-http-go/) | [link](https://microsoft.github.io/kiota/get-started/go) | +| Java | [✔](https://github.com/microsoft/kiota/projects/7) | [✔](https://github.com/microsoft/kiota-java/tree/main/components/abstractions) | [FORM](https://github.com/microsoft/kiota-java/tree/main/components/serialization/form), [JSON](https://github.com/microsoft/kiota-java/tree/main/components/serialization/json), [TEXT](https://github.com/microsoft/kiota-java/tree/main/components/serialization/text) | [Anonymous](https://github.com/microsoft/kiota-java/blob/main/components/abstractions/src/main/java/com/microsoft/kiota/authentication/AnonymousAuthenticationProvider.java), [API Key](https://github.com/microsoft/kiota-java/blob/main/components/abstractions/src/main/java/com/microsoft/kiota/authentication/ApiKeyAuthenticationProvider.java), [Azure](https://github.com/microsoft/kiota-java/tree/main/components/authentication/azure) | [✔](https://github.com/microsoft/kiota-java/tree/main/components/http/okHttp) | [link](https://microsoft.github.io/kiota/get-started/java) | +| PHP | [✔](https://github.com/microsoft/kiota/projects/4) | [✔](https://github.com/microsoft/kiota-abstractions-php) | [JSON](https://github.com/microsoft/kiota-serialization-json-php), [❌ FORM](https://github.com/microsoft/kiota/issues/2074), [TEXT](https://github.com/microsoft/kiota-serialization-text-php) | [Anonymous](https://github.com/microsoft/kiota-abstractions-php/blob/main/src/Authentication/AnonymousAuthenticationProvider.php), [✔️ PHP League](https://github.com/microsoft/kiota-authentication-phpleague-php) | [✔](https://github.com/microsoft/kiota-http-guzzle-php) | [link](https://microsoft.github.io/kiota/get-started/php) | +| Python | [✔](https://github.com/microsoft/kiota/projects/3) | [✔](https://github.com/microsoft/kiota-abstractions-python) | [❌ FORM](https://github.com/microsoft/kiota/issues/2075), [JSON](https://github.com/microsoft/kiota-serialization-json-python), [TEXT](https://github.com/microsoft/kiota-serialization-text-python) | [Anonymous](https://github.com/microsoft/kiota-abstractions-python/blob/main/kiota_abstractions/authentication/anonymous_authentication_provider.py), [Azure](https://github.com/microsoft/kiota-authentication-azure-python) | [✔](https://github.com/microsoft/kiota-http-python) | [link](https://microsoft.github.io/kiota/get-started/python) | +| Ruby | [✔](https://github.com/microsoft/kiota/projects/6) | [✔](./abstractions/ruby) | [❌ FORM](https://github.com/microsoft/kiota/issues/2077), [JSON](./serialization/ruby/json/microsoft_kiota_serialization), [❌ TEXT](https://github.com/microsoft/kiota/issues/1049) | [Anonymous](./abstractions/ruby/microsoft_kiota_abstractions/lib/microsoft_kiota_abstractions/authentication/anonymous_authentication_provider.rb), [❌ Azure](https://github.com/microsoft/kiota/issues/421) | [✔](./http/ruby/nethttp/microsoft_kiota_nethttplibrary)| [link](https://microsoft.github.io/kiota/get-started/ruby) | +| Shell | [✔](https://github.com/microsoft/kiota/projects/10) | (see CSHarp) + [✔](https://github.com/microsoft/kiota-cli-commons) | (see CSHarp) | (see CSharp) | (see CSharp) | [link](https://microsoft.github.io/kiota/get-started/cli) | +| Swift | [▶](https://github.com/microsoft/kiota/issues/1449) | [✔](./abstractions/swift) | [❌ FORM](https://github.com/microsoft/kiota/issues/2076), [❌ JSON](https://github.com/microsoft/kiota/issues/1451), [❌ TEXT](https://github.com/microsoft/kiota/issues/1452) | [Anonymous](./abstractions/swift/Source/MicrosoftKiotaAbstractions/Authentication/AnonymousAuthenticationProvider.swift), [❌ Azure](https://github.com/microsoft/kiota/issues/1453) | [❌](https://github.com/microsoft/kiota/issues/1454)| | +| TypeScript/JavaScript | [✔](https://github.com/microsoft/kiota/projects/2) | [✔](https://github.com/microsoft/kiota-typescript/tree/main/packages/abstractions) | [FORM](https://github.com/microsoft/kiota-typescript/tree/main/packages/serialization/form), [JSON](https://github.com/microsoft/kiota-typescript/tree/main/packages/serialization/json), [TEXT](https://github.com/microsoft/kiota-typescript/tree/main/packages/serialization/text) | [Anonymous](https://github.com/microsoft/kiota-typescript/blob/main/packages/abstractions/src/authentication/anonymousAuthenticationProvider.ts), [API Key](https://github.com/microsoft/kiota-typescript/blob/main/packages/abstractions/src/authentication/apiKeyAuthenticationProvider.ts), [Azure](https://github.com/microsoft/kiota-typescript/tree/main/packages/authentication/azure) | [✔](https://github.com/microsoft/kiota-typescript/tree/main/packages/http/fetch) | [link](https://microsoft.github.io/kiota/get-started/typescript) | > Legend: ✔ -> in preview, ❌ -> not started, ▶ -> in progress. diff --git a/docs/using.md b/docs/using.md index 90b8f3a65a..01ce42c4a2 100644 --- a/docs/using.md +++ b/docs/using.md @@ -244,11 +244,11 @@ The fully qualified class names for deserializers. Defaults to the following val | Language | Default deserializers | |------------|-----------------------------------------------------------------| -| C# | `Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory`, `Microsoft.Kiota.Serialization.Text.TextParseNodeFactory` | -| Go | `github.com/microsoft/kiota-serialization-json-go/json.JsonParseNodeFactory`, `github.com/microsoft/kiota-serialization-text-go/text.TextParseNodeFactory` | -| Java | `com.microsoft.kiota.serialization.JsonParseNodeFactory`, `com.microsoft.kiota.serialization.TextParseNodeFactory` | +| C# | `Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory`, `Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory`, `Microsoft.Kiota.Serialization.Text.TextParseNodeFactory` | +| Go | `github.com/microsoft/kiota-serialization-form-go/FormParseNodeFactory`, `github.com/microsoft/kiota-serialization-json-go/JsonParseNodeFactory`, `github.com/microsoft/kiota-serialization-text-go/TextParseNodeFactory` | +| Java | `com.microsoft.kiota.serialization.TextParseNodeFactory`, `com.microsoft.kiota.serialization.JsonParseNodeFactory`, `com.microsoft.kiota.serialization.TextParseNodeFactory` | | Ruby | `microsoft_kiota_serialization/json_parse_node_factory` | -| TypeScript | `@microsoft/kiota-serialization-json.JsonParseNodeFactory`, `@microsoft/kiota-serialization-text.TextParseNodeFactory` | +| TypeScript | `@microsoft/kiota-serialization-form.FormParseNodeFactory`, `@microsoft/kiota-serialization-json.JsonParseNodeFactory`, `@microsoft/kiota-serialization-text.TextParseNodeFactory` | ##### Accepted values @@ -308,11 +308,11 @@ The fully qualified class names for deserializers. Defaults to the following val | Language | Default deserializer | |------------|-----------------------------------------------------------------| -| C# | `Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory`, `Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory` | -| Go | `github.com/microsoft/kiota-serialization-json-go/json.JsonSerializationWriterFactory`, `github.com/microsoft/kiota-serialization-text-go/text.TextSerializationWriterFactory` | -| Java | `com.microsoft.kiota.serialization.JsonSerializationWriterFactory`, `com.microsoft.kiota.serialization.TextSerializationWriterFactory` | +| C# | `Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory`, `Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory`, `Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory` | +| Go | `github.com/microsoft/kiota-serialization-form-go/FormSerializationWriterFactory`, `github.com/microsoft/kiota-serialization-json-go/JsonSerializationWriterFactory`, `github.com/microsoft/kiota-serialization-text-go/TextSerializationWriterFactory` | +| Java | `com.microsoft.kiota.serialization.FormSerializationWriterFactory`, `com.microsoft.kiota.serialization.JsonSerializationWriterFactory`, `com.microsoft.kiota.serialization.TextSerializationWriterFactory` | | Ruby | `microsoft_kiota_serialization/json_serialization_writer_factory` | -| TypeScript | `@microsoft/kiota-serialization-json.JsonSerializationWriterFactory`, `@microsoft/kiota-serialization-text.TextSerializationWriterFactory` | +| TypeScript | `@microsoft/kiota-serialization-form.FormSerializationWriterFactory`, `@microsoft/kiota-serialization-json.JsonSerializationWriterFactory`, `@microsoft/kiota-serialization-text.TextSerializationWriterFactory` | ##### Accepted values @@ -329,10 +329,8 @@ The MIME types to use for structured data model generation. Accepts multiple val Default values : - `application/json` -- `application/xml` +- `application/x-www-form-urlencoded` - `text/plain` -- `text/xml` -- `text/yaml` > Note: Only request body types or response types with a defined schema will generate models, other entries will default back to stream/byte array. diff --git a/serialization/README.md b/serialization/README.md index f5468049d6..9a71dc0809 100644 --- a/serialization/README.md +++ b/serialization/README.md @@ -12,6 +12,13 @@ Your project will need a reference to the abstraction package to build and run, - [PHP](https://github.com/microsoft/kiota-serialization-json-php) : relies on the native JSON capabilities for JSON deserialization - [Python](https://github.com/microsoft/kiota-serialization-json-python) : relies on the native JSON capabilities. +## Application/x-www-form-urlencoded + +- [Dotnet](https://github.com/microsoft/kiota-serialization-form-dotnet). +- [Go](https://github.com/microsoft/kiota-serialization-form-go). +- [Java](https://github.com/microsoft/kiota-java/tree/main/components/serialization/form). +- [TypeScript](https://github.com/microsoft/kiota-typescript/tree/main/packages/serialization/form). + ## Text/plain - [Dotnet](https://github.com/microsoft/kiota-serialization-text-dotnet) diff --git a/src/Kiota.Builder/Configuration/GenerationConfiguration.cs b/src/Kiota.Builder/Configuration/GenerationConfiguration.cs index 6820a34ff2..3b7092a413 100644 --- a/src/Kiota.Builder/Configuration/GenerationConfiguration.cs +++ b/src/Kiota.Builder/Configuration/GenerationConfiguration.cs @@ -16,11 +16,13 @@ public class GenerationConfiguration : ICloneable { public bool IncludeAdditionalData { get; set; } = true; public HashSet Serializers { get; set; } = new(2, StringComparer.OrdinalIgnoreCase){ "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory", - "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory" + "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory", }; public HashSet Deserializers { get; set; } = new(2, StringComparer.OrdinalIgnoreCase) { "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory", - "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory" + "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", + "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory", }; public bool ShouldWriteNamespaceIndices { get { return BarreledLanguages.Contains(Language); } } public bool ShouldWriteBarrelsIfClassExists { get { return BarreledLanguagesWithConstantFileName.Contains(Language); } } @@ -39,10 +41,8 @@ public class GenerationConfiguration : ICloneable { public bool CleanOutput { get; set;} public HashSet StructuredMimeTypes { get; set; } = new(5, StringComparer.OrdinalIgnoreCase) { "application/json", - "application/xml", "text/plain", - "text/xml", - "text/yaml", + "application/x-www-form-urlencoded", }; public HashSet IncludePatterns { get; set; } = new(0, StringComparer.OrdinalIgnoreCase); public HashSet ExcludePatterns { get; set; } = new(0, StringComparer.OrdinalIgnoreCase); diff --git a/src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs b/src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs index a493137232..4087cd39ef 100644 --- a/src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs +++ b/src/Kiota.Builder/Refiners/CommonLanguageRefiner.cs @@ -20,10 +20,8 @@ protected CommonLanguageRefiner(GenerationConfiguration configuration) { /// It also updates the module names to replace the fully qualified class name by the class name without the namespace. /// protected void AddSerializationModulesImport(CodeElement generatedCode, string[] serializationWriterFactoryInterfaceAndRegistrationFullName = default, string[] parseNodeFactoryInterfaceAndRegistrationFullName = default, char separator = '.') { - if(serializationWriterFactoryInterfaceAndRegistrationFullName == null) - serializationWriterFactoryInterfaceAndRegistrationFullName = Array.Empty(); - if(parseNodeFactoryInterfaceAndRegistrationFullName == null) - parseNodeFactoryInterfaceAndRegistrationFullName = Array.Empty(); + serializationWriterFactoryInterfaceAndRegistrationFullName ??= Array.Empty(); + parseNodeFactoryInterfaceAndRegistrationFullName ??= Array.Empty(); if(generatedCode is CodeMethod currentMethod && currentMethod.IsOfKind(CodeMethodKind.ClientConstructor) && currentMethod.Parent is CodeClass currentClass && @@ -62,7 +60,7 @@ private static bool ReplaceSerializationModules(CodeElement generatedCode, Func< currentMethod.IsOfKind(CodeMethodKind.ClientConstructor)) { var modules = propertyGetter.Invoke(currentMethod); if(modules.Count == initialNames.Count && - modules.All(x => initialNames.Contains(x))) { + modules.All(initialNames.Contains)) { propertySetter.Invoke(currentMethod, moduleNames); return true; } diff --git a/src/Kiota.Builder/Refiners/GoRefiner.cs b/src/Kiota.Builder/Refiners/GoRefiner.cs index 447f25b68d..4737d95809 100644 --- a/src/Kiota.Builder/Refiners/GoRefiner.cs +++ b/src/Kiota.Builder/Refiners/GoRefiner.cs @@ -99,13 +99,17 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance defaultConfiguration.Serializers, new (StringComparer.OrdinalIgnoreCase) { "github.com/microsoft/kiota-serialization-json-go.JsonSerializationWriterFactory", - "github.com/microsoft/kiota-serialization-text-go.TextSerializationWriterFactory"}); + "github.com/microsoft/kiota-serialization-text-go.TextSerializationWriterFactory", + "github.com/microsoft/kiota-serialization-form-go.FormSerializationWriterFactory", + }); ReplaceDefaultDeserializationModules( generatedCode, defaultConfiguration.Deserializers, new (StringComparer.OrdinalIgnoreCase) { "github.com/microsoft/kiota-serialization-json-go.JsonParseNodeFactory", - "github.com/microsoft/kiota-serialization-text-go.TextParseNodeFactory"}); + "github.com/microsoft/kiota-serialization-text-go.TextParseNodeFactory", + "github.com/microsoft/kiota-serialization-form-go.FormParseNodeFactory", + }); AddSerializationModulesImport( generatedCode, new[] {"github.com/microsoft/kiota-abstractions-go/serialization.SerializationWriterFactory", "github.com/microsoft/kiota-abstractions-go.RegisterDefaultSerializer"}, diff --git a/src/Kiota.Builder/Refiners/JavaRefiner.cs b/src/Kiota.Builder/Refiners/JavaRefiner.cs index 7dae71f628..910317cf33 100644 --- a/src/Kiota.Builder/Refiners/JavaRefiner.cs +++ b/src/Kiota.Builder/Refiners/JavaRefiner.cs @@ -57,14 +57,18 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance defaultConfiguration.Serializers, new (StringComparer.OrdinalIgnoreCase) { "com.microsoft.kiota.serialization.JsonSerializationWriterFactory", - "com.microsoft.kiota.serialization.TextSerializationWriterFactory"} + "com.microsoft.kiota.serialization.TextSerializationWriterFactory", + "com.microsoft.kiota.serialization.FormSerializationWriterFactory", + } ); ReplaceDefaultDeserializationModules( generatedCode, defaultConfiguration.Deserializers, new (StringComparer.OrdinalIgnoreCase) { "com.microsoft.kiota.serialization.JsonParseNodeFactory", - "com.microsoft.kiota.serialization.TextParseNodeFactory"} + "com.microsoft.kiota.serialization.FormParseNodeFactory", + "com.microsoft.kiota.serialization.TextParseNodeFactory" + } ); AddSerializationModulesImport(generatedCode, new [] { "com.microsoft.kiota.ApiClientBuilder", diff --git a/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs b/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs index 85be54b80c..0ca8039aa5 100644 --- a/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs +++ b/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs @@ -52,7 +52,8 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance defaultConfiguration.Serializers, new (StringComparer.OrdinalIgnoreCase) { "@microsoft/kiota-serialization-json.JsonSerializationWriterFactory", - "@microsoft/kiota-serialization-text.TextSerializationWriterFactory" + "@microsoft/kiota-serialization-text.TextSerializationWriterFactory", + "@microsoft/kiota-serialization-form.FormSerializationWriterFactory", } ); ReplaceDefaultDeserializationModules( @@ -60,7 +61,8 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance defaultConfiguration.Deserializers, new (StringComparer.OrdinalIgnoreCase) { "@microsoft/kiota-serialization-json.JsonParseNodeFactory", - "@microsoft/kiota-serialization-text.TextParseNodeFactory" + "@microsoft/kiota-serialization-text.TextParseNodeFactory", + "@microsoft/kiota-serialization-form.FormParseNodeFactory", } ); AddSerializationModulesImport(generatedCode, diff --git a/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/BasicError.cs b/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/BasicError.cs index ac5f94cdd7..4a5690348d 100644 --- a/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/BasicError.cs +++ b/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/BasicError.cs @@ -14,7 +14,7 @@ public class BasicError : ApiException, IAdditionalDataHolder, IParsable { /// The documentation_url property public string Documentation_url { get; set; } /// The message property - public string Message { get; set; } + public new string Message { get; set; } /// The status property public string Status { get; set; } /// The url property diff --git a/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/FileCommit503Error.cs b/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/FileCommit503Error.cs index 58ffafb969..a93212083f 100644 --- a/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/FileCommit503Error.cs +++ b/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/FileCommit503Error.cs @@ -13,7 +13,7 @@ public class FileCommit503Error : ApiException, IAdditionalDataHolder, IParsable /// The documentation_url property public string Documentation_url { get; set; } /// The message property - public string Message { get; set; } + public new string Message { get; set; } /// /// Instantiates a new FileCommit503Error and sets the default values. /// diff --git a/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/Repositories503Error.cs b/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/Repositories503Error.cs index 65a9324be1..ebde27bc90 100644 --- a/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/Repositories503Error.cs +++ b/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/Repositories503Error.cs @@ -13,7 +13,7 @@ public class Repositories503Error : ApiException, IAdditionalDataHolder, IParsab /// The documentation_url property public string Documentation_url { get; set; } /// The message property - public string Message { get; set; } + public new string Message { get; set; } /// /// Instantiates a new repositories503Error and sets the default values. /// diff --git a/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/ValidationError.cs b/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/ValidationError.cs index 51b9430ad9..1cf22217b0 100644 --- a/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/ValidationError.cs +++ b/src/Kiota.Builder/SearchProviders/GitHub/GitHubClient/Models/ValidationError.cs @@ -16,7 +16,7 @@ public class ValidationError : ApiException, IAdditionalDataHolder, IParsable { /// The errors property public List Errors { get; set; } /// The message property - public string Message { get; set; } + public new string Message { get; set; } /// /// Instantiates a new ValidationError and sets the default values. /// diff --git a/src/Kiota.Web/wwwroot/appsettings.json b/src/Kiota.Web/wwwroot/appsettings.json index d3d87e3aa0..034181dfb5 100644 --- a/src/Kiota.Web/wwwroot/appsettings.json +++ b/src/Kiota.Web/wwwroot/appsettings.json @@ -1,8 +1,7 @@ { "Generation": { "IgnoredRequestContentTypes": [ - "multipart/form-data", - "application/x-www-form-urlencoded" + "multipart/form-data" ] }, "Search": { @@ -24,37 +23,45 @@ "Dependencies": [ { "Name": "Microsoft.Kiota.Abstractions", - "Version": "1.0.0-preview.17" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Http.HttpClientLibrary", - "Version": "1.0.0-preview.11" + "Version": "1.0.0-rc.1" + }, + { + "Name": "Microsoft.Kiota.Serialization.Form", + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Serialization.Json", - "Version": "1.0.0-preview.7" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Authentication.Azure", - "Version": "1.0.0-preview.4" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Serialization.Text", - "Version": "1.0.0-preview.4" + "Version": "1.0.0-rc.1" } ], - "DependencyInstallCommand": "dotnet add package {0} --version {1}" + "DependencyInstallCommand": "dotnet add package {0} --version {1} --prerelease" }, "Java": { "MaturityLevel": "Preview", "Dependencies": [ { "Name": "com.microsoft.kiota:microsoft-kiota-abstractions", - "Version": "0.0.10-SNAPSHOT" + "Version": "0.0.11-SNAPSHOT" }, { "Name": "com.microsoft.kiota:microsoft-kiota-http-okHttp", - "Version": "0.0.8-SNAPSHOT" + "Version": "0.0.9-SNAPSHOT" + }, + { + "Name": "com.microsoft.kiota:microsoft-kiota-serialization-form", + "Version": "0.0.1-SNAPSHOT" }, { "Name": "com.microsoft.kiota:microsoft-kiota-serialization-json", @@ -76,11 +83,15 @@ "Dependencies": [ { "Name": "github.com/microsoft/kiota-abstractions-go", - "Version": "v0.14.0" + "Version": "v0.15.1" }, { "Name": "github.com/microsoft/kiota-http-go", - "Version": "v0.9.0" + "Version": "v0.10.0" + }, + { + "Name": "github.com/microsoft/kiota-serialization-form-go", + "Version": "v0.1.0" }, { "Name": "github.com/microsoft/kiota-serialization-json-go", @@ -102,23 +113,27 @@ "Dependencies": [ { "Name": "@microsoft/kiota-abstractions", - "Version": "1.0.0-preview.8" + "Version": "1.0.0-preview.10" }, { "Name": "@microsoft/kiota-http-fetchlibrary", - "Version": "1.0.0-preview.9" + "Version": "1.0.0-preview.10" + }, + { + "Name": "@microsoft/kiota-serialization-form", + "Version": "1.0.0-preview.2" }, { "Name": "@microsoft/kiota-serialization-json", - "Version": "1.0.0-preview.9" + "Version": "1.0.0-preview.10" }, { "Name": "@microsoft/kiota-authentication-azure", - "Version": "1.0.0-preview.6" + "Version": "1.0.0-preview.10" }, { "Name": "@microsoft/kiota-serialization-text", - "Version": "1.0.0-preview.8" + "Version": "1.0.0-preview.10" } ], "DependencyInstallCommand": "npm install {0}@{1} -S" @@ -128,45 +143,45 @@ "Dependencies": [ { "Name": "microsoft/kiota-abstractions", - "Version": "0.3.0" + "Version": "0.4.3" }, { "Name": "microsoft/kiota-http-guzzle", - "Version": "0.3.1" + "Version": "0.4.1" }, { "Name": "microsoft/kiota-serialization-json", - "Version": "0.2.1" + "Version": "0.3.0" }, { "Name": "microsoft/kiota-authentication-phpleague", - "Version": "0.3.0" + "Version": "0.4.0" }, { "Name": "microsoft/kiota-serialization-text", - "Version": "0.2.1" + "Version": "0.3.0" } ], "DependencyInstallCommand": "composer require {0}:{1}" }, "Python": { - "MaturityLevel": "Experimental", + "MaturityLevel": "Preview", "Dependencies": [ { "Name": "microsoft-kiota-abstractions", - "Version": "0.1.0" + "Version": "0.2.2" }, { "Name": "microsoft-kiota-http", - "Version": "0.1.0" + "Version": "0.2.3" }, { "Name": "microsoft-kiota-serialization-json", - "Version": "0.2.0" + "Version": "0.2.1" }, { "Name": "microsoft-kiota-authentication-azure", - "Version": "0.1.0" + "Version": "0.2.0" }, { "Name": "microsoft-kiota-serialization-text", @@ -207,23 +222,27 @@ "Dependencies": [ { "Name": "Microsoft.Kiota.Abstractions", - "Version": "1.0.0-preview.15" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Http.HttpClientLibrary", - "Version": "1.0.0-preview.11" + "Version": "1.0.0-rc.1" + }, + { + "Name": "Microsoft.Kiota.Serialization.Form", + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Serialization.Json", - "Version": "1.0.0-preview.7" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Authentication.Azure", - "Version": "1.0.0-preview.4" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Serialization.Text", - "Version": "1.0.0-preview.4" + "Version": "1.0.0-rc.1" }, { "Name": " Microsoft.Kiota.Cli.Commons", diff --git a/src/kiota/appsettings.json b/src/kiota/appsettings.json index d3d87e3aa0..034181dfb5 100644 --- a/src/kiota/appsettings.json +++ b/src/kiota/appsettings.json @@ -1,8 +1,7 @@ { "Generation": { "IgnoredRequestContentTypes": [ - "multipart/form-data", - "application/x-www-form-urlencoded" + "multipart/form-data" ] }, "Search": { @@ -24,37 +23,45 @@ "Dependencies": [ { "Name": "Microsoft.Kiota.Abstractions", - "Version": "1.0.0-preview.17" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Http.HttpClientLibrary", - "Version": "1.0.0-preview.11" + "Version": "1.0.0-rc.1" + }, + { + "Name": "Microsoft.Kiota.Serialization.Form", + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Serialization.Json", - "Version": "1.0.0-preview.7" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Authentication.Azure", - "Version": "1.0.0-preview.4" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Serialization.Text", - "Version": "1.0.0-preview.4" + "Version": "1.0.0-rc.1" } ], - "DependencyInstallCommand": "dotnet add package {0} --version {1}" + "DependencyInstallCommand": "dotnet add package {0} --version {1} --prerelease" }, "Java": { "MaturityLevel": "Preview", "Dependencies": [ { "Name": "com.microsoft.kiota:microsoft-kiota-abstractions", - "Version": "0.0.10-SNAPSHOT" + "Version": "0.0.11-SNAPSHOT" }, { "Name": "com.microsoft.kiota:microsoft-kiota-http-okHttp", - "Version": "0.0.8-SNAPSHOT" + "Version": "0.0.9-SNAPSHOT" + }, + { + "Name": "com.microsoft.kiota:microsoft-kiota-serialization-form", + "Version": "0.0.1-SNAPSHOT" }, { "Name": "com.microsoft.kiota:microsoft-kiota-serialization-json", @@ -76,11 +83,15 @@ "Dependencies": [ { "Name": "github.com/microsoft/kiota-abstractions-go", - "Version": "v0.14.0" + "Version": "v0.15.1" }, { "Name": "github.com/microsoft/kiota-http-go", - "Version": "v0.9.0" + "Version": "v0.10.0" + }, + { + "Name": "github.com/microsoft/kiota-serialization-form-go", + "Version": "v0.1.0" }, { "Name": "github.com/microsoft/kiota-serialization-json-go", @@ -102,23 +113,27 @@ "Dependencies": [ { "Name": "@microsoft/kiota-abstractions", - "Version": "1.0.0-preview.8" + "Version": "1.0.0-preview.10" }, { "Name": "@microsoft/kiota-http-fetchlibrary", - "Version": "1.0.0-preview.9" + "Version": "1.0.0-preview.10" + }, + { + "Name": "@microsoft/kiota-serialization-form", + "Version": "1.0.0-preview.2" }, { "Name": "@microsoft/kiota-serialization-json", - "Version": "1.0.0-preview.9" + "Version": "1.0.0-preview.10" }, { "Name": "@microsoft/kiota-authentication-azure", - "Version": "1.0.0-preview.6" + "Version": "1.0.0-preview.10" }, { "Name": "@microsoft/kiota-serialization-text", - "Version": "1.0.0-preview.8" + "Version": "1.0.0-preview.10" } ], "DependencyInstallCommand": "npm install {0}@{1} -S" @@ -128,45 +143,45 @@ "Dependencies": [ { "Name": "microsoft/kiota-abstractions", - "Version": "0.3.0" + "Version": "0.4.3" }, { "Name": "microsoft/kiota-http-guzzle", - "Version": "0.3.1" + "Version": "0.4.1" }, { "Name": "microsoft/kiota-serialization-json", - "Version": "0.2.1" + "Version": "0.3.0" }, { "Name": "microsoft/kiota-authentication-phpleague", - "Version": "0.3.0" + "Version": "0.4.0" }, { "Name": "microsoft/kiota-serialization-text", - "Version": "0.2.1" + "Version": "0.3.0" } ], "DependencyInstallCommand": "composer require {0}:{1}" }, "Python": { - "MaturityLevel": "Experimental", + "MaturityLevel": "Preview", "Dependencies": [ { "Name": "microsoft-kiota-abstractions", - "Version": "0.1.0" + "Version": "0.2.2" }, { "Name": "microsoft-kiota-http", - "Version": "0.1.0" + "Version": "0.2.3" }, { "Name": "microsoft-kiota-serialization-json", - "Version": "0.2.0" + "Version": "0.2.1" }, { "Name": "microsoft-kiota-authentication-azure", - "Version": "0.1.0" + "Version": "0.2.0" }, { "Name": "microsoft-kiota-serialization-text", @@ -207,23 +222,27 @@ "Dependencies": [ { "Name": "Microsoft.Kiota.Abstractions", - "Version": "1.0.0-preview.15" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Http.HttpClientLibrary", - "Version": "1.0.0-preview.11" + "Version": "1.0.0-rc.1" + }, + { + "Name": "Microsoft.Kiota.Serialization.Form", + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Serialization.Json", - "Version": "1.0.0-preview.7" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Authentication.Azure", - "Version": "1.0.0-preview.4" + "Version": "1.0.0-rc.1" }, { "Name": "Microsoft.Kiota.Serialization.Text", - "Version": "1.0.0-preview.4" + "Version": "1.0.0-rc.1" }, { "Name": " Microsoft.Kiota.Cli.Commons", diff --git a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs index aee282cc25..d05348bd5e 100644 --- a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs +++ b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs @@ -3625,15 +3625,15 @@ public void ModelsUseDescriptionWhenAvailable(){ [InlineData("application/json", "2XX", false, "default", "binary")] [InlineData("application/xml", "204", true, "default", "void")] [InlineData("application/xml", "204", false, "default", "void")] - [InlineData("application/xml", "200", true, "default", "Myobject")] + [InlineData("application/xml", "200", true, "default", "binary")] // MyObject when we support xml deserialization [InlineData("application/xml", "200", false, "default", "binary")] [InlineData("text/xml", "204", true, "default", "void")] [InlineData("text/xml", "204", false, "default", "void")] - [InlineData("text/xml", "200", true, "default", "Myobject")] + [InlineData("text/xml", "200", true, "default", "binary")] // MyObject when we support xml deserialization [InlineData("text/xml", "200", false, "default", "binary")] [InlineData("text/yaml", "204", true, "default", "void")] [InlineData("text/yaml", "204", false, "default", "void")] - [InlineData("text/yaml", "200", true, "default", "Myobject")] + [InlineData("text/yaml", "200", true, "default", "binary")] // MyObject when we support xml deserialization [InlineData("text/yaml", "200", false, "default", "binary")] [InlineData("application/octet-stream", "204", true, "default", "void")] [InlineData("application/octet-stream", "204", false, "default", "void")] @@ -3953,11 +3953,11 @@ public void Considers204WithNoSchemaOver206WithNoSchema() { [InlineData("application/json", true, "default", "Myobject")] [InlineData("application/json", false, "default", "binary")] [InlineData("application/xml", false, "default", "binary")] - [InlineData("application/xml", true, "default", "Myobject")] + [InlineData("application/xml", true, "default", "binary")] //MyObject when we support it [InlineData("text/xml", false, "default", "binary")] - [InlineData("text/xml", true, "default", "Myobject")] + [InlineData("text/xml", true, "default", "binary")] //MyObject when we support it [InlineData("text/yaml", false, "default", "binary")] - [InlineData("text/yaml", true, "default", "Myobject")] + [InlineData("text/yaml", true, "default", "binary")] //MyObject when we support it [InlineData("application/octet-stream", true, "default", "binary")] [InlineData("application/octet-stream", false, "default", "binary")] [InlineData("text/html", true, "default", "binary")]