Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #109 from edoust/main
Browse files Browse the repository at this point in the history
Adding support for deserializing arrays of type 'long'
  • Loading branch information
baywet authored Jul 13, 2023
2 parents 295cfe1 + 274ff68 commit 7cbe39c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

## [1.0.8] - 2023-07-14

### Changed

- Fixes deserialization of arrays with item type long

## [1.0.7] - 2023-06-28

### Changed
Expand All @@ -29,7 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

-Fixes a bug where 'new' keyword on derived classes from IParsable is not being respected, returning null properties for json parsed nodes
- Fixes a bug where 'new' keyword on derived classes from IParsable is not being respected, returning null properties for json parsed nodes

### Added

Expand Down
3 changes: 3 additions & 0 deletions src/JsonParseNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public IEnumerable<T> GetCollectionOfObjectValues<T>(ParsableFactory<T> factory)
private static readonly Type stringType = typeof(string);
private static readonly Type intType = typeof(int?);
private static readonly Type floatType = typeof(float?);
private static readonly Type longType = typeof(long?);
private static readonly Type doubleType = typeof(double?);
private static readonly Type guidType = typeof(Guid?);
private static readonly Type dateTimeOffsetType = typeof(DateTimeOffset?);
Expand Down Expand Up @@ -257,6 +258,8 @@ public IEnumerable<T> GetCollectionOfPrimitiveValues<T>()
yield return (T)(object)currentParseNode.GetIntValue()!;
else if(genericType == floatType)
yield return (T)(object)currentParseNode.GetFloatValue()!;
else if(genericType == longType)
yield return (T)(object)currentParseNode.GetLongValue()!;
else if(genericType == doubleType)
yield return (T)(object)currentParseNode.GetDoubleValue()!;
else if(genericType == guidType)
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Kiota.Serialization.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageProjectUrl>https://aka.ms/kiota/docs</PackageProjectUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<Deterministic>true</Deterministic>
<VersionPrefix>1.0.7</VersionPrefix>
<VersionPrefix>1.0.8</VersionPrefix>
<VersionSuffix></VersionSuffix>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down

0 comments on commit 7cbe39c

Please sign in to comment.