code: def add_path(self, path, method=None):
          
          method = self._normalize_method_name(method)
  
          path_dict = self.paths.setdefault(path, {})
  
          if not isinstance(path_dict, dict):
              # Either customers has provided us an invalid Swagger, or this class has messed it somehow
              raise InvalidDocumentException(
                  [InvalidTemplateException("Value of '{}' path must be a dictionary according to Swagger spec."
                                            .format(path))])
  
          if self._CONDITIONAL_IF in path_dict:
              path_dict = path_dict[self._CONDITIONAL_IF][1]
  
          path_dict.setdefault(method, {})
docs: Adds the path/method combination to the Swagger, if not already present
  
          :param string path: Path name
          :param string method: HTTP method
          :raises ValueError: If the value of `path` in Swagger is not a dictionary