diff --git a/fuel_plugin_builder/tests/base.py b/fuel_plugin_builder/tests/base.py index b1fa858..dbf75aa 100644 --- a/fuel_plugin_builder/tests/base.py +++ b/fuel_plugin_builder/tests/base.py @@ -184,6 +184,17 @@ class BaseValidator(BaseTestCase): "of type 'string', value path 'attributes -> key1 -> type'"): self.validator.check_env_config_attrs() + def test_check_env_config_attrs_generator_value(self, utils_mock): + utils_mock.parse_yaml.return_value = { + 'attributes': { + 'key1': { + 'type': 'hidden', + 'label': '', + 'value': {'generator': 'password'}, + 'weight': 1}}} + + self.validator.check_env_config_attrs() + def test_check_env_config_attrs_restriction_fails(self, utils_mock): utils_mock.parse_yaml.return_value = { 'attributes': { diff --git a/fuel_plugin_builder/validators/schemas/base.py b/fuel_plugin_builder/validators/schemas/base.py index 2e37703..1ad618e 100644 --- a/fuel_plugin_builder/validators/schemas/base.py +++ b/fuel_plugin_builder/validators/schemas/base.py @@ -169,7 +169,12 @@ class BaseSchema(object): 'properties': { 'type': {'type': 'string'}, 'weight': {'type': 'integer'}, - 'value': {'type': ['string', 'boolean']}, + 'value': {'anyOf': [ + {'type': 'string'}, + {'type': 'boolean'}, + {'type': 'object', + 'properties': {'generator': {'type': 'string'}}} + ]}, 'label': {'type': 'string'}, 'restrictions': self.restrictions, 'values': {'type': 'array', 'items':