diff --git a/CHANGELOG.md b/CHANGELOG.md index 6daf502919..0a8f66de02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 -Fixed python generation client serailization failure str being quoted as "str" --Fixed Issue with primitive values being stringified in python python. [#5417](https://github.com/microsoft/kiota/issues/5417) +- 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 @@ -27,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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 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")]