From 5acd9de205b8c4dbbf5a78879fa32e665c7964cb Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 30 Mar 2023 13:30:07 -0400 Subject: [PATCH 01/20] - removes multi-part form exclusion Signed-off-by: Vincent Biret --- src/kiota/appsettings.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/kiota/appsettings.json b/src/kiota/appsettings.json index 04fe9163c3..b52353eac5 100644 --- a/src/kiota/appsettings.json +++ b/src/kiota/appsettings.json @@ -1,8 +1,6 @@ { "Generation": { - "IgnoredRequestContentTypes": [ - "multipart/form-data" - ], + "IgnoredRequestContentTypes": [], "MaxDegreeOfParallelism": -1 }, "Search": { From 37e77b7cb44157cbcb36af01bf87ea4e927b5607 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 24 Jul 2023 13:54:19 -0400 Subject: [PATCH 02/20] - adds multipart body insertion in the core generation for request body Signed-off-by: Vincent Biret --- .../Configuration/GenerationConfiguration.cs | 8 ++- .../Extensions/OpenApiOperationExtensions.cs | 6 ++ src/Kiota.Builder/KiotaBuilder.cs | 27 +++++++- .../Kiota.Builder.Tests/KiotaBuilderTests.cs | 66 +++++++++++++++++++ 4 files changed, 101 insertions(+), 6 deletions(-) diff --git a/src/Kiota.Builder/Configuration/GenerationConfiguration.cs b/src/Kiota.Builder/Configuration/GenerationConfiguration.cs index b78c46f4e6..8849f05924 100644 --- a/src/Kiota.Builder/Configuration/GenerationConfiguration.cs +++ b/src/Kiota.Builder/Configuration/GenerationConfiguration.cs @@ -33,15 +33,16 @@ public bool UsesBackingStore public HashSet Serializers { get; set; - } = new(2, StringComparer.OrdinalIgnoreCase){ + } = new(4, StringComparer.OrdinalIgnoreCase){ "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory", "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory", "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Multipart.MultipartSerializationWriterFactory" }; public HashSet Deserializers { get; set; - } = new(2, StringComparer.OrdinalIgnoreCase) { + } = new(3, StringComparer.OrdinalIgnoreCase) { "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory", "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory", @@ -85,10 +86,11 @@ public bool CleanOutput public HashSet StructuredMimeTypes { get; set; - } = new(5, StringComparer.OrdinalIgnoreCase) { + } = new(4, StringComparer.OrdinalIgnoreCase) { "application/json", "text/plain", "application/x-www-form-urlencoded", + "multipart/form-data", }; public HashSet IncludePatterns { get; set; } = new(0, StringComparer.OrdinalIgnoreCase); public HashSet ExcludePatterns { get; set; } = new(0, StringComparer.OrdinalIgnoreCase); diff --git a/src/Kiota.Builder/Extensions/OpenApiOperationExtensions.cs b/src/Kiota.Builder/Extensions/OpenApiOperationExtensions.cs index a6f38186fe..20c5106b98 100644 --- a/src/Kiota.Builder/Extensions/OpenApiOperationExtensions.cs +++ b/src/Kiota.Builder/Extensions/OpenApiOperationExtensions.cs @@ -33,6 +33,12 @@ internal static IEnumerable GetResponseSchemas(this OpenApiOperat return operation.RequestBody?.Content .GetValidSchemas(structuredMimeTypes).FirstOrDefault(); } + private static readonly HashSet multipartMimeTypes = new(1, StringComparer.OrdinalIgnoreCase) { "multipart/form-data" }; + public static bool IsMultipartFormDataSchema(this IDictionary source, HashSet structuredMimeTypes) + { + return source.GetValidSchemas(structuredMimeTypes).FirstOrDefault() is OpenApiSchema schema && + source.GetValidSchemas(multipartMimeTypes).FirstOrDefault() == schema; + } public static IEnumerable GetValidSchemas(this IDictionary source, HashSet structuredMimeTypes) { if (!(structuredMimeTypes?.Any() ?? false)) diff --git a/src/Kiota.Builder/KiotaBuilder.cs b/src/Kiota.Builder/KiotaBuilder.cs index bf8546820d..4a4d4d8979 100644 --- a/src/Kiota.Builder/KiotaBuilder.cs +++ b/src/Kiota.Builder/KiotaBuilder.cs @@ -1305,12 +1305,32 @@ private static void AddRequestConfigurationProperties(CodeClass? parameterClass, }); } + private readonly ConcurrentDictionary multipartPropertiesModels = new(); private void AddRequestBuilderMethodParameters(OpenApiUrlTreeNode currentNode, OperationType operationType, OpenApiOperation operation, CodeClass requestConfigClass, CodeMethod method) { if (operation.GetRequestSchema(config.StructuredMimeTypes) is OpenApiSchema requestBodySchema) { - var requestBodyType = CreateModelDeclarations(currentNode, requestBodySchema, operation, method, $"{operationType}RequestBody", isRequestBody: true) ?? - throw new InvalidSchemaException(); + CodeTypeBase requestBodyType; + if (operation.RequestBody.Content.IsMultipartFormDataSchema(config.StructuredMimeTypes)) + { + requestBodyType = new CodeType + { + Name = "MultipartBody", + IsExternal = true, + }; + var mediaType = operation.RequestBody.Content.First(x => x.Value.Schema == requestBodySchema).Value; + foreach (var encodingEntry in mediaType.Encoding + .Where(x => !string.IsNullOrEmpty(x.Value.ContentType) && + config.StructuredMimeTypes.Contains(x.Value.ContentType.Split(';', StringSplitOptions.RemoveEmptyEntries)[0]))) + { + if (CreateModelDeclarations(currentNode, requestBodySchema.Properties[encodingEntry.Key], operation, method, $"{operationType}RequestBody", isRequestBody: true) is CodeType propertyType && + propertyType.TypeDefinition is not null) + multipartPropertiesModels.TryAdd(propertyType.TypeDefinition, true); + } + } + else + requestBodyType = CreateModelDeclarations(currentNode, requestBodySchema, operation, method, $"{operationType}RequestBody", isRequestBody: true) ?? + throw new InvalidSchemaException(); method.AddParameter(new CodeParameter { Name = "body", @@ -1711,7 +1731,7 @@ private void TrimInheritedModels() { if (modelsNamespace is null || rootNamespace is null || modelsNamespace.Parent is not CodeNamespace clientNamespace) return; var reusableModels = GetAllModels(modelsNamespace).ToArray();//to avoid multiple enumerations - var modelsDirectlyInUse = GetTypeDefinitionsInNamespace(rootNamespace).ToArray(); + var modelsDirectlyInUse = GetTypeDefinitionsInNamespace(rootNamespace).Union(multipartPropertiesModels.Keys).ToArray(); var classesDirectlyInUse = modelsDirectlyInUse.OfType().ToHashSet(); var allModelClassesIndex = GetDerivationIndex(GetAllModels(clientNamespace).OfType()); var derivedClassesInUse = GetDerivedDefinitions(allModelClassesIndex, classesDirectlyInUse.ToArray()); @@ -2105,5 +2125,6 @@ private void CleanUpInternalState() foreach (var lifecycle in classLifecycles.Values) lifecycle.Dispose(); classLifecycles.Clear(); + multipartPropertiesModels.Clear(); } } diff --git a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs index 6eb2d8beda..b4b8185ace 100644 --- a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs +++ b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs @@ -6230,4 +6230,70 @@ public async Task CleanupSymbolNameDoesNotCauseNameConflictsInQueryParameters() Assert.Equal("select", select.WireName); Assert.Equal("int64", select.Type.Name); } + [Fact] + public async Task SupportsMultiPartFormAsRequestBody() + { + var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); + await using var fs = await GetDocumentStream(@"openapi: 3.0.1 +info: + title: Example + description: Example + version: 1.0.1 +servers: + - url: https://example.org +paths: + /directoryObject: + post: + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + id: + type: string + format: uuid + address: + $ref: '#/components/schemas/address' + profileImage: + type: string + format: binary + encoding: + id: + contentType: text/plain + address: + contentType: application/json + profileImage: + contentType: image/png + responses: + '204': + content: + application/json: + schema: + type: string +components: + schemas: + address: + type: object + properties: + street: + type: string + city: + type: string"); + var mockLogger = new Mock>(); + var builder = new KiotaBuilder(mockLogger.Object, new GenerationConfiguration { ClientClassName = "Graph", OpenAPIFilePath = tempFilePath, IncludeAdditionalData = false }, _httpClient); + var document = await builder.CreateOpenApiDocumentAsync(fs); + var node = builder.CreateUriSpace(document); + var codeModel = builder.CreateSourceModel(node); + Assert.NotNull(codeModel); + var rbClass = codeModel.FindChildByName("directoryObjectRequestBuilder"); + Assert.NotNull(rbClass); + var postMethod = rbClass.FindChildByName("Post", false); + Assert.NotNull(postMethod); + var bodyParameter = postMethod.Parameters.FirstOrDefault(x => x.IsOfKind(CodeParameterKind.RequestBody)); + Assert.NotNull(bodyParameter); + Assert.Equal("MultipartBody", bodyParameter.Type.Name, StringComparer.OrdinalIgnoreCase); + var addressClass = codeModel.FindChildByName("Address"); + Assert.NotNull(addressClass); + } } From 322b7f9fe06ddf67642eecca2d05d4bbc45630b1 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 24 Jul 2023 14:02:53 -0400 Subject: [PATCH 03/20] - adds reference to multipart body type Signed-off-by: Vincent Biret --- src/Kiota.Builder/Refiners/CSharpRefiner.cs | 3 +++ src/Kiota.Builder/Refiners/CSharpReservedTypesProvider.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/Kiota.Builder/Refiners/CSharpRefiner.cs b/src/Kiota.Builder/Refiners/CSharpRefiner.cs index 755afc5eaa..9c433b9962 100644 --- a/src/Kiota.Builder/Refiners/CSharpRefiner.cs +++ b/src/Kiota.Builder/Refiners/CSharpRefiner.cs @@ -181,7 +181,10 @@ protected static void MakeEnumPropertiesNullable(CodeElement currentElement) "System.Runtime.Serialization", "EnumMemberAttribute"), new (static x => x is IDeprecableElement element && element.Deprecation is not null && element.Deprecation.IsDeprecated, "System", "ObsoleteAttribute"), + new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.RequestExecutor, CodeMethodKind.RequestGenerator) && method.Parameters.Any(static y => y.IsOfKind(CodeParameterKind.RequestBody) && y.Type.Name.Equals(MultipartBodyClassName, StringComparison.OrdinalIgnoreCase)), + AbstractionsNamespaceName, MultipartBodyClassName), }; + private const string MultipartBodyClassName = "MultipartBody"; protected static void CapitalizeNamespacesFirstLetters(CodeElement current) { if (current is CodeNamespace currentNamespace) diff --git a/src/Kiota.Builder/Refiners/CSharpReservedTypesProvider.cs b/src/Kiota.Builder/Refiners/CSharpReservedTypesProvider.cs index a7c79635ac..a34b09effb 100644 --- a/src/Kiota.Builder/Refiners/CSharpReservedTypesProvider.cs +++ b/src/Kiota.Builder/Refiners/CSharpReservedTypesProvider.cs @@ -130,6 +130,7 @@ public class CSharpReservedTypesProvider : IReservedNamesProvider "MTAThreadAttribute", "MulticastDelegate", "MulticastNotSupportedException", + "MultipartBody", "NonSerializedAttribute", "NotFiniteNumberException", "NotImplementedException", From 7a3c538d8b7999ffe276b0cd19bed0ea3ddaa96a Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 24 Jul 2023 15:38:18 -0400 Subject: [PATCH 04/20] - fixes content method name Signed-off-by: Vincent Biret --- .../Writers/CSharp/CodeMethodWriter.cs | 2 +- .../Writers/CSharp/CodeMethodWriterTests.cs | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs index d29a311361..eccfccccdb 100644 --- a/src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs @@ -415,7 +415,7 @@ private void WriteRequestGeneratorBody(CodeMethod codeElement, RequestParams req if (requestParams.requestBody.Type.Name.Equals(conventions.StreamTypeName, StringComparison.OrdinalIgnoreCase)) writer.WriteLine($"{RequestInfoVarName}.SetStreamContent({requestParams.requestBody.Name});"); else if (currentClass.GetPropertyOfKind(CodePropertyKind.RequestAdapter) is CodeProperty requestAdapterProperty) - if (requestParams.requestBody.Type is CodeType bodyType && bodyType.TypeDefinition is CodeClass) + if (requestParams.requestBody.Type is CodeType bodyType && (bodyType.TypeDefinition is CodeClass || bodyType.Name.Equals("MultipartBody", StringComparison.OrdinalIgnoreCase))) writer.WriteLine($"{RequestInfoVarName}.SetContentFromParsable({requestAdapterProperty.Name.ToFirstCharacterUpperCase()}, \"{codeElement.RequestBodyContentType}\", {requestParams.requestBody.Name});"); else writer.WriteLine($"{RequestInfoVarName}.SetContentFromScalar{suffix}({requestAdapterProperty.Name.ToFirstCharacterUpperCase()}, \"{codeElement.RequestBodyContentType}\", {requestParams.requestBody.Name});"); diff --git a/tests/Kiota.Builder.Tests/Writers/CSharp/CodeMethodWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/CSharp/CodeMethodWriterTests.cs index 454efa2bde..ba00566b8d 100644 --- a/tests/Kiota.Builder.Tests/Writers/CSharp/CodeMethodWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/CSharp/CodeMethodWriterTests.cs @@ -422,12 +422,6 @@ private void AddRequestBodyParameters(bool useComplexTypeForBody = false) Optional = true, }); method.AddParameter(new CodeParameter - { - Name = "r", - Kind = CodeParameterKind.ResponseHandler, - Type = stringType, - }); - method.AddParameter(new CodeParameter { Name = "c", Kind = CodeParameterKind.Cancellation, @@ -487,6 +481,20 @@ public void WritesRequestExecutorBody() AssertExtensions.CurlyBracesAreClosed(result, 1); } [Fact] + public void WritesRequestGeneratorBodyForMultipart() + { + setup(); + method.Kind = CodeMethodKind.RequestGenerator; + method.HttpMethod = HttpMethod.Post; + AddRequestProperties(); + AddRequestBodyParameters(); + method.Parameters.First(static x => x.IsOfKind(CodeParameterKind.RequestBody)).Type = new CodeType { Name = "MultipartBody", IsExternal = true }; + writer.Write(method); + var result = tw.ToString(); + Assert.Contains("SetContentFromParsable", result); + AssertExtensions.CurlyBracesAreClosed(result, 1); + } + [Fact] public void WritesRequestExecutorBodyForCollection() { setup(); From bac11f26f9eccf8867d54b82236941b1c8eaeab3 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 26 Jul 2023 10:52:43 -0400 Subject: [PATCH 05/20] - removes outdated blazor recommendation Signed-off-by: Vincent Biret --- .vscode/extensions.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 548fcecfd9..dce5e47726 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,7 +2,6 @@ "recommendations": [ "formulahendry.dotnet-test-explorer", "ms-dotnettools.csharp", - "editorconfig.editorconfig", - "ms-dotnettools.blazorwasm-companion" + "editorconfig.editorconfig" ] } From 73cd3d51ac8fd14f8b8f05e0ca73e71e4f176a1d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 26 Jul 2023 10:53:01 -0400 Subject: [PATCH 06/20] - implements multipart generation for Java Signed-off-by: Vincent Biret --- src/Kiota.Builder/Refiners/JavaRefiner.cs | 3 +++ .../Refiners/JavaReservedNamesProvider.cs | 1 + .../Writers/Java/CodeMethodWriter.cs | 2 +- .../Writers/Java/CodeMethodWriterTests.cs | 20 +++++++++++++------ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/Kiota.Builder/Refiners/JavaRefiner.cs b/src/Kiota.Builder/Refiners/JavaRefiner.cs index da187ca04b..1704f1820a 100644 --- a/src/Kiota.Builder/Refiners/JavaRefiner.cs +++ b/src/Kiota.Builder/Refiners/JavaRefiner.cs @@ -242,7 +242,10 @@ private static void AddEnumSetImport(CodeElement currentElement) AbstractionsNamespaceName, "QueryParameter"), new (static x => x is CodeClass @class && @class.OriginalComposedType is CodeIntersectionType intersectionType && intersectionType.Types.Any(static y => !y.IsExternal), SerializationNamespaceName, "ParseNodeHelper"), + new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.RequestExecutor, CodeMethodKind.RequestGenerator) && method.Parameters.Any(static y => y.IsOfKind(CodeParameterKind.RequestBody) && y.Type.Name.Equals(MultipartBodyClassName, StringComparison.OrdinalIgnoreCase)), + AbstractionsNamespaceName, MultipartBodyClassName) }; + private const string MultipartBodyClassName = "MultipartBody"; private static void CorrectPropertyType(CodeProperty currentProperty) { if (currentProperty.IsOfKind(CodePropertyKind.RequestAdapter)) diff --git a/src/Kiota.Builder/Refiners/JavaReservedNamesProvider.cs b/src/Kiota.Builder/Refiners/JavaReservedNamesProvider.cs index 96d7c45688..9b80829986 100644 --- a/src/Kiota.Builder/Refiners/JavaReservedNamesProvider.cs +++ b/src/Kiota.Builder/Refiners/JavaReservedNamesProvider.cs @@ -63,6 +63,7 @@ public class JavaReservedNamesProvider : IReservedNamesProvider "wait", "while", "BaseRequestBuilder", + "MultipartBody", }); public HashSet ReservedNames => _reservedNames.Value; } diff --git a/src/Kiota.Builder/Writers/Java/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/Java/CodeMethodWriter.cs index 84b5f4e90f..0e5eb70874 100644 --- a/src/Kiota.Builder/Writers/Java/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/Java/CodeMethodWriter.cs @@ -539,7 +539,7 @@ private void WriteRequestGeneratorBody(CodeMethod codeElement, RequestParams req var collectionPostfix = requestParams.requestBody.Type.IsCollection ? "Collection" : string.Empty; if (requestParams.requestBody.Type.Name.Equals(conventions.StreamTypeName, StringComparison.OrdinalIgnoreCase)) writer.WriteLine($"{RequestInfoVarName}.setStreamContent({requestParams.requestBody.Name});"); - else if (requestParams.requestBody.Type is CodeType bodyType && bodyType.TypeDefinition is CodeClass) + else if (requestParams.requestBody.Type is CodeType bodyType && (bodyType.TypeDefinition is CodeClass || bodyType.Name.Equals("MultipartBody", StringComparison.OrdinalIgnoreCase))) writer.WriteLine($"{RequestInfoVarName}.setContentFromParsable({requestAdapterProperty.Name.ToFirstCharacterLowerCase()}, \"{codeElement.RequestBodyContentType}\", {requestParams.requestBody.Name}{toArrayPostfix});"); else writer.WriteLine($"{RequestInfoVarName}.setContentFromScalar{collectionPostfix}({requestAdapterProperty.Name.ToFirstCharacterLowerCase()}, \"{codeElement.RequestBodyContentType}\", {requestParams.requestBody.Name}{toArrayPostfix});"); diff --git a/tests/Kiota.Builder.Tests/Writers/Java/CodeMethodWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/Java/CodeMethodWriterTests.cs index f72be175aa..cf043d8c89 100644 --- a/tests/Kiota.Builder.Tests/Writers/Java/CodeMethodWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/Java/CodeMethodWriterTests.cs @@ -591,12 +591,6 @@ private void AddRequestBodyParameters(bool useComplexTypeForBody = false) }, Optional = true, }); - method.AddParameter(new CodeParameter - { - Name = "r", - Kind = CodeParameterKind.ResponseHandler, - Type = stringType, - }); } [Fact] public void WritesNullableVoidTypeForExecutor() @@ -1139,6 +1133,20 @@ public void DoesntWriteFactorySwitchOnEmptyMappings() AssertExtensions.CurlyBracesAreClosed(result); } [Fact] + public void WritesRequestGeneratorBodyForMultipart() + { + setup(); + method.Kind = CodeMethodKind.RequestGenerator; + method.HttpMethod = HttpMethod.Post; + AddRequestProperties(); + AddRequestBodyParameters(); + method.Parameters.First(static x => x.IsOfKind(CodeParameterKind.RequestBody)).Type = new CodeType { Name = "MultipartBody", IsExternal = true }; + writer.Write(method); + var result = tw.ToString(); + Assert.Contains("setContentFromParsable", result); + AssertExtensions.CurlyBracesAreClosed(result); + } + [Fact] public void WritesRequestExecutorBodyForCollections() { setup(); From 10ee2a79834c7c989c280362515fe6097b770b99 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 26 Jul 2023 11:40:51 -0400 Subject: [PATCH 07/20] - adds additional default lib for java --- src/Kiota.Builder/Refiners/JavaRefiner.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Kiota.Builder/Refiners/JavaRefiner.cs b/src/Kiota.Builder/Refiners/JavaRefiner.cs index 1704f1820a..5a244e667a 100644 --- a/src/Kiota.Builder/Refiners/JavaRefiner.cs +++ b/src/Kiota.Builder/Refiners/JavaRefiner.cs @@ -105,6 +105,7 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance $"{SerializationNamespaceName}.JsonSerializationWriterFactory", $"{SerializationNamespaceName}.TextSerializationWriterFactory", $"{SerializationNamespaceName}.FormSerializationWriterFactory", + $"{SerializationNamespaceName}.MultipartSerializationWriterFactory", } ); ReplaceDefaultDeserializationModules( From 55e7c93cff28fe9c86029400710056867682f516 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 27 Jul 2023 13:47:25 -0400 Subject: [PATCH 08/20] - implements go multipart request body --- src/Kiota.Builder/Refiners/GoRefiner.cs | 20 +++++++++++++------ .../Refiners/GoReservedNamesProvider.cs | 3 ++- .../Writers/Go/CodeMethodWriter.cs | 2 +- .../Writers/Go/CodeMethodWriterTests.cs | 20 +++++++++++++------ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/Kiota.Builder/Refiners/GoRefiner.cs b/src/Kiota.Builder/Refiners/GoRefiner.cs index 32dd1344ac..c7a51d4dc8 100644 --- a/src/Kiota.Builder/Refiners/GoRefiner.cs +++ b/src/Kiota.Builder/Refiners/GoRefiner.cs @@ -128,6 +128,7 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance "github.com/microsoft/kiota-serialization-json-go.JsonSerializationWriterFactory", "github.com/microsoft/kiota-serialization-text-go.TextSerializationWriterFactory", "github.com/microsoft/kiota-serialization-form-go.FormSerializationWriterFactory", + "github.com/microsoft/kiota-serialization-multipart-go.MultipartSerializationWriterFactory", }); ReplaceDefaultDeserializationModules( generatedCode, @@ -506,9 +507,9 @@ private static void AddErrorImportForEnums(CodeElement currentElement) }; private static readonly AdditionalUsingEvaluator[] defaultUsingEvaluators = { new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.RequestAdapter), - "github.com/microsoft/kiota-abstractions-go", "RequestAdapter"), + AbstractionsNamespaceName, "RequestAdapter"), new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.RequestGenerator), - "github.com/microsoft/kiota-abstractions-go", "RequestInformation", "HttpMethod", "RequestOption"), + AbstractionsNamespaceName, "RequestInformation", "HttpMethod", "RequestOption"), new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.Constructor) && method.Parameters.Any(x => x.IsOfKind(CodeParameterKind.Path) && !typeToSkipStrConv.Contains(x.Type.Name)), @@ -537,12 +538,16 @@ x.Type is CodeType pType && new (static x => x is CodeClass @class && @class.OriginalComposedType is CodeIntersectionType intersectionType && intersectionType.Types.Any(static y => !y.IsExternal) && intersectionType.DiscriminatorInformation.HasBasicDiscriminatorInformation, "github.com/microsoft/kiota-abstractions-go/serialization", "MergeDeserializersForIntersectionWrapper"), new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.Headers), - "github.com/microsoft/kiota-abstractions-go", "RequestHeaders"), + AbstractionsNamespaceName, "RequestHeaders"), new (static x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.BackingStore), "github.com/microsoft/kiota-abstractions-go/store","BackingStore"), new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.ClientConstructor) && method.Parameters.Any(y => y.IsOfKind(CodeParameterKind.BackingStore)), "github.com/microsoft/kiota-abstractions-go/store", "BackingStoreFactory"), + new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.RequestExecutor, CodeMethodKind.RequestGenerator) && method.Parameters.Any(static y => y.IsOfKind(CodeParameterKind.RequestBody) && y.Type.Name.Equals(MultipartBodyClassName, StringComparison.OrdinalIgnoreCase)), + AbstractionsNamespaceName, MultipartBodyClassName), }; + private const string MultipartBodyClassName = "MultipartBody"; + private const string AbstractionsNamespaceName = "github.com/microsoft/kiota-abstractions-go"; private void CorrectImplements(ProprietableBlockDeclaration block) { @@ -552,9 +557,12 @@ private void CorrectImplements(ProprietableBlockDeclaration block) private static void CorrectMethodType(CodeMethod currentMethod) { var parentClass = currentMethod.Parent as CodeClass; - if (currentMethod.IsOfKind(CodeMethodKind.RequestGenerator)) + if (currentMethod.IsOfKind(CodeMethodKind.RequestGenerator, CodeMethodKind.RequestExecutor)) { - currentMethod.ReturnType.IsNullable = true; + if (currentMethod.IsOfKind(CodeMethodKind.RequestGenerator)) + currentMethod.ReturnType.IsNullable = true; + if (currentMethod.Parameters.OfKind(CodeParameterKind.RequestBody) is CodeParameter bodyParam && bodyParam.Type.Name.Equals(MultipartBodyClassName, StringComparison.OrdinalIgnoreCase)) + bodyParam.Type.IsNullable = false; } else if (currentMethod.IsOfKind(CodeMethodKind.Serializer)) currentMethod.Parameters.Where(static x => x.Type.Name.Equals("ISerializationWriter", StringComparison.Ordinal)).ToList().ForEach(x => x.Type.Name = "SerializationWriter"); @@ -591,7 +599,7 @@ private static void CorrectMethodType(CodeMethod currentMethod) currentMethod.ReturnType = new CodeType { Name = "Parsable", IsNullable = false, IsExternal = true }; } CorrectCoreTypes(parentClass, DateTypesReplacements, currentMethod.Parameters - .Select(x => x.Type) + .Select(static x => x.Type) .Union(new[] { currentMethod.ReturnType }) .ToArray()); } diff --git a/src/Kiota.Builder/Refiners/GoReservedNamesProvider.cs b/src/Kiota.Builder/Refiners/GoReservedNamesProvider.cs index 3ce90d28fd..bf7b831b08 100644 --- a/src/Kiota.Builder/Refiners/GoReservedNamesProvider.cs +++ b/src/Kiota.Builder/Refiners/GoReservedNamesProvider.cs @@ -31,7 +31,8 @@ public class GoReservedNamesProvider : IReservedNamesProvider "type", "var", "vendor", // cannot be used as a package name - "BaseRequestBuilder" + "BaseRequestBuilder", + "MultipartBody", }); public HashSet ReservedNames => _reservedNames.Value; } diff --git a/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs index 3215f12244..60bb9e3734 100644 --- a/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs @@ -807,7 +807,7 @@ private void WriteRequestGeneratorBody(CodeMethod codeElement, RequestParams req var collectionSuffix = requestParams.requestBody.Type.IsCollection ? "Collection" : string.Empty; if (requestParams.requestBody.Type.Name.Equals("binary", StringComparison.OrdinalIgnoreCase)) writer.WriteLine($"{RequestInfoVarName}.SetStreamContent({bodyParamReference})"); - else if (requestParams.requestBody.Type is CodeType bodyType && (bodyType.TypeDefinition is CodeClass || bodyType.TypeDefinition is CodeInterface)) + else if (requestParams.requestBody.Type is CodeType bodyType && (bodyType.TypeDefinition is CodeClass || bodyType.TypeDefinition is CodeInterface || bodyType.Name.Equals("MultipartBody", StringComparison.OrdinalIgnoreCase))) { if (bodyType.IsCollection) { diff --git a/tests/Kiota.Builder.Tests/Writers/Go/CodeMethodWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/Go/CodeMethodWriterTests.cs index 566c6d2579..71cd25b756 100644 --- a/tests/Kiota.Builder.Tests/Writers/Go/CodeMethodWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/Go/CodeMethodWriterTests.cs @@ -617,12 +617,6 @@ private void AddRequestBodyParameters(CodeMethod target = default, bool useCompl }).First(), } : stringType, }); - target.AddParameter(new CodeParameter - { - Name = "r", - Kind = CodeParameterKind.ResponseHandler, - Type = stringType, - }); } [Fact] public void WritesNullableVoidTypeForExecutor() @@ -663,6 +657,20 @@ public void WritesRequestBodiesThrowOnNullHttpMethod() Assert.Throws(() => writer.Write(method)); } [Fact] + public void WritesRequestGeneratorBodyForMultipart() + { + setup(); + method.Kind = CodeMethodKind.RequestGenerator; + method.HttpMethod = HttpMethod.Post; + AddRequestProperties(); + AddRequestBodyParameters(); + method.Parameters.First(static x => x.IsOfKind(CodeParameterKind.RequestBody)).Type = new CodeType { Name = "MultipartBody", IsExternal = true }; + writer.Write(method); + var result = tw.ToString(); + Assert.Contains("SetContentFromParsable", result); + AssertExtensions.CurlyBracesAreClosed(result); + } + [Fact] public void WritesRequestExecutorBody() { setup(); From dbdfdf20b3c4c9474f76d48019ee702d00ea6692 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 1 Aug 2023 11:16:08 -0400 Subject: [PATCH 09/20] - adds support for multipart in typescript - removes redundant null check in typescript - adds support for binary serialization in typescript Signed-off-by: Vincent Biret --- .../Refiners/TypeScriptRefiner.cs | 10 +++++++--- .../TypeScriptReservedNamesProvider.cs | 1 + .../Writers/TypeScript/CodeFunctionWriter.cs | 8 ++++++-- .../Writers/TypeScript/CodeMethodWriter.cs | 13 ++++++++----- .../TypeScript/CodeMethodWriterTests.cs | 19 +++++++++++++------ 5 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs b/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs index 3cd51b5267..ddd8fd1b09 100644 --- a/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs +++ b/src/Kiota.Builder/Refiners/TypeScriptRefiner.cs @@ -78,6 +78,7 @@ public override Task Refine(CodeNamespace generatedCode, CancellationToken cance "@microsoft/kiota-serialization-json.JsonSerializationWriterFactory", "@microsoft/kiota-serialization-text.TextSerializationWriterFactory", "@microsoft/kiota-serialization-form.FormSerializationWriterFactory", + "@microsoft/kiota-serialization-multipart.MultipartSerializationWriterFactory", } ); ReplaceDefaultDeserializationModules( @@ -214,8 +215,11 @@ currentInterface.StartBlock is InterfaceDeclaration interfaceDeclaration && method.Parameters.Any(y => y.IsOfKind(CodeParameterKind.BackingStore)), AbstractionsPackageName, "BackingStoreFactory", "BackingStoreFactorySingleton"), new (x => x is CodeProperty prop && prop.IsOfKind(CodePropertyKind.BackingStore), - AbstractionsPackageName, "BackingStore", "BackedModel", "BackingStoreFactorySingleton" ), + AbstractionsPackageName, "BackingStore", "BackedModel", "BackingStoreFactorySingleton"), + new (static x => x is CodeMethod method && method.IsOfKind(CodeMethodKind.RequestExecutor, CodeMethodKind.RequestGenerator) && method.Parameters.Any(static y => y.IsOfKind(CodeParameterKind.RequestBody) && y.Type.Name.Equals(MultipartBodyClassName, StringComparison.OrdinalIgnoreCase)), + AbstractionsPackageName, MultipartBodyClassName, $"serialize{MultipartBodyClassName}") }; + private const string MultipartBodyClassName = "MultipartBody"; private static void CorrectImplements(ProprietableBlockDeclaration block) { block.Implements.Where(x => "IAdditionalDataHolder".Equals(x.Name, StringComparison.OrdinalIgnoreCase)).ToList().ForEach(x => x.Name = x.Name[1..]); // skipping the I @@ -248,8 +252,8 @@ private static void CorrectMethodType(CodeMethod currentMethod) { if (currentMethod.IsOfKind(CodeMethodKind.RequestExecutor, CodeMethodKind.RequestGenerator)) { - if (currentMethod.IsOfKind(CodeMethodKind.RequestExecutor)) - currentMethod.Parameters.Where(x => x.IsOfKind(CodeParameterKind.ResponseHandler) && x.Type.Name.StartsWith("i", StringComparison.OrdinalIgnoreCase)).ToList().ForEach(x => x.Type.Name = x.Type.Name[1..]); + if (currentMethod.Parameters.OfKind(CodeParameterKind.RequestBody) is CodeParameter requestBodyParam) + requestBodyParam.Type.IsNullable = false; } else if (currentMethod.IsOfKind(CodeMethodKind.Serializer)) currentMethod.Parameters.Where(x => x.IsOfKind(CodeParameterKind.Serializer) && x.Type.Name.StartsWith("i", StringComparison.OrdinalIgnoreCase)).ToList().ForEach(x => x.Type.Name = x.Type.Name[1..]); diff --git a/src/Kiota.Builder/Refiners/TypeScriptReservedNamesProvider.cs b/src/Kiota.Builder/Refiners/TypeScriptReservedNamesProvider.cs index fbb6cd2310..ccb06a9b24 100644 --- a/src/Kiota.Builder/Refiners/TypeScriptReservedNamesProvider.cs +++ b/src/Kiota.Builder/Refiners/TypeScriptReservedNamesProvider.cs @@ -43,6 +43,7 @@ public class TypeScriptReservedNamesProvider : IReservedNamesProvider "while", "with", "BaseRequestBuilder", + "MultipartBody" }); public HashSet ReservedNames => _reservedNames.Value; } diff --git a/src/Kiota.Builder/Writers/TypeScript/CodeFunctionWriter.cs b/src/Kiota.Builder/Writers/TypeScript/CodeFunctionWriter.cs index dce365fcf8..3aa367477e 100644 --- a/src/Kiota.Builder/Writers/TypeScript/CodeFunctionWriter.cs +++ b/src/Kiota.Builder/Writers/TypeScript/CodeFunctionWriter.cs @@ -149,7 +149,7 @@ private void WritePropertySerializer(string modelParamName, CodeProperty codePro private string GetSerializationMethodName(CodeTypeBase propType) { var propertyType = conventions.TranslateType(propType); - if (!string.IsNullOrEmpty(propertyType) && propType is CodeType currentType && GetSerializationMethodNameForCodeType(currentType, propertyType) is string result && !String.IsNullOrWhiteSpace(result)) + if (!string.IsNullOrEmpty(propertyType) && propType is CodeType currentType && GetSerializationMethodNameForCodeType(currentType, propertyType) is string result && !string.IsNullOrWhiteSpace(result)) { return result; } @@ -160,10 +160,12 @@ private string GetSerializationMethodName(CodeTypeBase propType) }; } - private static string? GetSerializationMethodNameForCodeType(CodeType propType, string propertyType) + private string? GetSerializationMethodNameForCodeType(CodeType propType, string propertyType) { if (propType.TypeDefinition is CodeEnum currentEnum) return $"writeEnumValue<{currentEnum.Name.ToFirstCharacterUpperCase()}>"; + else if (conventions.StreamTypeName.Equals(propertyType, StringComparison.OrdinalIgnoreCase)) + return "writeByteArrayValue"; else if (propType.CollectionKind != CodeTypeBase.CodeTypeCollectionKind.None) { if (propType.TypeDefinition == null) @@ -206,6 +208,8 @@ private string GetDeserializationMethodName(CodeTypeBase propType, CodeFunction { if (currentType.TypeDefinition is CodeEnum currentEnum) return $"{(currentEnum.Flags || isCollection ? "getCollectionOfEnumValues" : "getEnumValue")}<{currentEnum.Name.ToFirstCharacterUpperCase()}>({propertyType.ToFirstCharacterUpperCase()})"; + else if (conventions.StreamTypeName.Equals(propertyType, StringComparison.OrdinalIgnoreCase)) + return "getByteArrayValue"; else if (isCollection) if (currentType.TypeDefinition == null) return $"getCollectionOfPrimitiveValues<{propertyType}>()"; diff --git a/src/Kiota.Builder/Writers/TypeScript/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/TypeScript/CodeMethodWriter.cs index 7b5fe95c98..79b93e5f81 100644 --- a/src/Kiota.Builder/Writers/TypeScript/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/TypeScript/CodeMethodWriter.cs @@ -101,9 +101,12 @@ internal static void WriteDefensiveStatements(CodeMethod codeElement, LanguageWr { if (codeElement.IsOfKind(CodeMethodKind.Setter)) return; + var isRequestExecutor = codeElement.IsOfKind(CodeMethodKind.RequestExecutor); + foreach (var parameter in codeElement.Parameters - .Where(static x => !x.Optional && !x.IsOfKind(CodeParameterKind.RequestAdapter, CodeParameterKind.PathParameters)) - .OrderBy(static x => x.Name)) + .Where(x => !x.Optional && !x.IsOfKind(CodeParameterKind.RequestAdapter, CodeParameterKind.PathParameters) && + !(isRequestExecutor && x.IsOfKind(CodeParameterKind.RequestBody))) + .OrderBy(static x => x.Name, StringComparer.OrdinalIgnoreCase)) { var parameterName = parameter.Name.ToFirstCharacterLowerCase(); writer.WriteLine($"if(!{parameterName}) throw new Error(\"{parameterName} cannot be undefined\");"); @@ -378,10 +381,10 @@ private void ComposeContentInRequestGeneratorBody(CodeParameter requestBody, Cod } var spreadOperator = requestBody.Type.AllTypes.First().IsCollection ? "..." : string.Empty; - if (requestBody.Type is CodeType currentType && currentType.TypeDefinition is CodeInterface codeInterface) + if (requestBody.Type is CodeType currentType && (currentType.TypeDefinition is CodeInterface || currentType.Name.Equals("MultipartBody", StringComparison.OrdinalIgnoreCase))) { - var serializerName = $"serialize{codeInterface.Name.ToFirstCharacterUpperCase()}"; - writer.WriteLine($"{RequestInfoVarName}.setContentFromParsable(this.{requestAdapterProperty.Name.ToFirstCharacterLowerCase()}, \"{contentType}\", body as any, {serializerName});"); + var serializerName = $"serialize{currentType.Name.ToFirstCharacterUpperCase()}"; + writer.WriteLine($"{RequestInfoVarName}.setContentFromParsable(this.{requestAdapterProperty.Name.ToFirstCharacterLowerCase()}, \"{contentType}\", {requestBody.Name}, {serializerName});"); } else { diff --git a/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeMethodWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeMethodWriterTests.cs index 6afa0e9c19..d0b62e1b80 100644 --- a/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeMethodWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeMethodWriterTests.cs @@ -135,12 +135,6 @@ private void AddRequestBodyParameters(bool useComplexTypeForBody = false) }, Optional = true, }); - method.AddParameter(new CodeParameter - { - Name = "r", - Kind = CodeParameterKind.ResponseHandler, - Type = stringType, - }); } [Fact] public void WritesRequestBuilder() @@ -244,6 +238,19 @@ public void DoesntCreateDictionaryOnEmptyErrorMapping() AssertExtensions.CurlyBracesAreClosed(result); } [Fact] + public void WritesRequestGeneratorBodyForMultipart() + { + method.Kind = CodeMethodKind.RequestGenerator; + method.HttpMethod = HttpMethod.Post; + AddRequestProperties(); + AddRequestBodyParameters(); + method.Parameters.First(static x => x.IsOfKind(CodeParameterKind.RequestBody)).Type = new CodeType { Name = "MultipartBody", IsExternal = true }; + writer.Write(method); + var result = tw.ToString(); + Assert.Contains("setContentFromParsable", result); + AssertExtensions.CurlyBracesAreClosed(result); + } + [Fact] public void WritesRequestExecutorBodyForCollections() { method.Kind = CodeMethodKind.RequestExecutor; From 0099f50d60b5f85bf500e882130507a4afc3614d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 1 Aug 2023 11:21:04 -0400 Subject: [PATCH 10/20] - adds changelog entry from multipart Signed-off-by: Vincent Biret --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e85f6e2a12..bc372e5783 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added capability to serialize and deserialize UUIDs in typescript[#40](https://github.com/microsoft/kiota-typescript/issues/40) - Use `import type` statement if the generated code is an interface[#2959](https://github.com/microsoft/kiota/issues/2959) - Added auto-generation header for class and enums in CSharp [#2886](https://github.com/microsoft/kiota/issues/2886) +- Added support for multipart form data request body in CSharp, Go, Java, and TypeScript. [#220](https://github.com/microsoft/kiota/issues/220) +- Added support for base64 encoded properties in TypeScript. ### Changed From a2107bd21d009a9fc6fe5d73e38ad0e45b0fb2b9 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 1 Aug 2023 13:05:27 -0400 Subject: [PATCH 11/20] - adds multipart libs entry to info command Signed-off-by: Vincent Biret --- src/kiota/appsettings.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/kiota/appsettings.json b/src/kiota/appsettings.json index b52353eac5..786115e37f 100644 --- a/src/kiota/appsettings.json +++ b/src/kiota/appsettings.json @@ -48,6 +48,10 @@ { "Name": "Microsoft.Kiota.Serialization.Text", "Version": "1.0.1" + }, + { + "Name": "Microsoft.Kiota.Serialization.Multipart", + "Version": "1.0.0" } ], "DependencyInstallCommand": "dotnet add package {0} --version {1}" @@ -78,6 +82,10 @@ { "Name": "com.microsoft.kiota:microsoft-kiota-serialization-text", "Version": "0.4.5" + }, + { + "Name": "com.microsoft.kiota:microsoft-kiota-serialization-multipart", + "Version": "0.5.0" } ], "DependencyInstallCommand": "{0}:{1}" @@ -108,6 +116,10 @@ { "Name": "github.com/microsoft/kiota-serialization-text-go", "Version": "v1.0.0" + }, + { + "Name": "github.com/microsoft/kiota-serialization-multipart-go", + "Version": "v1.0.0" } ], "DependencyInstallCommand": "go get {0}@{1}" @@ -138,6 +150,10 @@ { "Name": "@microsoft/kiota-serialization-text", "Version": "1.0.0-preview.19" + }, + { + "Name": "@microsoft/kiota-serialization-multipart", + "Version": "1.0.0-preview.2" } ], "DependencyInstallCommand": "npm install {0}@{1} -S" From c99c1f590099a7378701543a10800893bf799266 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 1 Aug 2023 13:50:18 -0400 Subject: [PATCH 12/20] - updates dependencies on readme for multipart Signed-off-by: Vincent Biret --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a0bdd97e72..5207901b89 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-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://learn.microsoft.com/openapi/kiota/quickstarts/dotnet) | -| Go | ✔ | [✔](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://learn.microsoft.com/openapi/kiota/quickstarts/go) | -| Java | ✔ | [✔](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://learn.microsoft.com/openapi/kiota/quickstarts/java) | -| PHP | ✔ | [✔](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://learn.microsoft.com/openapi/kiota/quickstarts/php) | -| Python | ✔ | [✔](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://learn.microsoft.com/openapi/kiota/quickstarts/python) | -| Ruby | ✔ | [✔](https://github.com/microsoft/kiota-abstractions-ruby) | [❌ FORM](https://github.com/microsoft/kiota/issues/2077), [JSON](https://github.com/microsoft/kiota-serialization-json-ruby), [❌ TEXT](https://github.com/microsoft/kiota/issues/1049) | [Anonymous](https://github.com/microsoft/kiota-abstractions-ruby/blob/main/lib/microsoft_kiota_abstractions/authentication/anonymous_authentication_provider.rb), [✔️ OAuth2](https://github.com/microsoft/kiota-authentication-oauth-ruby) | [✔](https://github.com/microsoft/kiota-http-ruby)| [link](https://learn.microsoft.com/openapi/kiota/quickstarts/ruby) | +| CSharp | ✔ | [✔](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), [MULTIPART](https://github.com/microsoft/kiota-serialization-multipart-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://learn.microsoft.com/openapi/kiota/quickstarts/dotnet) | +| Go | ✔ | [✔](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), [MULTIPART](https://github.com/microsoft/kiota-serialization-multipart-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://learn.microsoft.com/openapi/kiota/quickstarts/go) | +| Java | ✔ | [✔](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), [MULTIPART](https://github.com/microsoft/kiota-java/tree/main/components/serialization/multipart), [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://learn.microsoft.com/openapi/kiota/quickstarts/java) | +| PHP | ✔ | [✔](https://github.com/microsoft/kiota-abstractions-php) | [JSON](https://github.com/microsoft/kiota-serialization-json-php), [❌ FORM](https://github.com/microsoft/kiota/issues/2074), [❌ MULTIPART](https://github.com/microsoft/kiota/issues/3029), [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://learn.microsoft.com/openapi/kiota/quickstarts/php) | +| Python | ✔ | [✔](https://github.com/microsoft/kiota-abstractions-python) | [❌ FORM](https://github.com/microsoft/kiota/issues/2075), [JSON](https://github.com/microsoft/kiota-serialization-json-python), [❌ MULTIPART](https://github.com/microsoft/kiota/issues/3030), [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://learn.microsoft.com/openapi/kiota/quickstarts/python) | +| Ruby | ✔ | [✔](https://github.com/microsoft/kiota-abstractions-ruby) | [❌ FORM](https://github.com/microsoft/kiota/issues/2077), [JSON](https://github.com/microsoft/kiota-serialization-json-ruby), [❌ MULTIPART](https://github.com/microsoft/kiota/issues/3032), [❌ TEXT](https://github.com/microsoft/kiota/issues/1049) | [Anonymous](https://github.com/microsoft/kiota-abstractions-ruby/blob/main/lib/microsoft_kiota_abstractions/authentication/anonymous_authentication_provider.rb), [✔️ OAuth2](https://github.com/microsoft/kiota-authentication-oauth-ruby) | [✔](https://github.com/microsoft/kiota-http-ruby)| [link](https://learn.microsoft.com/openapi/kiota/quickstarts/ruby) | | Shell | ✔ | (see CSHarp) + [✔](https://github.com/microsoft/kiota-cli-commons) | (see CSHarp) | (see CSharp) | (see CSharp) | [link](https://learn.microsoft.com/openapi/kiota/quickstarts/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-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://learn.microsoft.com/openapi/kiota/quickstarts/typescript) | +| 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), [❌ FORM](https://github.com/microsoft/kiota/issues/3033), [❌ 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-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), [MULTIPART](https://github.com/microsoft/kiota-typescript/tree/main/packages/serialization/multipart), [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://learn.microsoft.com/openapi/kiota/quickstarts/typescript) | > Legend: ✔ -> in preview, ❌ -> not started, ▶ -> in progress. From 657e0874fef05178e4b156e77eed71f6b0cd6a02 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 2 Aug 2023 09:25:06 -0400 Subject: [PATCH 13/20] - adds multipart packages to test projects --- it/csharp/dotnet.csproj | 3 +- it/go/go.mod | 5 ++- it/go/go.sum | 5 +++ it/java/pom.xml | 7 +++- it/typescript/package-lock.json | 69 +++++++++++++++++++-------------- it/typescript/package.json | 1 + 6 files changed, 57 insertions(+), 33 deletions(-) diff --git a/it/csharp/dotnet.csproj b/it/csharp/dotnet.csproj index bb9fcfb583..ad5285585e 100644 --- a/it/csharp/dotnet.csproj +++ b/it/csharp/dotnet.csproj @@ -10,11 +10,12 @@ - + + diff --git a/it/go/go.mod b/it/go/go.mod index 69bda3e53f..df37365d83 100644 --- a/it/go/go.mod +++ b/it/go/go.mod @@ -4,11 +4,11 @@ go 1.20 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 - github.com/microsoft/kiota-abstractions-go v1.1.0 + github.com/microsoft/kiota-abstractions-go v1.2.0 github.com/microsoft/kiota-authentication-azure-go v1.0.0 github.com/microsoft/kiota-http-go v1.0.0 github.com/microsoft/kiota-serialization-form-go v1.0.0 - github.com/microsoft/kiota-serialization-json-go v1.0.3 + github.com/microsoft/kiota-serialization-json-go v1.0.4 github.com/microsoft/kiota-serialization-text-go v1.0.0 ) @@ -23,6 +23,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect + github.com/microsoft/kiota-serialization-multipart-go v1.0.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.8.4 // indirect diff --git a/it/go/go.sum b/it/go/go.sum index 839c4f016a..6e6da97eff 100644 --- a/it/go/go.sum +++ b/it/go/go.sum @@ -34,6 +34,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/microsoft/kiota-abstractions-go v1.1.0 h1:X1aKlsYCRs/0RSChr/fbq4j/+kxRzbSY5GeWhtHQNYI= github.com/microsoft/kiota-abstractions-go v1.1.0/go.mod h1:RkxyZ5x87Njik7iVeQY9M2wtrrL1MJZcXiI/BxD/82g= +github.com/microsoft/kiota-abstractions-go v1.2.0 h1:lUriJgqdCY/QajwWQOgTCQE9Atywfe2NHhgoTCSXTRE= +github.com/microsoft/kiota-abstractions-go v1.2.0/go.mod h1:RkxyZ5x87Njik7iVeQY9M2wtrrL1MJZcXiI/BxD/82g= github.com/microsoft/kiota-authentication-azure-go v1.0.0 h1:29FNZZ/4nnCOwFcGWlB/sxPvWz487HA2bXH8jR5k2Rk= github.com/microsoft/kiota-authentication-azure-go v1.0.0/go.mod h1:rnx3PRlkGdXDcA/0lZQTbBwyYGmc+3POt7HpE/e4jGw= github.com/microsoft/kiota-http-go v1.0.0 h1:F1hd6gMlLeEgH2CkRB7z13ow7LxMKMWEmms/t0VfS+k= @@ -42,6 +44,9 @@ github.com/microsoft/kiota-serialization-form-go v1.0.0 h1:UNdrkMnLFqUCccQZerKjb github.com/microsoft/kiota-serialization-form-go v1.0.0/go.mod h1:h4mQOO6KVTNciMF6azi1J9QB19ujSw3ULKcSNyXXOMA= github.com/microsoft/kiota-serialization-json-go v1.0.3 h1:U0VR3IPP8an9BHunuKykqpCIvM3FJzjMQy8tiit+FTk= github.com/microsoft/kiota-serialization-json-go v1.0.3/go.mod h1:rM4+FsAY+9AEpBsBzkFFis+b/LZLlNKKewuLwK9Q6Mg= +github.com/microsoft/kiota-serialization-json-go v1.0.4/go.mod h1:rM4+FsAY+9AEpBsBzkFFis+b/LZLlNKKewuLwK9Q6Mg= +github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJympbXNaeV07K0d46IfuEd5v9+pBs= +github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so= github.com/microsoft/kiota-serialization-text-go v1.0.0 h1:XOaRhAXy+g8ZVpcq7x7a0jlETWnWrEum0RhmbYrTFnA= github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= diff --git a/it/java/pom.xml b/it/java/pom.xml index cb82333deb..b8597a8a94 100644 --- a/it/java/pom.xml +++ b/it/java/pom.xml @@ -15,7 +15,7 @@ UTF-8 UTF-8 - 0.4.5 + 0.5.0 @@ -39,6 +39,11 @@ microsoft-kiota-serialization-form ${kiota-java.version} + + com.microsoft.kiota + microsoft-kiota-serialization-multipart + ${kiota-java.version} + com.google.code.findbugs jsr305 diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index 44c7237696..32f6c28eea 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -15,6 +15,7 @@ "@microsoft/kiota-http-fetchlibrary": "^1.0.0-preview.23", "@microsoft/kiota-serialization-form": "^1.0.0-preview.13", "@microsoft/kiota-serialization-json": "^1.0.0-preview.22", + "@microsoft/kiota-serialization-multipart": "^1.0.0-preview.2", "@microsoft/kiota-serialization-text": "^1.0.0-preview.21", "express": "^4.18.2", "node-fetch": "^2.6.9" @@ -662,9 +663,9 @@ "dev": true }, "node_modules/@microsoft/kiota-abstractions": { - "version": "1.0.0-preview.24", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-abstractions/-/kiota-abstractions-1.0.0-preview.24.tgz", - "integrity": "sha512-O5s8f/bpSGvl2WeEhLOV2O7eK5qMc00Wr52FUl7Azi4iSBgNgVsJA/S0Fk+q/pYOMXfrNKR5h0KM4UALOYOa7w==", + "version": "1.0.0-preview.25", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-abstractions/-/kiota-abstractions-1.0.0-preview.25.tgz", + "integrity": "sha512-I+1WnhKeLK6tRqOw6fsvNq1SvHZv9H3/xdpg1MRyHQGiYBCK8oOzPYAvBeSztdy39zsMHYeTwEDVf+2llWjlKw==", "dependencies": { "@opentelemetry/api": "^1.2.0", "guid-typescript": "^1.0.9", @@ -683,22 +684,22 @@ } }, "node_modules/@microsoft/kiota-authentication-azure": { - "version": "1.0.0-preview.19", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-authentication-azure/-/kiota-authentication-azure-1.0.0-preview.19.tgz", - "integrity": "sha512-1eCsQ3g4NBOFhMAfoYky2urdkKrwL/iEp1fTPYdB3eXVqsMlrVzRzkt3OjxtfwuHSXgzSsULwUumobOfxw4ZRQ==", + "version": "1.0.0-preview.20", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-authentication-azure/-/kiota-authentication-azure-1.0.0-preview.20.tgz", + "integrity": "sha512-Ixpp/NBryBdZ/FrD8MxOL9a9eis1R8CgBqXJ7iRj8cFsus+WzRwU7yHXehcHA2wvnLXrYhbfYHq5AocX0xS6Qg==", "dependencies": { "@azure/core-auth": "^1.3.2", - "@microsoft/kiota-abstractions": "^1.0.0-preview.24", + "@microsoft/kiota-abstractions": "^1.0.0-preview.25", "@opentelemetry/api": "^1.2.0", "tslib": "^2.3.1" } }, "node_modules/@microsoft/kiota-http-fetchlibrary": { - "version": "1.0.0-preview.23", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-http-fetchlibrary/-/kiota-http-fetchlibrary-1.0.0-preview.23.tgz", - "integrity": "sha512-301vDEUo1DXmMc/n3ALmxkJ4NGYADTze4c6wsHkOpwHBIfouefwDJSYBi2WAxv4t6S9GK0QOIEe/m1fMI3gWJA==", + "version": "1.0.0-preview.24", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-http-fetchlibrary/-/kiota-http-fetchlibrary-1.0.0-preview.24.tgz", + "integrity": "sha512-3jFfb9xQI7+OUzhJG1+kVpdtlGEA2HKHLJlEo7RSs1viSoJNTtxDferyh5E0yTsaL6ruzISQ94aTkcb5GgB29A==", "dependencies": { - "@microsoft/kiota-abstractions": "^1.0.0-preview.24", + "@microsoft/kiota-abstractions": "^1.0.0-preview.25", "@opentelemetry/api": "^1.2.0", "guid-typescript": "^1.0.9", "node-fetch": "^2.6.5", @@ -706,31 +707,41 @@ } }, "node_modules/@microsoft/kiota-serialization-form": { - "version": "1.0.0-preview.13", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-form/-/kiota-serialization-form-1.0.0-preview.13.tgz", - "integrity": "sha512-c16YbF48qIKdR9CvIqRvq74lOc9ExHXByE7SztabOBuDh49GEUub/+LZ0rs99gq0rFyiqzyCF1XWPqWe6KDGpw==", + "version": "1.0.0-preview.14", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-form/-/kiota-serialization-form-1.0.0-preview.14.tgz", + "integrity": "sha512-d+lR+nEli4igzFnbQsEz+dDSN7Yg9gtnF6xq5jWbwJ6Z6Eq4vF7CsGDg4COg824Hf8gemxf5ZUEuRMKw6DmjzA==", "dependencies": { - "@microsoft/kiota-abstractions": "^1.0.0-preview.24", + "@microsoft/kiota-abstractions": "^1.0.0-preview.25", "guid-typescript": "^1.0.9", "tslib": "^2.3.1" } }, "node_modules/@microsoft/kiota-serialization-json": { - "version": "1.0.0-preview.22", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-json/-/kiota-serialization-json-1.0.0-preview.22.tgz", - "integrity": "sha512-XziuBnjawk3aKfTP136bsU5Q/a8YcOq/JVNNnh3JFjZA6CAcDxqAZ24DPSSy5BULySt45pVHHUxsSolTY4ra5Q==", + "version": "1.0.0-preview.23", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-json/-/kiota-serialization-json-1.0.0-preview.23.tgz", + "integrity": "sha512-1mziNXBbsthCDczT+HEiqFmqLIbDfoLDtdV5kAhAmgy+UNBxvakL/kIdN1qcY6pLQia9Bp2N5r4Q6V3cZ5wgSg==", + "dependencies": { + "@microsoft/kiota-abstractions": "^1.0.0-preview.25", + "guid-typescript": "^1.0.9", + "tslib": "^2.3.1" + } + }, + "node_modules/@microsoft/kiota-serialization-multipart": { + "version": "1.0.0-preview.2", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-multipart/-/kiota-serialization-multipart-1.0.0-preview.2.tgz", + "integrity": "sha512-kcUPELssK95duKZME+agB9Mce8Suwvm9GG1HLp+GvnKmmujjnPkNV3PCW2U5YWQiChecVB6jqF3nKEvkAPnk7g==", "dependencies": { - "@microsoft/kiota-abstractions": "^1.0.0-preview.24", + "@microsoft/kiota-abstractions": "^1.0.0-preview.25", "guid-typescript": "^1.0.9", "tslib": "^2.3.1" } }, "node_modules/@microsoft/kiota-serialization-text": { - "version": "1.0.0-preview.21", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-text/-/kiota-serialization-text-1.0.0-preview.21.tgz", - "integrity": "sha512-X6eb8OTfH589ih4DetYLg73IITVntKe6eNhFkT6fWH2/EwaHJhK3oXEm6eXqRuCYuDYnZSjF0yRC2mtZdH0wPQ==", + "version": "1.0.0-preview.22", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-text/-/kiota-serialization-text-1.0.0-preview.22.tgz", + "integrity": "sha512-G2OVZH+UzFQ5Xt+U2GTVDwr7XHA84T3NdjQPNGBeu+CvyZsXsOjNjzYhGbli4G1WZgbxMqwL49jMLYdzOANilw==", "dependencies": { - "@microsoft/kiota-abstractions": "^1.0.0-preview.24", + "@microsoft/kiota-abstractions": "^1.0.0-preview.25", "guid-typescript": "^1.0.9", "tslib": "^2.3.1" } @@ -1682,9 +1693,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", - "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -3001,9 +3012,9 @@ } }, "node_modules/tslib": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", - "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz", + "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==" }, "node_modules/type-check": { "version": "0.4.0", diff --git a/it/typescript/package.json b/it/typescript/package.json index 1c1b24e148..fda8b27ba0 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -36,6 +36,7 @@ "@microsoft/kiota-http-fetchlibrary": "^1.0.0-preview.23", "@microsoft/kiota-serialization-form": "^1.0.0-preview.13", "@microsoft/kiota-serialization-json": "^1.0.0-preview.22", + "@microsoft/kiota-serialization-multipart": "^1.0.0-preview.2", "@microsoft/kiota-serialization-text": "^1.0.0-preview.21", "express": "^4.18.2", "node-fetch": "^2.6.9" From f1fad69f5d985f15c3226088880ff313eababc2d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 2 Aug 2023 09:26:27 -0400 Subject: [PATCH 14/20] - adds multipart packages to clients --- src/Kiota.Builder/Kiota.Builder.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Kiota.Builder.csproj b/src/Kiota.Builder/Kiota.Builder.csproj index 1306f00efe..1ccfb4591f 100644 --- a/src/Kiota.Builder/Kiota.Builder.csproj +++ b/src/Kiota.Builder/Kiota.Builder.csproj @@ -43,10 +43,11 @@ all - + + From f0fb4e6182a1cbcdd11932f5ec69a8f32c7c25be Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 2 Aug 2023 11:20:42 -0400 Subject: [PATCH 15/20] - fixes go integration test dependencies setup Signed-off-by: Vincent Biret --- it/go/go.mod | 2 +- it/go/go.sum | 32 +------------------------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/it/go/go.mod b/it/go/go.mod index df37365d83..cce5813307 100644 --- a/it/go/go.mod +++ b/it/go/go.mod @@ -9,6 +9,7 @@ require ( github.com/microsoft/kiota-http-go v1.0.0 github.com/microsoft/kiota-serialization-form-go v1.0.0 github.com/microsoft/kiota-serialization-json-go v1.0.4 + github.com/microsoft/kiota-serialization-multipart-go v1.0.0 github.com/microsoft/kiota-serialization-text-go v1.0.0 ) @@ -23,7 +24,6 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/microsoft/kiota-serialization-multipart-go v1.0.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.8.4 // indirect diff --git a/it/go/go.sum b/it/go/go.sum index 6e6da97eff..692f19a46e 100644 --- a/it/go/go.sum +++ b/it/go/go.sum @@ -1,24 +1,17 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/cjlapao/common-go v0.0.39 h1:bAAUrj2B9v0kMzbAOhzjSmiyDy+rd56r2sy7oEiQLlA= github.com/cjlapao/common-go v0.0.39/go.mod h1:M3dzazLjTjEtZJbbxoA5ZDiGCiHmpwqW9l4UWaddwOA= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -32,8 +25,6 @@ github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/microsoft/kiota-abstractions-go v1.1.0 h1:X1aKlsYCRs/0RSChr/fbq4j/+kxRzbSY5GeWhtHQNYI= -github.com/microsoft/kiota-abstractions-go v1.1.0/go.mod h1:RkxyZ5x87Njik7iVeQY9M2wtrrL1MJZcXiI/BxD/82g= github.com/microsoft/kiota-abstractions-go v1.2.0 h1:lUriJgqdCY/QajwWQOgTCQE9Atywfe2NHhgoTCSXTRE= github.com/microsoft/kiota-abstractions-go v1.2.0/go.mod h1:RkxyZ5x87Njik7iVeQY9M2wtrrL1MJZcXiI/BxD/82g= github.com/microsoft/kiota-authentication-azure-go v1.0.0 h1:29FNZZ/4nnCOwFcGWlB/sxPvWz487HA2bXH8jR5k2Rk= @@ -42,8 +33,7 @@ github.com/microsoft/kiota-http-go v1.0.0 h1:F1hd6gMlLeEgH2CkRB7z13ow7LxMKMWEmms github.com/microsoft/kiota-http-go v1.0.0/go.mod h1:eujxJliqodotsYepIc6ihhK+vXMMt5Q8YiSNL7+7M7U= github.com/microsoft/kiota-serialization-form-go v1.0.0 h1:UNdrkMnLFqUCccQZerKjblsyVgifS11b3WCx+eFEsAI= github.com/microsoft/kiota-serialization-form-go v1.0.0/go.mod h1:h4mQOO6KVTNciMF6azi1J9QB19ujSw3ULKcSNyXXOMA= -github.com/microsoft/kiota-serialization-json-go v1.0.3 h1:U0VR3IPP8an9BHunuKykqpCIvM3FJzjMQy8tiit+FTk= -github.com/microsoft/kiota-serialization-json-go v1.0.3/go.mod h1:rM4+FsAY+9AEpBsBzkFFis+b/LZLlNKKewuLwK9Q6Mg= +github.com/microsoft/kiota-serialization-json-go v1.0.4 h1:5TaISWwd2Me8clrK7SqNATo0tv9seOq59y4I5953egQ= github.com/microsoft/kiota-serialization-json-go v1.0.4/go.mod h1:rM4+FsAY+9AEpBsBzkFFis+b/LZLlNKKewuLwK9Q6Mg= github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJympbXNaeV07K0d46IfuEd5v9+pBs= github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so= @@ -53,47 +43,27 @@ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= -go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= -go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= -go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= -go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From af86b7d1998169618455350bdc24567af706f133 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 2 Aug 2023 14:07:24 -0400 Subject: [PATCH 16/20] - fixes typescript integration tests deps --- it/typescript/package-lock.json | 54 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index 32f6c28eea..43a66a405c 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -663,9 +663,9 @@ "dev": true }, "node_modules/@microsoft/kiota-abstractions": { - "version": "1.0.0-preview.25", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-abstractions/-/kiota-abstractions-1.0.0-preview.25.tgz", - "integrity": "sha512-I+1WnhKeLK6tRqOw6fsvNq1SvHZv9H3/xdpg1MRyHQGiYBCK8oOzPYAvBeSztdy39zsMHYeTwEDVf+2llWjlKw==", + "version": "1.0.0-preview.26", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-abstractions/-/kiota-abstractions-1.0.0-preview.26.tgz", + "integrity": "sha512-+8s1TvvJrWLHDjtZeKw9Han3kaKKOuGQ8PSC0KRno/Uj1j1cSGrsYF8kUOsnjIFvC4u5rPRFLkt+0iUNJFRJJA==", "dependencies": { "@opentelemetry/api": "^1.2.0", "guid-typescript": "^1.0.9", @@ -684,22 +684,22 @@ } }, "node_modules/@microsoft/kiota-authentication-azure": { - "version": "1.0.0-preview.20", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-authentication-azure/-/kiota-authentication-azure-1.0.0-preview.20.tgz", - "integrity": "sha512-Ixpp/NBryBdZ/FrD8MxOL9a9eis1R8CgBqXJ7iRj8cFsus+WzRwU7yHXehcHA2wvnLXrYhbfYHq5AocX0xS6Qg==", + "version": "1.0.0-preview.21", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-authentication-azure/-/kiota-authentication-azure-1.0.0-preview.21.tgz", + "integrity": "sha512-CpmHMVsSRgFCpo4eeikcuNjqqugG46DR3oS15PVpai9dG5N3AbaHlDBLUfhP1Jf3buomSAM2fBgzhmvmNw9/UQ==", "dependencies": { "@azure/core-auth": "^1.3.2", - "@microsoft/kiota-abstractions": "^1.0.0-preview.25", + "@microsoft/kiota-abstractions": "^1.0.0-preview.26", "@opentelemetry/api": "^1.2.0", "tslib": "^2.3.1" } }, "node_modules/@microsoft/kiota-http-fetchlibrary": { - "version": "1.0.0-preview.24", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-http-fetchlibrary/-/kiota-http-fetchlibrary-1.0.0-preview.24.tgz", - "integrity": "sha512-3jFfb9xQI7+OUzhJG1+kVpdtlGEA2HKHLJlEo7RSs1viSoJNTtxDferyh5E0yTsaL6ruzISQ94aTkcb5GgB29A==", + "version": "1.0.0-preview.25", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-http-fetchlibrary/-/kiota-http-fetchlibrary-1.0.0-preview.25.tgz", + "integrity": "sha512-rJRvZpBu83zP1x4dKJ9O0Ms7bzOx322EarV9hhzOkQ7ZIhyP5SYyQsezvJz5nb/+QzdsVllkbQMyENn/JquBAg==", "dependencies": { - "@microsoft/kiota-abstractions": "^1.0.0-preview.25", + "@microsoft/kiota-abstractions": "^1.0.0-preview.26", "@opentelemetry/api": "^1.2.0", "guid-typescript": "^1.0.9", "node-fetch": "^2.6.5", @@ -707,41 +707,41 @@ } }, "node_modules/@microsoft/kiota-serialization-form": { - "version": "1.0.0-preview.14", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-form/-/kiota-serialization-form-1.0.0-preview.14.tgz", - "integrity": "sha512-d+lR+nEli4igzFnbQsEz+dDSN7Yg9gtnF6xq5jWbwJ6Z6Eq4vF7CsGDg4COg824Hf8gemxf5ZUEuRMKw6DmjzA==", + "version": "1.0.0-preview.15", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-form/-/kiota-serialization-form-1.0.0-preview.15.tgz", + "integrity": "sha512-mEMqcg4P4gL56FPBbaPeO0fZustiaKhkBt9siBDxmV/cqK6rxEhKMFVsHo18sIWZh3I60nG+VCObKdeXFpXAlw==", "dependencies": { - "@microsoft/kiota-abstractions": "^1.0.0-preview.25", + "@microsoft/kiota-abstractions": "^1.0.0-preview.26", "guid-typescript": "^1.0.9", "tslib": "^2.3.1" } }, "node_modules/@microsoft/kiota-serialization-json": { - "version": "1.0.0-preview.23", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-json/-/kiota-serialization-json-1.0.0-preview.23.tgz", - "integrity": "sha512-1mziNXBbsthCDczT+HEiqFmqLIbDfoLDtdV5kAhAmgy+UNBxvakL/kIdN1qcY6pLQia9Bp2N5r4Q6V3cZ5wgSg==", + "version": "1.0.0-preview.24", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-json/-/kiota-serialization-json-1.0.0-preview.24.tgz", + "integrity": "sha512-fnU89kafYq6if9oqMshHsL8rucDN+Xr2Cow5uWQauhfDLFrfwGaJK0Kcl9svHFwQ8CYJIUeHPNSu5WZB89LaCw==", "dependencies": { - "@microsoft/kiota-abstractions": "^1.0.0-preview.25", + "@microsoft/kiota-abstractions": "^1.0.0-preview.26", "guid-typescript": "^1.0.9", "tslib": "^2.3.1" } }, "node_modules/@microsoft/kiota-serialization-multipart": { - "version": "1.0.0-preview.2", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-multipart/-/kiota-serialization-multipart-1.0.0-preview.2.tgz", - "integrity": "sha512-kcUPELssK95duKZME+agB9Mce8Suwvm9GG1HLp+GvnKmmujjnPkNV3PCW2U5YWQiChecVB6jqF3nKEvkAPnk7g==", + "version": "1.0.0-preview.3", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-multipart/-/kiota-serialization-multipart-1.0.0-preview.3.tgz", + "integrity": "sha512-w1cAy6twf11/tuSNNt4U+FgMueeBzGxpoJsaQl0p2D22FwT71/itIwhIZMwUjUu/Tejs9nCW1UdAy3AHjWuuWw==", "dependencies": { - "@microsoft/kiota-abstractions": "^1.0.0-preview.25", + "@microsoft/kiota-abstractions": "^1.0.0-preview.26", "guid-typescript": "^1.0.9", "tslib": "^2.3.1" } }, "node_modules/@microsoft/kiota-serialization-text": { - "version": "1.0.0-preview.22", - "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-text/-/kiota-serialization-text-1.0.0-preview.22.tgz", - "integrity": "sha512-G2OVZH+UzFQ5Xt+U2GTVDwr7XHA84T3NdjQPNGBeu+CvyZsXsOjNjzYhGbli4G1WZgbxMqwL49jMLYdzOANilw==", + "version": "1.0.0-preview.23", + "resolved": "https://registry.npmjs.org/@microsoft/kiota-serialization-text/-/kiota-serialization-text-1.0.0-preview.23.tgz", + "integrity": "sha512-4mu2q6qubcPBXwcslzyHxAGTfoAUnnm3/dwWMQeLKxuHEWopuaEW3OGNdpXpV4ON303OFO2gVCx6pYhjktZ32A==", "dependencies": { - "@microsoft/kiota-abstractions": "^1.0.0-preview.25", + "@microsoft/kiota-abstractions": "^1.0.0-preview.26", "guid-typescript": "^1.0.9", "tslib": "^2.3.1" } From 4b965cc67630fa304a535b0f2157fb08713bf06b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 2 Aug 2023 14:11:22 -0400 Subject: [PATCH 17/20] - adds suppressions for multipart body for php and python Signed-off-by: Vincent Biret --- it/config.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/it/config.json b/it/config.json index 2de843bf67..a4b0f69fbd 100644 --- a/it/config.json +++ b/it/config.json @@ -259,6 +259,14 @@ { "Language": "ruby", "Rationale": "https://github.com/microsoft/kiota/issues/2484" + }, + { + "Language": "python", + "Rationale": "https://github.com/microsoft/kiota/issues/3030" + }, + { + "Language": "php", + "Rationale": "https://github.com/microsoft/kiota/issues/3029" } ] }, From 044ff1a2b8ca44519a88492e80a3800b41a1c811 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 2 Aug 2023 14:18:06 -0400 Subject: [PATCH 18/20] - adds missing dependency for basic java integration tests --- it/java/basic/pom.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/it/java/basic/pom.xml b/it/java/basic/pom.xml index 825609a306..59d5dab9ea 100644 --- a/it/java/basic/pom.xml +++ b/it/java/basic/pom.xml @@ -15,7 +15,7 @@ UTF-8 UTF-8 - 0.4.5 + 0.5.0 @@ -39,6 +39,11 @@ microsoft-kiota-serialization-form ${kiota-java.version} + + com.microsoft.kiota + microsoft-kiota-serialization-multipart + ${kiota-java.version} + com.microsoft.kiota microsoft-kiota-http-okHttp From f2757b12d3b7323fa6252eed4f4d2ee0b83554c8 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 2 Aug 2023 14:27:24 -0400 Subject: [PATCH 19/20] - adds multipart dependency to basic go and dotnet packages --- it/csharp/basic/basic.csproj | 1 + it/go/basic/go.mod | 16 +++++++++------- it/go/basic/go.sum | 35 ++++++++++++++++------------------- it/go/go.sum | 1 + 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/it/csharp/basic/basic.csproj b/it/csharp/basic/basic.csproj index 32ff9d2ecf..445867dc65 100644 --- a/it/csharp/basic/basic.csproj +++ b/it/csharp/basic/basic.csproj @@ -14,6 +14,7 @@ + diff --git a/it/go/basic/go.mod b/it/go/basic/go.mod index c82aa71635..0d5d557d62 100644 --- a/it/go/basic/go.mod +++ b/it/go/basic/go.mod @@ -3,23 +3,25 @@ module integrationtest go 1.20 require ( - github.com/microsoft/kiota-abstractions-go v0.19.0 + github.com/microsoft/kiota-abstractions-go v1.2.0 + github.com/microsoft/kiota-http-go v0.16.1 github.com/microsoft/kiota-serialization-form-go v0.9.0 - github.com/microsoft/kiota-serialization-json-go v0.9.0 + github.com/microsoft/kiota-serialization-json-go v1.0.4 + github.com/microsoft/kiota-serialization-multipart-go v1.0.0 github.com/microsoft/kiota-serialization-text-go v0.7.0 ) require ( github.com/cjlapao/common-go v0.0.39 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/microsoft/kiota-http-go v0.16.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.8.2 // indirect + github.com/stretchr/testify v1.8.4 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect - go.opentelemetry.io/otel v1.14.0 // indirect - go.opentelemetry.io/otel/trace v1.14.0 // indirect + go.opentelemetry.io/otel v1.16.0 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.opentelemetry.io/otel/trace v1.16.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/it/go/basic/go.sum b/it/go/basic/go.sum index 960d996142..358aa45b1c 100644 --- a/it/go/basic/go.sum +++ b/it/go/basic/go.sum @@ -1,11 +1,10 @@ github.com/cjlapao/common-go v0.0.39 h1:bAAUrj2B9v0kMzbAOhzjSmiyDy+rd56r2sy7oEiQLlA= github.com/cjlapao/common-go v0.0.39/go.mod h1:M3dzazLjTjEtZJbbxoA5ZDiGCiHmpwqW9l4UWaddwOA= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= @@ -13,33 +12,31 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/microsoft/kiota-abstractions-go v0.19.0 h1:R57UbZaIMdouccDpBMTNiwXljN/sOkeRSpXLtBAl2wg= -github.com/microsoft/kiota-abstractions-go v0.19.0/go.mod h1:0lbPErVO6Rj3HHpntNYW/OFmHhJJ1ewPdsi1xPxYIMc= +github.com/microsoft/kiota-abstractions-go v1.2.0 h1:lUriJgqdCY/QajwWQOgTCQE9Atywfe2NHhgoTCSXTRE= +github.com/microsoft/kiota-abstractions-go v1.2.0/go.mod h1:RkxyZ5x87Njik7iVeQY9M2wtrrL1MJZcXiI/BxD/82g= github.com/microsoft/kiota-http-go v0.16.1 h1:5SZbSwHs14Xve5VMQHHz00lwL/kEg3H9rgESAUrXnvw= github.com/microsoft/kiota-http-go v0.16.1/go.mod h1:pKSaeSaBwh3Zadbnzw3kALEZbCZA1gq7A5PuxwVd/aU= github.com/microsoft/kiota-serialization-form-go v0.9.0 h1:ZMyvuxg7z1LmRWJOXr5QuJlwnD/tuNatb+k1KPURBFQ= github.com/microsoft/kiota-serialization-form-go v0.9.0/go.mod h1:FQqYzIrGX6KUoDOlg+DhDWoGaZoB8AicBYGOsBq0Dw4= -github.com/microsoft/kiota-serialization-json-go v0.9.0 h1:Em/YJb3eQGxcjNIPqKuaKrcuD0ib7tWXfaWccJrtIcc= -github.com/microsoft/kiota-serialization-json-go v0.9.0/go.mod h1:S7Ltu0/5hQjfeWmV9vQT5KYdFOsqHGdfMoP4Zo9Ctlw= +github.com/microsoft/kiota-serialization-json-go v1.0.4 h1:5TaISWwd2Me8clrK7SqNATo0tv9seOq59y4I5953egQ= +github.com/microsoft/kiota-serialization-json-go v1.0.4/go.mod h1:rM4+FsAY+9AEpBsBzkFFis+b/LZLlNKKewuLwK9Q6Mg= +github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJympbXNaeV07K0d46IfuEd5v9+pBs= +github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so= github.com/microsoft/kiota-serialization-text-go v0.7.0 h1:uayeq8fpDcZgL0zDyLkYZsH6zNnEXKgp+bRWfR5LcxA= github.com/microsoft/kiota-serialization-text-go v0.7.0/go.mod h1:2su1PTllHCMNkHugmvpYad+AKBXUUGoiNP3xOAJUL7w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= -go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= -go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= -go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= -go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/it/go/go.sum b/it/go/go.sum index 692f19a46e..2ae860c463 100644 --- a/it/go/go.sum +++ b/it/go/go.sum @@ -43,6 +43,7 @@ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= From 03e730035b92bf9fb25ac7c4ccf06112b6b96961 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 2 Aug 2023 14:29:25 -0400 Subject: [PATCH 20/20] - upgrades dependencies on basic dotnet integration test --- it/csharp/basic/basic.csproj | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/it/csharp/basic/basic.csproj b/it/csharp/basic/basic.csproj index 445867dc65..9559fd1297 100644 --- a/it/csharp/basic/basic.csproj +++ b/it/csharp/basic/basic.csproj @@ -10,22 +10,22 @@ - - + + - + - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + \ No newline at end of file