Skip to content

Commit 3c3d6e0

Browse files
nsoranzomr-c
authored andcommitted
Allow jsonldPredicate to be a str
Fix #418 .
1 parent 037c6b4 commit 3c3d6e0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

schema_salad/makedoc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def typefmt(
268268
tp: Any,
269269
redirects: Dict[str, str],
270270
nbsp: bool = False,
271-
jsonldPredicate: Optional[Dict[str, str]] = None,
271+
jsonldPredicate: Optional[Union[Dict[str, str], str]] = None,
272272
) -> str:
273273
if isinstance(tp, MutableSequence):
274274
if nbsp and len(tp) <= 3:
@@ -289,7 +289,10 @@ def typefmt(
289289
ar = "array&lt;{}&gt;".format(
290290
self.typefmt(tp["items"], redirects, nbsp=True)
291291
)
292-
if jsonldPredicate is not None and "mapSubject" in jsonldPredicate:
292+
if (
293+
isinstance(jsonldPredicate, dict)
294+
and "mapSubject" in jsonldPredicate
295+
):
293296
if "mapPredicate" in jsonldPredicate:
294297
ar += " | "
295298
if len(ar) > 40:

0 commit comments

Comments
 (0)