Skip to content

Commit 16d03b6

Browse files
authored
fix: fixes nested type scoped handling if a class only has a single class (#804)
1 parent 84e59d0 commit 16d03b6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

renku/core/models/jsonld.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,13 @@ def _propagate_reference_contexts(
246246

247247
if '@context' not in current_context:
248248
current_context['@context'] = []
249-
for subtype in cls._jsonld_type:
249+
250+
subtypes = cls._jsonld_type
251+
252+
if not isinstance(subtypes, (tuple, list)):
253+
subtypes = [subtypes]
254+
255+
for subtype in subtypes:
250256
# Use nested, type scoped contexts for each semantic type
251257
# of a reference, to uniquely bind a context to a type
252258
current_context['@context'].append({

0 commit comments

Comments
 (0)