Skip to content

Commit

Permalink
Update annotation.rb
Browse files Browse the repository at this point in the history
According to http://iiif.io/api/presentation/2.0/#image-resources, "the URI of the canvas must be repeated in the on field of the Annotation". This patch adds the "on" field to the annotation class and makes it a required field. 

It's worth noting that without this patch, https://github.com/IIIF/presentation-validator will fail the validation for an O'Sullivan generated manifest that contains an annotation. With the patch, it will succeed.
  • Loading branch information
minusdavid committed Oct 25, 2018
1 parent d659b73 commit e5f495d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/iiif/presentation/annotation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ class Annotation < AbstractResource
TYPE = 'oa:Annotation'

def required_keys
super + %w{ motivation }
super + %w{ motivation on }
end

def string_only_keys
super + %w{ on }

def abstract_resource_only_keys
super + [ { key: 'resource', type: IIIF::Presentation::Resource } ]
end
Expand Down

0 comments on commit e5f495d

Please sign in to comment.