Skip to content

Commit

Permalink
fix: fixes missing mapping for the int16 type
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Omondi committed Oct 16, 2024
1 parent a14fb81 commit 3262458
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Kiota.Builder/KiotaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ openApiExtension is OpenApiPrimaryErrorMessageExtension primaryErrorMessageExten
("number" or "integer", "int8") => "sbyte",

Check warning on line 1154 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / Build

Define a constant instead of using this literal 'integer' 7 times. (https://rules.sonarsource.com/csharp/RSPEC-1192)
("number" or "integer", "uint8") => "byte",
("number" or "integer", "int64") => "int64",
("number", "int16") => "integer",
("number", "int32") => "integer",
("number", _) => "double",
("integer", _) => "integer",
Expand Down
2 changes: 2 additions & 0 deletions tests/Kiota.Builder.Tests/KiotaBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit 3262458

Please sign in to comment.