docs: def descriptor(obj, path=''):
      """Return descriptor of given object.
  
      If ``path`` is specified, only the content on that path is
      returned.
      """
      if isinstance(obj, dict):
          # Current object is hydrated, so we need to get descriptor from
          # dict representation.
          desc = obj['__descriptor']
      else:
          desc = obj.descriptor
  
      resp = dict_dot(desc, path)
  
      if isinstance(resp, list) or isinstance(resp, dict):
          return json.dumps(resp)
  
      return resp