Skip to content

Commit 940ca01

Browse files
committed
Don't compact an @id or @value to a string if it contains an annotation.
1 parent 9b753b5 commit 940ca01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/json/ld/compact.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def compact(element,
6464
log_debug("prop-scoped", depth: log_depth.to_i) {"context: #{self.context.inspect}"}
6565
end
6666

67-
if element.key?('@id') || element.key?('@value')
67+
if (element.key?('@id') || element.key?('@value')) && !element.key?('@annotation')
6868
result = context.compact_value(property, element, base: @options[:base])
6969
if !result.is_a?(Hash) || context.coerce(property) == '@json'
7070
log_debug("", depth: log_depth.to_i) {"=> scalar result: #{result.inspect}"}

0 commit comments

Comments
 (0)