def validate_configuration(configuration):
 schema = {'$schema': 'http://json-schema.org/draft-04/schema#', 'type': 'object', 'required': ['version', 'control-service', 'dataset'], 'properties': {'version': {'type': 'number', 'maximum': 1, 'minimum': 1}, 'control-service': {'type': 'object', 'required': ['hostname'], 'properties': {'hostname': {'type': 'string', 'format': 'hostname'}, 'port': {'type': 'integer'}}}, 'dataset': {'type': 'object', 'properties': {'backend': {'type': 'string'}}, 'required': ['backend']}, 'logging': {'type': 'object'}}}
 v = Draft4Validator(schema, format_checker=FormatChecker())
 v.validate(configuration)

def validate_configuration ( configuration ) : schema = { '$schema' : 'http://json-schema.org/draft-04/schema#' , 'type' : 'object' , 'required' : [ 'version' , 'control-service' , 'dataset' ] , 'properties' : { 'version' : { 'type' : 'number' , 'maximum' : 1 , 'minimum' : 1 } , 'control-service' : { 'type' : 'object' , 'required' : [ 'hostname' ] , 'properties' : { 'hostname' : { 'type' : 'string' , 'format' : 'hostname' } , 'port' : { 'type' : 'integer' } } } , 'dataset' : { 'type' : 'object' , 'properties' : { 'backend' : { 'type' : 'string' } } , 'required' : [ 'backend' ] } , 'logging' : { 'type' : 'object' } } } v = Draft4Validator ( schema , format_checker = FormatChecker ( ) ) v . validate ( configuration )
validate a provided configuration .