Add validate decorator to expose

Unit test coverage is provided by the patch tests in
ironic.tests.unit.api.controllers.v1.test_types

Story: 1651346
Task: 10551

Change-Id: I11c0ef3f5b008fb55cf2470c5f78fa12a8ad6861
This commit is contained in:
Steve Baker
2020-01-27 10:34:06 +13:00
parent b4939d902c
commit 68cc5fbcb7
10 changed files with 31 additions and 18 deletions

View File

@@ -20,7 +20,6 @@ import platform
import mock
from pecan import rest
import wsme
from ironic.api.controllers.v1 import types
from ironic.api import expose
@@ -107,7 +106,7 @@ class MyPatchType(types.JsonPatchType):
class MyTest(rest.RestController):
"""Helper class for TestJsonPatchType tests."""
@wsme.validate([MyPatchType])
@expose.validate([MyPatchType])
@expose.expose([str], body=[MyPatchType])
def patch(self, patch):
return patch