Skip to content
Snippets Groups Projects
Commit f291fbf4 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

DOC(scanner): added docstring for validation function

parent 60ae1ad4
No related branches found
No related tags found
2 merge requests!217TST: Make NamedTemporaryFiles Windows-compatible,!201Validator that checks created records using a json schema
Pipeline #58106 passed
...@@ -100,5 +100,27 @@ def convert_record(record: db.Record): ...@@ -100,5 +100,27 @@ def convert_record(record: db.Record):
return pobj return pobj
# def validate(schema, records):
# pass def validate(records: list[db.Record], schema: dict) -> tuple[list, list]:
"""
Validate a list of records against a JSON schema.
Arguments:
----------
records: list[db.Record]
List of records that will be validated.
schema: dict
A JSON schema generated using `load_json_schema_from_datamodel_yaml`.
Returns:
--------
A tuple containing two elements:
- Index 0: A list of boolean values, one for each record in `records` determining whether
the validation was successful.
- Index 1: A list of ValidationErrors (in case of insuccesful validation) or None if
the validation was successful.
"""
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment