Cannot redefine parameters in subsequent version

Bug #709368 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.restful
Triaged
Low
Unassigned

Bug Description

Attempting to redefine parameters in a subsequent version fails:

    >>> @operation_parameters(foo=TextLine(title=u"2"))
    ... @operation_for_version(2)
    ... @operation_parameters(foo=TextLine(title=u"1"))
    ... @operation_for_version(1)
    ... def bar(foo): pass
    Traceback (most recent call last):
    ...
    TypeError: 'foo' parameter is already defined.

Perhaps the following check in operation_parameters.annotate_method()
could be removed:

    if name in params:
        raise TypeError(
            "'%s' parameter is already defined." % name)

?

(There's a work-around possible with operation_removed_in_version, but
that feels fairly hackish, and is certainly confusing the first time
someone sees it.)

Changed in lazr.restful:
status: New → Triaged
importance: Undecided → High
Changed in lazr.restful:
importance: High → Low
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.