Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into andrueastman/intergra…
Browse files Browse the repository at this point in the history
…tiontests
  • Loading branch information
andrueastman committed Oct 17, 2024
2 parents 2dd9628 + f124023 commit 0143d73
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Fixed an issue where when generating Go code the deserializer for unions was using `CodeClass` as a filter and not `CodeInterface`. [#4844](https://github.com/microsoft/kiota/issues/4844)
- 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 All @@ -23,7 +26,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

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",
("number" or "integer", "uint8") => "byte",
("number" or "integer", "int64") => "int64",
("number", "int16") => "integer",
("number", "int32") => "integer",
("number", _) => "double",
("integer", _) => "integer",
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ private static void WriteDeserializerBodyForUnionModel(CodeMethod method, CodeCl
var otherPropGetters = parentClass
.GetPropertiesOfKind(CodePropertyKind.Custom)
.Where(static x => !x.ExistsInBaseType && x.Getter != null)
.Where(static x => x.Type is CodeType propertyType && !propertyType.IsCollection && propertyType.TypeDefinition is CodeClass)
.Where(static x => x.Type is CodeType propertyType && !propertyType.IsCollection && propertyType.TypeDefinition is CodeInterface)
.OrderBy(static x => x, CodePropertyTypeForwardComparer)
.ThenBy(static x => x.Name)
.Select(static x => x.Getter!.Name.ToFirstCharacterUpperCase())
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
12 changes: 8 additions & 4 deletions tests/Kiota.Builder.Tests/Writers/Go/CodeMethodWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,20 @@ private void AddSerializationBackingStoreMethods()
}
private CodeClass AddUnionTypeWrapper()
{
var complexType1 = root.AddClass(new CodeClass
var complexType1 = root.AddInterface(new CodeInterface
{
Name = "ComplexType1",
Kind = CodeClassKind.Model,
Kind = CodeInterfaceKind.Model,
OriginalClass = new CodeClass { Name = "ComplexType1", Kind = CodeClassKind.Model }
}).First();
var complexType2 = root.AddClass(new CodeClass

var complexType2 = root.AddInterface(new CodeInterface
{
Name = "ComplexType2",
Kind = CodeClassKind.Model,
Kind = CodeInterfaceKind.Model,
OriginalClass = new CodeClass { Name = "ComplexType2", Kind = CodeClassKind.Model }
}).First();

var unionTypeWrapper = root.AddClass(new CodeClass
{
Name = "UnionTypeWrapper",
Expand Down

0 comments on commit 0143d73

Please sign in to comment.