Added PillarServer.validator_for_resource()
This makes it possible to perform Cerberus validation on documents.
This commit is contained in:
parent
1f0a855510
commit
ef2d8d14a0
@ -618,6 +618,11 @@ class PillarServer(Eve):
|
|||||||
|
|
||||||
yield ctx
|
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():
|
def _get_current_app():
|
||||||
"""Returns the current application."""
|
"""Returns the current application."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user