def get_object_jsonschema(question, required_fields, is_reviewer):
 object_jsonschema = {'type': 'object', 'additionalProperties': False, 'properties': {}}
 required = []
 properties = question.get('properties')
 if properties:
  for property in properties:
   if (property.get('required', False) and required_fields):
    required.append(property['id'])
   values = extract_question_values(property, required_fields, is_reviewer)
   object_jsonschema['properties'][property['id']] = {'type': 'object', 'additionalProperties': False, 'properties': values}
   if required_fields:
    object_jsonschema['properties'][property['id']]['required'] = ['value']
 if (required_fields and is_required(question)):
  object_jsonschema['required'] = required
 return object_jsonschema

def get_object_jsonschema ( question , required_fields , is_reviewer ) : object_jsonschema = { 'type' : 'object' , 'additionalProperties' : False , 'properties' : { } } required = [ ] properties = question . get ( 'properties' ) if properties : for property in properties : if ( property . get ( 'required' , False ) and required_fields ) : required . append ( property [ 'id' ] ) values = extract_question_values ( property , required_fields , is_reviewer ) object_jsonschema [ 'properties' ] [ property [ 'id' ] ] = { 'type' : 'object' , 'additionalProperties' : False , 'properties' : values } if required_fields : object_jsonschema [ 'properties' ] [ property [ 'id' ] ] [ 'required' ] = [ 'value' ] if ( required_fields and is_required ( question ) ) : object_jsonschema [ 'required' ] = required return object_jsonschema
returns jsonschema for nested objects within schema .