JSONPath: big numbers in the results are rounded
I maintainer di solito rispondono entro 1 giorno
@arxh80 ci sta già lavorando.
Dal 21/10/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nextjs, typescript
- Ambito
- developer-experience, tooling
Direzione di ricerca
Read lib/jsonpath.ts and its tests in lib/__tests__/jsonpath.test.ts, then trace how ConversionPanel.tsx formats and copies matches. Preserve native JSONPath evaluation while retrieving matched values from the lossless parse and handling duplicate-key errors. Done means the listed precision, pointer, filter, and error cases pass, along with the requested lint, test, and build commands.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The JSON formatter's FAQ says "very large integers and high-precision decimals keep every digit" (lib/tools.ts, line 94), and Code view and Tree view do keep them. The JSONPath panel doesn't. With this JSON
{"a": 12345678901234567890, "b": 0.1000000000000000055511151231257827}
and the expression $.*, the panel shows
[
12345678901234567000,
0.1
]
and Copy matches copies the same rounded text. runJsonPath parses the input with the native JSON.parse (lib/jsonpath.ts, line 15), and the panel prints the matches with JSON.stringify (ConversionPanel.tsx, lines 226 and 237). Tree view had the same bug (#122).
What to do
- Keep running the expression on the
JSON.parsevalue, so filters work exactly as they do now. - Also parse the input with lossless-json's
parse, and for each match take the value at itspointerfrom that tree. WithresultType: "all"(line 23), every jsonpath-plus result already has a JSON Pointer like/items/0. Keys with/or~in them are escaped as~1and~0, and the root is"". - Print the matches with lossless-json's
stringify(matches, null, 2)in the panel, for both the text and Copy matches. - lossless-json's
parsethrows on a duplicate key ({"a": 1, "a": 2}), whichJSON.parseaccepts. Catch it and return it as the result's error, like the other modes since #218, so it doesn't crash the tool.validate(lib/json-utils.ts, line 71) already runs both parsers. - Please don't run jsonpath-plus on the lossless-json tree directly. A
LosslessNumberis an object withvalueandisLosslessNumberfields, and jsonpath-plus walks into it:$..*on{"a":1,"b":{"c":2}}returns[1, {"c": 2}, "1", true, 2, "2", true],$.a.valueon{"a":5}returns"5", and filters like?(@.p === 5)and?(@.p == @.q)stop matching.
Where to look
lib/jsonpath.ts:runJsonPath(line 10), theJSON.parse(line 15) and theJSONPathcall (lines 20 to 25)app/(tools)/json-formatter/components/ConversionPanel.tsx: the matches text (line 226) and Copy matches (line 237)app/(tools)/json-formatter/components/OutputPanel.tsx: Tree view parses with lossless-json since #122 (line 153)lib/__tests__/jsonpath.test.ts: therunJsonPathtests (line 5). The filter test at line 44 expectsid: 1as a plain number, so it needs updating once the matches hold lossless-json values.
Acceptance criteria
-
$.*on the JSON above shows12345678901234567890and0.1000000000000000055511151231257827, in the panel and in Copy matches -
$..*on{"a":1,"b":{"c":2}}still gives[1, {"c": 2}, 2], and$.a.valueon{"a":5}still gives no matches - On
{"items":[{"p":5,"q":5},{"p":50,"q":1}]},$.items[?(@.p === 5)]and$.items[?(@.p == @.q)]still match the first item -
{"a": 1, "a": 2}shows the duplicate key error and the page stays up - Tests for these cases
-
npm run lint,npm run testandnpm run buildpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #238 in the description.
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 9
- Merge medio
- 9h 50m
- PR unite (30g)
- 105
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codercops/toolbelt
-
Color converter: the contrast ratio shows `4.50 : 1` while Normal AA says FAILForse già presa @bercedev l’ha presa oggi. Apertabug good first issue hacktoberfest
codercops/toolbelt#235 · 5 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
JSON to YAML: control characters are written raw, so PyYAML and js-yaml can't read the outputForse già presa @anurag2787 l’ha presa oggi. Apertabug good first issue hacktoberfest
codercops/toolbelt#234 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
JSON formatter: Escape for code gives broken Python when the text has a run of single quotesForse già presa @anurag2787 l’ha presa oggi. Apertabug good first issue hacktoberfest
codercops/toolbelt#233 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Add the URL encoder to the README, the home share card and package.jsonForse già presa @Abhishek764 l’ha presa 3 giorni fa. Apertadocumentation good first issue hacktoberfest
codercops/toolbelt#153 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue hacktoberfest new tool
codercops/toolbelt#128 · 9 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codercops/toolbelt
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
chaitin/MonkeyCode#1437 ·
I maintainer di solito rispondono entro 1 giorno
-
rtdb-info-connected-order test: unhandled 'connection is closed' rejection fails the CLI suiteAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
carbon-design-system/carbon-ai-chat#2615 ·
I maintainer di solito rispondono entro 1 giorno
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlineForse già presa @r2jaff l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ComposioHQ/composio#5054 ·
I maintainer di solito rispondono entro 1 giorno