def describe(self, req=None, resp=None, **kwargs):
        """Describe API resource using resource introspection.

        Additional description on derrived resource class can be added using
        keyword arguments and calling ``super().decribe()`` method call
        like following:

        .. code-block:: python

             class SomeResource(BaseResource):
                 def describe(req, resp, **kwargs):
                     return super().describe(
                         req, resp, type='list', **kwargs
                      )

        Args:
            req (falcon.Request): request object
            resp (falcon.Response): response object
            kwargs (dict): dictionary of values created from resource url
                template

        Returns:
            dict: dictionary with resource descritpion information

        .. versionchanged:: 0.2.0
           The `req` and `resp` parameters became optional to ease the
           implementation of application-level documentation generators.
        """
        description = {
            'params': OrderedDict([
                (name, param.describe())
                for name, param in self.params.items()
            ]),
            'details':
                inspect.cleandoc(
                    self.__class__.__doc__ or
                    "This resource does not have description yet"
                ),
            'name': self.__class__.__name__,
            'methods': self.allowed_methods()
        }
        # note: add path to resource description only if request object was
        #       provided in order to make auto-documentation engines simpler
        if req:
            description['path'] = req.path

        description.update(**kwargs)
        return description
def describe ( self , req = None , resp = None , ** kwargs ) : description = { 'params' : OrderedDict ( [ ( name , param . describe ( ) ) for name , param in self . params . items ( ) ] ) , 'details' : inspect . cleandoc ( self . __class__ . __doc__ or "This resource does not have description yet" ) , 'name' : self . __class__ . __name__ , 'methods' : self . allowed_methods ( ) } if req : description [ 'path' ] = req . path description . update ( ** kwargs ) return description
Describe API resource using resource introspection.

        Additional description on derrived resource class can be added using
        keyword arguments and calling ``super().decribe()`` method call
        like following:

        .. code-block:: python

             class SomeResource(BaseResource):
                 def describe(req, resp, **kwargs):
                     return super().describe(
                         req, resp, type='list', **kwargs
                      )

        Args:
            req (falcon.Request): request object
            resp (falcon.Response): response object
            kwargs (dict): dictionary of values created from resource url
                template

        Returns:
            dict: dictionary with resource descritpion information

        .. versionchanged:: 0.2.0
           The `req` and `resp` parameters became optional to ease the
           implementation of application-level documentation generators.