Title: Converting strings to other types can change values · Issue #69 · stleary/JSON-java · GitHub
Open Graph Title: Converting strings to other types can change values · Issue #69 · stleary/JSON-java
X Title: Converting strings to other types can change values · Issue #69 · stleary/JSON-java
Description: Hi Douglas The attempt to guess the type of a text node or an attribute value may change the type which may be unintended. If the intended type is a string, "01" is not equal with "1". So operations change values which can cause unwanted...
Open Graph Description: Hi Douglas The attempt to guess the type of a text node or an attribute value may change the type which may be unintended. If the intended type is a string, "01" is not equal with "1". So operation...
X Description: Hi Douglas The attempt to guess the type of a text node or an attribute value may change the type which may be unintended. If the intended type is a string, "01" is not equal with "1...
Opengraph URL: https://github.com/stleary/JSON-java/issues/69
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Converting strings to other types can change values","articleBody":"Hi Douglas\n\nThe attempt to guess the type of a text node or an attribute value may change the type which may be unintended. If the intended type is a string, \"01\" is not equal with \"1\". So operations change values which can cause unwanted effects. \nFurthermore the behavior is not consistent: \"00\" remains unchanged (remains a String) while \"01\" is converted to the number 1 as you can see in the sample below.\nAlso automatic conversion to boolean might have unwanted effects. Imagine the title of a book's chapter is \"True\" - intentionally with upper case \"T\". As far as I could see currently I am not able to convert this title to Json without implicitly changing it to a boolean and therefore losing information. \n\nSample: \n\nxml:\n<root>\n <id>01</id>\n <id>1</id>\n <id>00</id>\n <id>0</id>\n <title>True</title>\n</root>\n\ncode:\nprintln org.json.JSONML.toJSONArray(xml)\n\noutput:\n[\"root\",[\"id\",1],[\"id\",1],[\"id\",\"00\"],[\"id\",0],[\"title\",true]]\n\nI would suggest to either change this or at least to add an option to control the behavior in a static way. (e.g. adding a non-final static boolean field KEEP_STRINGS which can be set to true)\n\nBest regards,\nyaccob\n","author":{"url":"https://github.com/yaccob","@type":"Person","name":"yaccob"},"datePublished":"2012-11-14T12:01:00Z","url":"https://github.com/stleary/JSON-java/issues/69"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:f3b9110a-7aef-ead9-31fd-3dc2b1aed438 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C562:2E48C5:3F663:55A2F:6AFD3C4D |
| html-safe-nonce | 68cd0d8764bf32efab30458ace57e2ad592a052a94f369f478641ecf5b22bcb9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTYyOjJFNDhDNTozRjY2Mzo1NUEyRjo2QUZEM0M0RCIsInZpc2l0b3JfaWQiOiIxOTMyOTQ3MDQ4MzU3NTEwMjIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e3610b2fe057f792d5d5f800c04191bc65ffb1b19280684b9b4ecb96927371a2 |
| hovercard-subject-tag | issue:8352014 |
| 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/stleary/JSON-java/69/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c1a80fde0de1c4f39d0aec8db19ebf9f8d7f32e0af9908597d04b8f53b7615db/stleary/JSON-java/issues/69 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c1a80fde0de1c4f39d0aec8db19ebf9f8d7f32e0af9908597d04b8f53b7615db/stleary/JSON-java/issues/69 |
| og:image:alt | Hi Douglas The attempt to guess the type of a text node or an attribute value may change the type which may be unintended. If the intended type is a string, "01" is not equal with "1". So operation... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yaccob |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| turbo-cache-control | no-preview |
| go-import | github.com/stleary/JSON-java git https://github.com/stleary/JSON-java.git |
| octolytics-dimension-user_id | 5107558 |
| octolytics-dimension-user_login | stleary |
| octolytics-dimension-repository_id | 1187853 |
| octolytics-dimension-repository_nwo | stleary/JSON-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1187853 |
| octolytics-dimension-repository_network_root_nwo | stleary/JSON-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 | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width