Make to code to skip checking swagger responses which don't have an

application/json example clearer.
pull/977/head
Mark Haines 9 years ago
parent 9896f98e2b
commit f827765ba1

@ -30,10 +30,11 @@ except ImportError as e:
def check_response(filepath, request, code, response):
example = None
try:
example = json.loads(
response.get('examples', {}).get('application/json', "null")
)
example_json = response.get('examples', {}).get('application/json')
if example_json:
example = json.loads(example_json)
except Exception as e:
raise ValueError("Error parsing JSON example response for %r %r" % (
request, code

Loading…
Cancel
Save