Our existing `api_version` decorator for microversions forces us to use
"# noqa" if we have multiple microversions of a method in the same
class, providing no way around this.
This patch adds a way to avoid using noqa directive. Previously we
would have:
@wsgi.Controller.api_version("3.3")
def my_api_method(self, req, id):
.... method_1 ...
@wsgi.Controller.api_version("3.4") # noqa
def my_api_method(self, req, id):
.... method_2 ...
With this patch the second method does not require noqa anymore:
@my_api_method.api_version("3.4")
def my_api_method(self, req, id):
.... method_2 ...
Devref is updated to reflect this new change and to mention that it is
the recommended way to do it.
Change-Id: I46283b52cc6a347d5deb0f57a123eba4e01a3eb2
Closes-Bug: #1599806