RemodelerValidator¶
- class RemodelerValidator[source]
Validator for remodeler input files.
Methods
Constructor for remodeler Validator. |
|
|
Validate remodeler operations against the json schema specification and specific op requirements. |
Attributes
- RemodelerValidator.validate(operations)[source]¶
Validate remodeler operations against the json schema specification and specific op requirements.
- Parameters:
operations (list) – Dictionary with input operations to run through the remodeler.
- Returns:
List with the error messages for errors identified by the validator.
- Return type:
list
- RemodelerValidator.BASE_ARRAY = {'items': {}, 'minItems': 1, 'type': 'array'}¶
- RemodelerValidator.MESSAGE_STRINGS = {'0': {'minItems': 'There are no operations defined. Specify at least 1 operation for the remodeler to execute.', 'type': 'Operations must be contained in a list or array. This is also true for a single operation.'}, '1': {'additionalProperties': "Operation dictionary {operation_index} contains an unexpected field '{added_property}'. Every operation dictionary must specify the type of operation, a description, and the operation parameters.", 'required': "Operation dictionary {operation_index} is missing '{missing_value}'. Every operation dictionary must specify the type of operation, a description, and the operation parameters.", 'type': 'Each operation must be defined in a dictionary: {instance} is not a dictionary object.'}, '2': {'additionalProperties': "Operation {operation_index}: Operation parameters for {operation_name} contain an unexpected field '{added_property}'.", 'dependentRequired': 'Operation {operation_index}: The parameter {missing_value} is missing: {missing_value} is a required parameter of {operation_name} when {dependent_on} is specified.', 'enum': '{instance} is not a known remodeler operation. See the documentation for valid operations.', 'required': 'Operation {operation_index}: The parameter {missing_value} is missing. {missing_value} is a required parameter of {operation_name}.', 'type': 'Operation {operation_index}: {instance} is not a {validator_value}. {operation_field} should be of type {validator_value}.'}, 'more': {'additionalProperties': "Operation {operation_index}: Operation parameters for {parameter_path} contain an unexpected field '{added_property}'.", 'enum': 'Operation {operation_index}: Operation parameter {parameter_path} in the {operation_name} operation contains and unexpected value. Value should be one of {validator_value}.', 'minItems': 'Operation {operation_index}: The list in {parameter_path} in the {operation_name} operation should have at least {validator_value} item(s).', 'minProperties': 'Operation {operation_index}: The dictionary in {parameter_path} in the {operation_name} operation should have at least {validator_value} key(s).', 'required': 'Operation {operation_index}: The field {missing_value} is missing in {parameter_path}. {missing_value} is a required parameter of {parameter_path}.', 'type': 'Operation {operation_index}: The value of {parameter_path} in the {operation_name} operation should be {validator_value}. {instance} is not a {validator_value}.', 'uniqueItems': 'Operation {operation_index}: The list in {parameter_path} in the {operation_name} operation should only contain unique items.'}}¶
- RemodelerValidator.OPERATION_DICT = {'additionalProperties': False, 'allOf': [], 'properties': {'description': {'type': 'string'}, 'operation': {'default': 'convert_columns', 'enum': [], 'type': 'string'}, 'parameters': {'properties': {}, 'type': 'object'}}, 'required': ['operation', 'description', 'parameters'], 'type': 'object'}¶
- RemodelerValidator.PARAMETER_SPECIFICATION_TEMPLATE = {'if': {'properties': {'operation': {'const': ''}}, 'required': ['operation']}, 'then': {'properties': {'parameters': {}}}}¶