ifw-sup  3.0.0-pre3
Functions | Variables
clib.json_procs Namespace Reference

Functions

def load_schema_file (schema_file)
 This function loads the given schema available. More...
 
def load_json_string (json_string)
 This function loads the given string. More...
 
def load_json_file (json_file)
 This function loads the given schema available. More...
 
def validate_json (json_data, schema_data)
 

Variables

string SETUP_SCHEMA
 

Function Documentation

◆ load_json_file()

def clib.json_procs.load_json_file (   json_file)

This function loads the given schema available.

◆ load_json_string()

def clib.json_procs.load_json_string (   json_string)

This function loads the given string.

◆ load_schema_file()

def clib.json_procs.load_schema_file (   schema_file)

This function loads the given schema available.

relative_path = join('schemas', schema_file)
absolute_path = join(dirname(__file__), relative_path)

base_path = dirname(absolute_path)
base_uri = 'file://{}/'.format(base_path)

with open(absolute_path) as fd:
    return jsonref.loads(fd.read(), base_uri=base_uri, jsonschema=True)

◆ validate_json()

def clib.json_procs.validate_json (   json_data,
  schema_data 
)

Variable Documentation

◆ SETUP_SCHEMA

string clib.json_procs.SETUP_SCHEMA