mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-01 15:02:21 +00:00
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:
parent
f3d9c3bfc9
commit
8ffcd767d9
@ -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] = []
|
||||
|
Loading…
Reference in New Issue
Block a user