LoginSignup
2
1

More than 3 years have passed since last update.

Automate.Parse JSON で Invalid type. Expected {type} but got Null.となった時の対処法

Posted at

概要

Parse JSONを利用した際に、以前であれば以下で簡単に出来ていたんですが、Automateの仕様変更?によって問題が出るようになったので対処法をメモ

  • Generate From Sample にSampleのoutputs を設定してやると、Schemaが生成 image.png

エラーメッセージ

errorMessage
[
  {
    "message": "Invalid type. Expected String but got Null.",
    "lineNumber": 0,
    "linePosition": 0,
    "path": "Name",
    "schemaId": "#/properties/Name",
    "errorType": "type",
    "childErrors": []
  }
]

昔の対処法

  • "required": から対象を外す。

対処法

  1. エラーメッセージの "path" をメモ
  2. JSONの定義にいき、型修正
    1. "null" を追加 
      image.png
    2. {} にしてもOK 
      image.png
2
1
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
2
1