Postmanにてレスポンスボディのjsonの構造をチェックする
This section contains different examples of validating JSON responses using the Ajv schema validator. I do not recommend using the tv4 (Tiny Validator for JSON Schema v4).
とあるのでこれに従いtestスクリプトを作成する。
そのためには想定するjsonの構造からチェック用のjsonスキーマを作成する必要がある。
想定するjson を入力すると自動でjsonスキーマに変換するサイトは以下。
https://app.quicktype.io/#s=coordinate
にて左のウィンドウでJSONを選択し、右のウィンドウにJSON Schemaを選択すると表示される。
この結果にはPostmanのtestでは不要な(エラーがでる)項目があり
https://postman-quick-reference-guide.readthedocs.io/en/latest/schema-validation.html
に示してある通りに整形する必要がある。
format
additionalProperties
は不要だった。
Postmanのtest の結果でエラーについてはある程度原因を教えてくれるのでそれにしたがって不要な物を消してPostmanでテスト。
Author And Source
この問題について(Postmanにてレスポンスボディのjsonの構造をチェックする), 我々は、より多くの情報をここで見つけました https://qiita.com/testpilot031/items/5916d76383ef6d63576a著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .