SchemaLoaderValidator
- class mtf.utils.eth_filters.get_mtf_filter.SchemaLoaderValidator
This class gets all the mtf filter schemas, load them, and validate the given user input for the filter
- __init__()
- read_schemas()
Read all the json files from the relative path
- load_schemas()
Load the json schemas and save them
- user_schema_dissector(user_input: FilterProcessor)
returns the corresponding schema for the user schema to be used for validation.
- Args:
user_input (FilterProcessor): Filter processor used to determine the schema to use.
- Returns:
dict: The schema to use.
- validate_user_schema(user_input: FilterProcessor)
Validate the user input.
- Args:
user_input (FilterProcessor): The filter to be validated.
Note
The link between user_input and the loaded schema is the ‘filter_name’