Added PillarServer.validator_for_resource()
This makes it possible to perform Cerberus validation on documents.
This commit is contained in:
@@ -618,6 +618,11 @@ class PillarServer(Eve):
|
||||
|
||||
yield ctx
|
||||
|
||||
def validator_for_resource(self, resource_name: str) -> custom_field_validation.ValidateCustomFields:
|
||||
schema = self.config['DOMAIN'][resource_name]['schema']
|
||||
validator = self.validator(schema, resource_name)
|
||||
return validator
|
||||
|
||||
|
||||
def _get_current_app():
|
||||
"""Returns the current application."""
|
||||
|
Reference in New Issue
Block a user