Server fails to return a list of data claiming type mismatch

Bug #1214898 reported by Chris Johns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ladon
New
Undecided
Unassigned

Bug Description

Ladon functions which have a return type of an array of anything won't return data.

The following code:

class V1(object):
    """
    This service returns events between two times for a given trackable.
    """
    @ladonize(rtype=[ PORTABLE_STRING ])
    def getGroupNames(self):
        """
        Returns a list of group names.
        @rtype: List of group names.
        """
        cnn = db.get_connection()
        sql = "blah blah sql"
        params = {}
        groups = db.execute_fetchall(cnn, sql, params)
        ret = []
        for g in groups:
            ret += [g["group_description"]]
        return ret

Gets the following error:
WebFault: Server raised fault: 'Return-type mismatch in V1::getGroupNames: Expected [<type 'unicode'>] recieved <type 'list'>'

It sees a list as a response, but won't accept it claiming it's not a list. (Or alternatively, it's expecting a list of unicode, and is failing on a list of unicode)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.