5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jsonのフォーマットチェックを行うコマンド json_verifyのインストール (Mac)

Posted at

yajl というパッケージに入っているらしい。brew からインストール。

% brew install yajl
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/yajl-2.1.0.yosemite.bottle.3.tar.gz
######################################################################## 100.0%
==> Pouring yajl-2.1.0.yosemite.bottle.3.tar.gz
?  /usr/local/Cellar/yajl/2.1.0: 15 files, 232K

チェック成功例

% cat composer.json | json_verify
JSON is valid

失敗するとこんな感じ

% cat dame.json|json_verify
lexical error: invalid string in json text.
                                        {"hoge: "foga", "fff": "bbb"}
                     (right here) ------^
JSON is invalid

その他にも、json_reformat というコマンドもインストールされました。

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?