Title: On-demand double parsing breaks on integer values · Issue #70 · simdjson/simdjson-java · GitHub
Open Graph Title: On-demand double parsing breaks on integer values · Issue #70 · simdjson/simdjson-java
X Title: On-demand double parsing breaks on integer values · Issue #70 · simdjson/simdjson-java
Description: If a JSON stream contains an integer number, SimdJsonParser will throw a parse exception if it's given a schema where that number is represented as a double. This applies to bare numbers, object values, and array entries: // All of these...
Open Graph Description: If a JSON stream contains an integer number, SimdJsonParser will throw a parse exception if it's given a schema where that number is represented as a double. This applies to bare numbers, object va...
X Description: If a JSON stream contains an integer number, SimdJsonParser will throw a parse exception if it's given a schema where that number is represented as a double. This applies to bare numbers, objec...
Opengraph URL: https://github.com/simdjson/simdjson-java/issues/70
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On-demand double parsing breaks on integer values","articleBody":"If a JSON stream contains an integer number, `SimdJsonParser` will throw a parse exception if it's given a schema where that number is represented as a double. This applies to bare numbers, object values, and array entries:\n\n```java\n// All of these throw a parse exception\ndouble rawDouble = new SimdJsonParser().parse(\"1\".getBytes(UTF_8), 1, double.class);\ndouble[] array = new SimdJsonParser().parse(\"[1, 2]\".getBytes(UTF_8), 6, double[].class);\nHasDouble box = new SimdJsonParser().parse(\"{\\\"value\\\": 1}\".getBytes(UTF_8), 12, HasDouble.class);\n\nrecord HasDouble(double value) {}\n```\n\nAs far as I can tell, this is because `NumberParser.parseDouble` requires `double` literals to either have a decimal point or exponent part. Should that be the case? I would expect integer number values to be permitted, since they can always be widened to doubles\n","author":{"url":"https://github.com/SamCarlberg","@type":"Person","name":"SamCarlberg"},"datePublished":"2025-08-12T22:53:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/70/simdjson-java/issues/70"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2c4c8fdd-d86d-0104-3b0f-9d47096568e6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB58:1CE4C:13F081E:1BC71BA:696F4721 |
| html-safe-nonce | ab3e1c50259be8584e89cb838a53eff7c7e2b397991d65f0413696dda1bb6ae4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjU4OjFDRTRDOjEzRjA4MUU6MUJDNzFCQTo2OTZGNDcyMSIsInZpc2l0b3JfaWQiOiI1OTYxMjU3ODM4MDE1NjI5MDg5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3359a20c6eb49f0814858b0c600ed9e70c285729129a9cdcf84644729b40f836 |
| hovercard-subject-tag | issue:3316196607 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/simdjson/simdjson-java/70/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3597f1586f020e8b98b377cb86dfb7db5ba2323b82257125647011fea56591b8/simdjson/simdjson-java/issues/70 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3597f1586f020e8b98b377cb86dfb7db5ba2323b82257125647011fea56591b8/simdjson/simdjson-java/issues/70 |
| og:image:alt | If a JSON stream contains an integer number, SimdJsonParser will throw a parse exception if it's given a schema where that number is represented as a double. This applies to bare numbers, object va... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SamCarlberg |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/simdjson/simdjson-java git https://github.com/simdjson/simdjson-java.git |
| octolytics-dimension-user_id | 62337925 |
| octolytics-dimension-user_login | simdjson |
| octolytics-dimension-repository_id | 664918257 |
| octolytics-dimension-repository_nwo | simdjson/simdjson-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 664918257 |
| octolytics-dimension-repository_network_root_nwo | simdjson/simdjson-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width