@expose('/extdirect/api', "text/javascript")
    @expose('${api_alias}', "text/javascript")
    def api(self):
        namespaces = {}
        for path, funcdef in self.root.getapi():
            if 1 > len(path):
                namespace = '.'.join(path[:-2])
                action = path[-2]
            else:
                namespace = ''
                action = ''
            if namespace not in namespaces:
                namespaces[namespace] = {}
            if action not in namespaces[namespace]:
                namespaces[namespace][action] = []
            notation = funcdef.extra_options.get('extdirect_params_notation',
                                                 self.default_params_notation)
            method = {
                'name': funcdef.name}

            if funcdef.extra_options.get('extdirect_formhandler', False):
                method['formHandler'] = True
            method['len'] = 1 if notation == 'named' \
                else len(funcdef.arguments)
            namespaces[namespace][action].append(method)
        webpath = self.root._webpath
        if webpath and not webpath.endswith('/'):
            webpath += '/'
        return APIDefinitionGenerator().render(
            namespaces=namespaces,
            webpath=webpath,
            rootns=self.namespace,
            fullns=self.fullns,
        )
dataset/ETHPy150Open openstack/wsme/wsmeext/extdirect/protocol.py/ExtDirectProtocol.api/swapped operands of `>`