22
19

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のsyntax checkを行う

Posted at
knife solo cook hoge

みたいな事をやったときにjsonのsyntaxエラーが発生すると、人生絶望しちゃいますよね?
knife soloとかしているとあまりエラーが優しくない・・・そうこんな風にね。

ERROR: JSON::ParserError: 399: unexpected token at ...

数十行程度だったらいいけど、行数が多くなったらもう発狂するレベル。
まあnodes/hoge.jsonとかにそんなに行数書くなよって話でもありますが...w

じゃあどうするのか?
そんなときはこんなコマンドを使いましょう

$ cat nodes/hoge.json | python -mjson.tool
Expecting , delimiter: line 17 column 7 (char 324)

以上、無駄にjson眺めてる暇あったpythonのjson.tool使った方がいいよってお話でした。

22
19
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
22
19

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?