code: def __definitions_descriptor(self):
      result = {}
      for def_key, def_value in self.__parser.schemas().iteritems():
        if 'properties' in def_value or 'type' in def_value:
          key_result = {}
          required_keys = set()
          if 'type' in def_value:
            key_result['type'] = def_value['type']
          if 'properties' in def_value:
            for prop_key, prop_value in def_value['properties'].items():
              if isinstance(prop_value, dict) and 'required' in prop_value:
                required_keys.add(prop_key)
                del prop_value['required']
            key_result['properties'] = def_value['properties']
          if required_keys:
            key_result['required'] = sorted(required_keys)
          result[def_key] = key_result
      for def_value in result.itervalues():
        for prop_value in def_value.itervalues():
          if isinstance(prop_value, dict):
            if '$ref' in prop_value:
              prop_value['type'] = 'object'
            self._add_def_paths(prop_value)
      return result