Skip to content

Conversation

@jamie-heller
Copy link
Contributor

Fix deserialization of List<Double> in JSON parse node

Summary

Adds support for java.lang.Double in JSON primitive value parsing, fixing failures when deserializing collections of doubles. Includes a unit test validating getCollectionOfPrimitiveValues(Double.class).

Motivation

Collections of Double values could not be deserialized because JsonParseNode.getPrimitiveValue lacked a Double.class branch. This broke scenarios parsing arrays like [1.1, 2.2, 3.3], including on kiota-generated model classes that contain lists of doubles.

Changes

  • Adds handling for Double.class in getPrimitiveValue by delegating to getDoubleValue() in JsonParseNodeTests
  • Adds getCollectionOfPrimitiveDoubleValues test asserting successful parsing of {"values":[1.1,2.2,3.3]} into a List. Prior to the update in getPrimitiveValue, this test failed with java.lang.RuntimeException: unknown type to deserialize java.lang.Double

@jamie-heller jamie-heller requested a review from a team as a code owner September 4, 2025 17:48
@jamie-heller
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Citrine Informatics"

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@github-project-automation github-project-automation bot moved this to In Progress 🚧 in Kiota Sep 8, 2025
@baywet baywet enabled auto-merge September 8, 2025 12:29
@baywet baywet merged commit 737591e into microsoft:main Sep 8, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from In Progress 🚧 to Done ✔️ in Kiota Sep 8, 2025
@jamie-heller
Copy link
Contributor Author

Thanks for the contribution!

Thanks for the timely review and release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants