From efcf9cf8b94d5f3b0184c1457516f07dc3e7034a Mon Sep 17 00:00:00 2001 From: Marcin Jahn Date: Thu, 5 Oct 2023 19:08:52 +0200 Subject: [PATCH 1/4] Remove WireName lowercasing --- src/Kiota.Builder/CodeDOM/CodeProperty.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kiota.Builder/CodeDOM/CodeProperty.cs b/src/Kiota.Builder/CodeDOM/CodeProperty.cs index 37b39d4e15..74994cb893 100644 --- a/src/Kiota.Builder/CodeDOM/CodeProperty.cs +++ b/src/Kiota.Builder/CodeDOM/CodeProperty.cs @@ -105,7 +105,7 @@ public bool IsNameEscaped get => !string.IsNullOrEmpty(SerializationName); } /// - public string WireName => IsNameEscaped ? SerializationName : Name.ToFirstCharacterLowerCase(); + public string WireName => IsNameEscaped ? SerializationName : Name; public CodeProperty? OriginalPropertyFromBaseType { get; set; From 3570db5a6016badcd032ea7c48d7cdcb5efed821 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 5 Oct 2023 13:47:46 -0400 Subject: [PATCH 2/4] - fixes unit tests for serialization name normalization --- .../Writers/CSharp/CodePropertyWriterTests.cs | 1 + tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Kiota.Builder.Tests/Writers/CSharp/CodePropertyWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/CSharp/CodePropertyWriterTests.cs index 3196b658f1..66f58c73f9 100644 --- a/tests/Kiota.Builder.Tests/Writers/CSharp/CodePropertyWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/CSharp/CodePropertyWriterTests.cs @@ -42,6 +42,7 @@ public CodePropertyWriterTests() Name = TypeName, TypeDefinition = derivedClass }, + SerializationName = "propertyName", }; parentClass.AddProperty(property, new() { diff --git a/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs index bee0dd083a..162173a82b 100644 --- a/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/Php/CodeMethodWriterTests.cs @@ -799,7 +799,7 @@ public async Task WriteIndexerBody() }, new object[] { - new CodeProperty { Name = "DOB", Type = new CodeType { Name = "DateTimeOffset" }, Access = AccessModifier.Private, Kind = CodePropertyKind.Custom }, + new CodeProperty { Name = "DOB", Type = new CodeType { Name = "DateTimeOffset" }, Access = AccessModifier.Private, Kind = CodePropertyKind.Custom, SerializationName = "dOB" }, "'dOB' => fn(ParseNode $n) => $o->setDOB($n->getDateTimeValue())," }, new object[] From 74785e64446e0a5dfa230111ae9949dfc9f0b5a5 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 5 Oct 2023 13:48:05 -0400 Subject: [PATCH 3/4] - adds a changelog entry for serialization name normalization --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a505829c9c..93b133a2c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Localhost based descriptions are not cached anymore to facilitate development workflows. [#3316](https://github.com/microsoft/kiota/issues/3316) - Fixed a bug where the hints would miss quotes for paths and always use the API manifest. [#3342](https://github.com/microsoft/kiota/issues/3342) - Fixed a bug where inline composed types for components schemas would have the wrong name. [#3067](https://github.com/microsoft/kiota/issues/3067) +- Fixed a bug where the casing of properties serialization name would be normalized. [kiota-serialization-json-dotnet#131](https://github.com/microsoft/kiota-serialization-json-dotnet/issues/131) - Changed parameter order in with_url method body to match the signature of RequestBuilder constructor in Python. [#3328](https://github.com/microsoft/kiota/issues/3328) - Removed redundant undefined qualifier in TypeScript for properties. [#3244](https://github.com/microsoft/kiota/issues/3244) - The default status code response is now used as 4XX and 5XX when those class responses are not provided in the description. [#3245](https://github.com/microsoft/kiota/issues/3245) From 03191fb4d9404f198d3a506125b04d6282b69634 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 5 Oct 2023 13:54:19 -0400 Subject: [PATCH 4/4] - bumps version for release 1.7.0 --- CHANGELOG.md | 7 +++++++ src/Kiota.Builder/Kiota.Builder.csproj | 12 ++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93b133a2c4..067958f17d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +### Changed + +## [1.7.0] - 2023-10-05 + +### Added + - Added support for tracing in Python. [#1872](https://github.com/microsoft/kiota/issues/1872) - Added auto-generated comment for TypeScript generation. [#3244](https://github.com/microsoft/kiota/issues/3244) - Added a new switch to exclude all assets generated only for backward compatibility. [#2952](https://github.com/microsoft/kiota/issues/2952) @@ -1088,3 +1094,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial GitHub release + diff --git a/src/Kiota.Builder/Kiota.Builder.csproj b/src/Kiota.Builder/Kiota.Builder.csproj index f3a426974c..4daa641f69 100644 --- a/src/Kiota.Builder/Kiota.Builder.csproj +++ b/src/Kiota.Builder/Kiota.Builder.csproj @@ -1,5 +1,4 @@ - Latest enable @@ -31,11 +30,10 @@ true All - - + + $(NoWarn);CS8785;NU5048;NU5104;CA1724;CA1055;CA1848;CA1308;CA1822 - @@ -55,11 +53,9 @@ - + - - \ No newline at end of file +