fireworks_schema/json_schema.py
def validate(instance, schema_name):
    """ JSON schema validator working with relative paths """
    schema_file = schema_name.lower() + '.json'
    schema_path = os.path.join(SCHEMA_DIR, schema_file)
    with open(schema_path, 'rt') as fileh:
        schema_dict = json.load(fileh)
    base_uri = Path(os.path.abspath(schema_path)).as_uri()
    custom_res = jsonschema.RefResolver(base_uri, schema_dict)
    jsonschema.validate(instance, schema_dict, resolver=custom_res,
                        format_checker=jsonschema.FormatChecker())
 JSON schema validator working with relative paths 
JSON schema validator working with relative paths
JSON schema validator working with relative paths
def validate(instance, schema_name):
    schema_file = schema_name.lower() + '.json'
    schema_path = os.path.join(SCHEMA_DIR, schema_file)
    with open(schema_path, 'rt') as fileh:
        schema_dict = json.load(fileh)
    base_uri = Path(os.path.abspath(schema_path)).as_uri()
    custom_res = jsonschema.RefResolver(base_uri, schema_dict)
    jsonschema.validate(instance, schema_dict, resolver=custom_res,
                        format_checker=jsonschema.FormatChecker())
def validate ( instance , schema_name ) : schema_file = schema_name . lower ( ) + '.json' schema_path = os . path . join ( SCHEMA_DIR , schema_file ) with open ( schema_path , 'rt' ) as fileh : schema_dict = json . load ( fileh ) base_uri = Path ( os . path . abspath ( schema_path ) ) . as_uri ( ) custom_res = jsonschema . RefResolver ( base_uri , schema_dict ) jsonschema . validate ( instance , schema_dict , resolver = custom_res , format_checker = jsonschema . FormatChecker ( ) )
JSON schema validator working with relative paths
JSON schema validator working with relative paths
""" JSON schema validator working with relative paths """
instance
schema_name