Title: [RFC] Implement custom iterator for JSONArray to ensure fetched values are JSON compliant · Issue #673 · stleary/JSON-java · GitHub
Open Graph Title: [RFC] Implement custom iterator for JSONArray to ensure fetched values are JSON compliant · Issue #673 · stleary/JSON-java
X Title: [RFC] Implement custom iterator for JSONArray to ensure fetched values are JSON compliant · Issue #673 · stleary/JSON-java
Description: This has been a "known" issue for some time, but as mentioned in #672, the JSONArray.iterator method is exposing the raw values from the backing array instead of JSON-compliant values. We should do 1 of 2 things: Implement a private/inte...
Open Graph Description: This has been a "known" issue for some time, but as mentioned in #672, the JSONArray.iterator method is exposing the raw values from the backing array instead of JSON-compliant values. We should do...
X Description: This has been a "known" issue for some time, but as mentioned in #672, the JSONArray.iterator method is exposing the raw values from the backing array instead of JSON-compliant values. We...
Opengraph URL: https://github.com/stleary/JSON-java/issues/673
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[RFC] Implement custom iterator for JSONArray to ensure fetched values are JSON compliant","articleBody":"This has been a \"known\" issue for some time, but as mentioned in #672, the `JSONArray.iterator` method is exposing the raw values from the backing array instead of JSON-compliant values.\r\n\r\nWe should do 1 of 2 things:\r\n\r\n1. Implement a private/internal `JSONArrayIterator` class that would ensure any fetched values are properly \"wrapped\" and thus suitable output to JSON processors.\r\n2. Update all of our `put*` operations to ensure that all values are properly \"wrapped\" in both `JSONObject` and `JSONArray`. This would also allow us to simplify our `toString` methods and remove the wrapping from there as all values should be proper JSON.\r\n\r\nOption 1 keeps the wrapping \"lazy\" and thus would only guarantee JSON compliance on values that are fetched. Fetching a non-wrapped value multiple times would cause wrapping to happen each time.\r\n\r\nOption 2 makes the wrapping more proactive; guaranteeing that our JSON compliance happens up-front even if the value is not fetched later. Fetching an initially non-wrapped value multiple times would cause NO wrapping to happen at fetch as it would have been pre-wrapped by the `put` operation.\r\n\r\nBoth options only affect code-built JSONObjects/Arrays. Parsed objects would be unaffected as the parser is only placing JSON-compliant values in the backing collections.\r\n\r\nThoughts on whether we should implement either option, something else, or neither?","author":{"url":"https://github.com/johnjaylward","@type":"Person","name":"johnjaylward"},"datePublished":"2022-03-21T16:17:17Z","url":"https://github.com/stleary/JSON-java/issues/673"}
| 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:30eaaa3b-ac28-9d94-ceb0-1b2b45cb63e1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8432:255994:20E667:2B8178:6AFD1321 |
| html-safe-nonce | 83f7b397ee2bc57e4da01afeef88cf270e8564c61115fa3105ee54c2174a118f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDMyOjI1NTk5NDoyMEU2Njc6MkI4MTc4OjZBRkQxMzIxIiwidmlzaXRvcl9pZCI6IjE4OTYwMzg5NTEyNzM5NjAyMjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9cf2442d21373f77fe3d66f57d72a063549b972e4dfd8a54f5cb04fab49a3ad8 |
| hovercard-subject-tag | issue:1175621270 |
| 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/673/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2ad29bb5b2d8dce852e3723c78d69ba598d5fc2db76db09fb3a2c0ad87530fa0/stleary/JSON-java/issues/673 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2ad29bb5b2d8dce852e3723c78d69ba598d5fc2db76db09fb3a2c0ad87530fa0/stleary/JSON-java/issues/673 |
| og:image:alt | This has been a "known" issue for some time, but as mentioned in #672, the JSONArray.iterator method is exposing the raw values from the backing array instead of JSON-compliant values. We should do... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | johnjaylward |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7c34e25df4e46e972c8f0225e63410231bdeb9ea5634597c712796bbcdb2e627 |
| 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 | 8fa571ebaa95e4e6bf872197c0e84b7dc48e6785 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width