code: def parse_definition_docstring(obj, process_doc):
      
      doc_lines, swag = None, None
  
      full_doc = None
      swag_path = getattr(obj, 'swag_path', None)
      swag_type = getattr(obj, 'swag_type', 'yml')
  
      if swag_path is not None:
          full_doc = load_from_file(swag_path, swag_type)
      else:
          full_doc = inspect.getdoc(obj)
  
      if full_doc:
  
          if full_doc.startswith('file:'):
              if not hasattr(obj, 'root_path'):
                  obj.root_path = get_root_path(obj)
              swag_path, swag_type = get_path_from_doc(full_doc)
              doc_filepath = os.path.join(obj.root_path, swag_path)
              full_doc = load_from_file(doc_filepath, swag_type)
  
          yaml_sep = full_doc.find('---')
          if yaml_sep != -1:
              doc_lines = process_doc(
                  full_doc[:yaml_sep - 1]
              )
              swag = yaml.load(full_doc[yaml_sep:])
          else:
              doc_lines = process_doc(full_doc)
  
      return doc_lines, swag
docs: Gets swag data from docstring for class based definitions