JSONPath: big numbers in the results are rounded
Los mantenedores suelen responder en 1 día
@arxh80 ya está trabajando en esto.
Desde el 21/10/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- nextjs, typescript
- Área
- developer-experience, tooling
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1
- Forks
- 9
- Merge medio
- 9 h 50 min
- PR fusionados (30 d)
- 105
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codercops/toolbelt
-
Color converter: the contrast ratio shows `4.50 : 1` while Normal AA says FAILPosiblemente ocupada @bercedev la tomó hoy. Abiertobug good first issue hacktoberfest
codercops/toolbelt#235 · 5 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
JSON to YAML: control characters are written raw, so PyYAML and js-yaml can't read the outputPosiblemente ocupada @anurag2787 la tomó hoy. Abiertobug good first issue hacktoberfest
codercops/toolbelt#234 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
JSON formatter: Escape for code gives broken Python when the text has a run of single quotesPosiblemente ocupada @anurag2787 la tomó hoy. Abiertobug good first issue hacktoberfest
codercops/toolbelt#233 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Add the URL encoder to the README, the home share card and package.jsonPosiblemente ocupada @Abhishek764 la tomó hace 3 días. Abiertodocumentation good first issue hacktoberfest
codercops/toolbelt#153 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Add a Number Base Converter toolAbiertoenhancement good first issue hacktoberfest new tool
codercops/toolbelt#128 · 9 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de codercops/toolbelt
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Renaming a projectAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
equinor/prisma-decision-web#927 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bigbluebutton/bigbluebutton#26166 ·
Los mantenedores suelen responder en 1 día