Skip to content

Commit 13dbabe

Browse files
committed
Improve exception messages on invalid framing values when expanding.
1 parent ec85c4a commit 13dbabe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/json/ld/expand.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def expand_object(input, active_property, context, output_object, ordered: false
175175
when Array
176176
# Framing allows an array of IRIs, and always puts values in an array
177177
raise JsonLdError::InvalidIdValue,
178-
"value of @id must be a string, array of string or hash if framing: #{value.inspect}" unless framing
178+
"value of @id must be a string unless framing: #{value.inspect}" unless framing
179179
context.expand_iri(value, documentRelative: true, quiet: true).to_s
180180
value.map do |v|
181181
raise JsonLdError::InvalidTypeValue,
@@ -187,7 +187,7 @@ def expand_object(input, active_property, context, output_object, ordered: false
187187
"value of @id must be a string unless framing: #{value.inspect}" unless framing
188188
raise JsonLdError::InvalidTypeValue,
189189
"value of @id must be a an empty object for framing: #{value.inspect}" unless
190-
value.empty? && framing
190+
value.empty?
191191
[{}]
192192
else
193193
raise JsonLdError::InvalidIdValue,

0 commit comments

Comments
 (0)