...
|
...
|
@@ -29,7 +29,6 @@ EXAMPLES = ''' |
|
|
from ansible.module_utils.basic import *
|
|
|
import requests
|
|
|
import json
|
|
|
from jsonschema import validate
|
|
|
import jsonschema
|
|
|
|
|
|
'''
|
...
|
...
|
@@ -49,7 +48,7 @@ def check_http_status(url, content_type, params, schema, headers = {}): |
|
|
# json validate
|
|
|
if schema :
|
|
|
try:
|
|
|
validate(r.json(), json.loads(schema))
|
|
|
jsonschema.validate(r.json(), json.loads(schema))
|
|
|
ret["code"] = 200
|
|
|
except jsonschema.exceptions.ValidationError :
|
|
|
ret["code"] = 500
|
...
|
...
|
|