From 62cc17ae0f300173074a4f4dcd57a35173237e32 Mon Sep 17 00:00:00 2001 From: Alexander Schlemmer <a.schlemmer@indiscale.com> Date: Thu, 28 Nov 2024 20:29:21 +0100 Subject: [PATCH] DOC(validator): comment on refactoring the validator --- src/caoscrawler/validator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/caoscrawler/validator.py b/src/caoscrawler/validator.py index 56104703..bb21a611 100644 --- a/src/caoscrawler/validator.py +++ b/src/caoscrawler/validator.py @@ -134,6 +134,14 @@ def validate(records: list[db.Record], schemas: list[dict]) -> list[tuple[bool, - 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`. """ + + # TODO: + # I think it makes sense to change the behavior as follows: + # - Only validate the schema that was generated for a specific record type that matches the parent + # record that is validated. + # - With this behavior for each record a single schema is matched, and if it does not match the + # validation error can be returned. + retval = [] for r in records: matching_schemas = [] -- GitLab