Allow modifiying the id of a hosted annotation id#1209
Merged
Conversation
Collaborator
Author
|
What this PR does Implements #1194 — sets the correct Approach A reusable token-by-token streaming JSON pipeline is introduced in
|
donaldgray
reviewed
Jun 2, 2026
- remove InlineAnnotation - add setting for guard - return 404 for missing adjunct instead of 500 - extract helper function for setting the new id
donaldgray
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Resolves #1194
This PR makes it so that hosted annotations (whether ambient or not) have their id values rewritten to match the id coming from protagonist. An example of this would be the following json:
{ "@context": "http://iiif.io/api/annotation/3/context.json", "id": "random id", "type": "AnnotationPage", "items": [] }being rewritten to:
{ "@context": "http://iiif.io/api/annotation/3/context.json", "id": "<orchestrator base url>/adjuncts/26/1/asset-id/adjunct-id", "type": "AnnotationPage", "items": [] }based on the asset being
asset-idand the adjunct beingadjunct-id. This will also work for rewritten paths. For example, changing the default ofadjunctstosupplementingwould see the id rewritten to"<orchestrator base url>/supplementing/26/1/asset-id/adjunct-id"This works by streaming the object in and then rewriting the top level id to avoid additional processing time of fully deserializing the object
Note
The code from this PR closely resembles the work written to do similar in iiif-presentation
Note
If the
idproperty is not present, it will be addedSettings
new setting added:
This controls that if an adjunct is larger than the
MaxAdjunctSizeBytes(defaults to 5MB), then a500will be returned from orchestrator