json
Текстовый формат обмена данными, основанный на JavaScript.
У меня в качестве валидатора jq + flycheck в емаксе для удобства.
- https://github.com/json-emacs/json-mode, он же https://github.com/joshwnj/json-mode (там переадресация).
- https://github.com/iwahbe/jsonian/ – емаксовый мод, который пытается быть круче json-mode, в смысле, всё то же, но без зависимостей и ограничений по размеру файла.
- https://jqlang.github.io/jq/manual/
- https://jqlang.github.io/jq/tutorial/
- https://github.com/ljos/jq-mode - для работы с jq.
- https://www.rfc-editor.org/rfc/rfc9457 - RFC 9457 Problem Details for HTTP APIs (Proposed Standard)
jq, jsonlint, jsonnet.
jaq – аналог jq, c попыткой сделать краше. https://github.com/01mf02/jaq
Jq можно использовать для получения значения из json. Очень практичный для меня пример в середине цепочки:
curl "https://confluence.mywork.ru/rest/api/content/11211079?expand=body.view" -b ~/cookies.txt | jq .body.view.value | vale --config="workvaleconfig.ini"
К jq есть ещё jqp, «TUI playground to experiment with jq (program)».
Потыренное с https://github.com/devel0/linux-scripts-utils/blob/master/json-unescape. Ну, тут минималистичненько, конечно.
#!/bin/bash
sed 's#\\\"#\"#g' | sed 's#\\\\#\\#g'
Фпринципе, мне вообще надо бы постобработку значения, вытащенного через jq до нормального html.
зарезервированные символы
The following characters are reserved in JSON and must be properly escaped to be used in strings:
- Backspace is replaced with \b
- Form feed is replaced with \f
- Newline is replaced with \n
- Carriage return is replaced with \r
- Tab is replaced with \t
- Double quote is replaced with \"
- Backslash is replaced with
Forward slash (optional but often used) is replaced with \/. И это приводят как пример overescaping.
Ссылок
- https://habr.com/ru/articles/554274/
- https://github.com/simeji/jid – для всякой возни с json, написано на Go, есть в Debian.
- https://github.com/noahgorstein/jqp – json в tui.
- https://github.com/jcsalterego/jqq – querier для jq.
- https://github.com/TomWright/dasel - Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package.
- https://jsonlogic.com/ – чота не очень понятное про запросы к json.
- https://jsonhero.io/ – заковыристая отображалка.
- https://jsonnet.org/ – используется в т.ч. для конфигурации Grafana.
- https://github.com/antonmedv/fx – какая-то штука на го смотреть и процессить через tui. Подозрительно «коммерчески» выглядящий readme :) Fx is a CLI for JSON: it shows JSON interactively in your terminal, and lets you transform JSON with JavaScript. Fx is written in Go and uses goja as its embedded JavaScript engine.
- https://github.com/python-jsonschema/check-jsonschema – A JSON Schema CLI and pre-commit hook built on jsonschema. The schema may be specified as a local or remote (HTTP or HTTPS) file.
