Skip to content

Repository of all schemas for JSON structures compatible with HttpRunner.

License

Notifications You must be signed in to change notification settings

httprunner/schemas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HttpRunner Schemas

LICENSE Build Status

Repository of all schemas for JSON structures compatible with HttpRunner.

Versions

Usage

All the schemas in this repository are valid JSON Schemas, compliant with the JSON-Schema, Draft 6.

As such, they can be used with jsonschema to validate arbitrary JSON blobs, as show below:

import json
import requests
from jsonschema import validate
from jsonschema.exceptions import ValidationError

schema = requests.get('http://schema.httprunner.org/json/v1.json').json()

json_path = "tests/data/demo_validate_pass.json"  # Whatever needs to be validated.
with open(json_path) as f:
    test_input = json.load(f)

try:
    validate(test_input, schema)
except ValidationError:
    print('It is not a valid collection!')
else:
    print('It is a valid collection!')

About

Repository of all schemas for JSON structures compatible with HttpRunner.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages