use pydantic to parse dict

suggested by @dolfim-ibm

Co-authored-by: Michele Dolfi <97102151+dolfim-ibm@users.noreply.github.com>
Signed-off-by: Luke Harrison <luke.harrison1@ibm.com>
This commit is contained in:
Luke Harrison 2025-01-06 10:08:47 -05:00 committed by GitHub
parent f3d9c3bfc9
commit 8ffcd767d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -286,7 +286,8 @@ def convert(
parsed_headers: Optional[Dict[str, str]] = None
if headers is not None:
parsed_headers = json.loads(headers)
headers_t = TypeAdapter(Dict[str, str])
parsed_headers = headers_t.validate_json(headers)
with tempfile.TemporaryDirectory() as tempdir:
input_doc_paths: List[Path] = []