From 32624581794256b6f7099b81c8181f65c87a5d32 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Wed, 16 Oct 2024 15:59:12 +0300 Subject: [PATCH 1/2] fix: fixes missing mapping for the `int16` type --- CHANGELOG.md | 2 ++ src/Kiota.Builder/KiotaBuilder.cs | 1 + tests/Kiota.Builder.Tests/KiotaBuilderTests.cs | 2 ++ 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20d47e2440..418b5c9912 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 ### Changed +- Fixes mapping of `int16` format to the `integer` type rather than `double` when the type is `integer` or `number` [#5611](https://github.com/microsoft/kiota/issues/5611) + ## [1.19.1] - 2024-10-11 ### Added diff --git a/src/Kiota.Builder/KiotaBuilder.cs b/src/Kiota.Builder/KiotaBuilder.cs index 8a1a4e69f2..4325507151 100644 --- a/src/Kiota.Builder/KiotaBuilder.cs +++ b/src/Kiota.Builder/KiotaBuilder.cs @@ -1154,6 +1154,7 @@ openApiExtension is OpenApiPrimaryErrorMessageExtension primaryErrorMessageExten ("number" or "integer", "int8") => "sbyte", ("number" or "integer", "uint8") => "byte", ("number" or "integer", "int64") => "int64", + ("number", "int16") => "integer", ("number", "int32") => "integer", ("number", _) => "double", ("integer", _) => "integer", diff --git a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs index 7d7382168b..32123dcde3 100644 --- a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs +++ b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs @@ -4491,6 +4491,8 @@ public void InheritedTypeWithInlineSchemaWorks() [InlineData("integer", "int64", "int64")] [InlineData("number", "int8", "sbyte")] [InlineData("integer", "int8", "sbyte")] + [InlineData("number", "int16", "integer")] + [InlineData("integer", "int16", "integer")] [InlineData("number", "uint8", "byte")] [InlineData("integer", "uint8", "byte")] [InlineData("number", "", "double")] From 89fa81782aa6cb9be5fb2fad8f1cc7dbb9326cd5 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Wed, 16 Oct 2024 16:29:43 +0300 Subject: [PATCH 2/2] fix typo in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 418b5c9912..23ea913175 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed cyclic dependencies in generated Go code. [#2834](https://github.com/microsoft/kiota/issues/2834) - Fixed a bug where default output folder is created on plugin edit and generate commands. [#5510](https://github.com/microsoft/kiota/issues/5429) - Changed GeneratedCode attribute applied when generating CSharp to only include the major version of Kiota. [#5489](https://github.com/microsoft/kiota/issues/5489) -- Fixed genarating CSharp client displays clean hint regardless of whether --clean-output is already passed [#5576](https://github.com/microsoft/kiota/issues/5576) +- Fixed generating CSharp client displays clean hint regardless of whether --clean-output is already passed [#5576](https://github.com/microsoft/kiota/issues/5576) ## [1.19.0] - 2024-10-03