Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def from_json(cls, json_doc):
doc_id = json_doc["docId"]
pages = [Page.from_json(p) for p in json_doc.get("pages", [])]
return Document(doc_id=doc_id, pages=pages)