From c607eaf23d73f9e3278863e0d7a50ce77d33c3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 13 Jul 2018 12:02:18 +0200 Subject: [PATCH] Added magic custom validation rule schemas in docstrings --- pillar/api/custom_field_validation.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pillar/api/custom_field_validation.py b/pillar/api/custom_field_validation.py index 44c04c7d..dbaa335f 100644 --- a/pillar/api/custom_field_validation.py +++ b/pillar/api/custom_field_validation.py @@ -73,6 +73,11 @@ class ValidateCustomFields(Validator): dict_property[key] = self.convert_properties(item_prop, item_schema)['item'] def _validate_valid_properties(self, valid_properties, field, value): + """Fake property that triggers node dynamic property validation. + + The rule's arguments are validated against this schema: + {'type': 'boolean'} + """ from pillar.api.utils import project_get_node_type projects_collection = current_app.data.driver.db['projects'] @@ -121,6 +126,9 @@ class ValidateCustomFields(Validator): Combine "required_after_creation=True" with "required=False" to allow pre-insert hooks to set default values. + + The rule's arguments are validated against this schema: + {'type': 'boolean'} """ if not required_after_creation: