diff --git a/src/caoscrawler/validator.py b/src/caoscrawler/validator.py index c91a5224fb885565666c18fb448106f46ecd98b6..1663aa460ba817d63dce5aa2e5d814935f622be5 100644 --- a/src/caoscrawler/validator.py +++ b/src/caoscrawler/validator.py @@ -99,7 +99,7 @@ def convert_record(record: db.Record): return pobj -def validate(records: list[db.Record], schemas: list[dict]) -> tuple[list, list]: +def validate(records: list[db.Record], schemas: list[dict]) -> list[tuple[bool, list]]: """ Validate a list of records against a list of possible JSON schemas. @@ -117,10 +117,9 @@ def validate(records: list[db.Record], schemas: list[dict]) -> tuple[list, list] Returns: -------- - A tuple containing two elements: + A list of tuples, one element for each record: - - Index 0: A list of boolean values, one for each record in `records` determining whether - the validation was successful. + - Index 0: A boolean that determines whether at least one schema matched for this record. - Index 1: A list of schemas matching the record at this position of the list `records`. """ retval = []