This will be stored in a database that is not set up yet, but you can assume a database controller abstraction with db.getByID() and db.find({property: match}) at a minimum, the return of which will be a JSON that contains the minimum unique Line information.
This endpoint should also provide alternate returns for certain parameters:
?text=blob a simple blob of textContent
?image=full the URL of the default resolution of a full page (found on the Canvas)
?image=line an image fragment of this single annotation
?lookup=project (page, manifest, layer, metadata[], group) find the related document or Array of documents and return that instead, the version allowed without authentication
?view=json is the default, no querystring request and is redundant
?view=xml is a chance to get the document as an XML file
?view=html is a readonly viewer HTML Document presenting the annotation
?embed=true instructs methods that would have returned a URI to expand that and dereference the full document in its place
These parameters are all mutually exclusive except embed and passing multiple or a nonsense combo ("?view=html&embed=true") is an error.
Improve the GET /line/{id} endpoint to return the type of thing expected. Actual connections to the database can be mocked for now.
See #21 for expectations as well as #48 for docs about possible parameters in the request to handle.
Write the failing tests first, then build to suit.
For now, a Line will look like this:
This will be stored in a database that is not set up yet, but you can assume a database controller abstraction with
db.getByID()
anddb.find({property: match})
at a minimum, the return of which will be a JSON that contains the minimum unique Line information.This endpoint should also provide alternate returns for certain parameters:
?text=blob
a simple blob of textContent?image=full
the URL of the default resolution of a full page (found on the Canvas)?image=line
an image fragment of this single annotation?lookup=project
(page, manifest, layer, metadata[], group) find the related document or Array of documents and return that instead, the version allowed without authentication?view=json
is the default, no querystring request and is redundant?view=xml
is a chance to get the document as an XML file?view=html
is a readonly viewer HTML Document presenting the annotation?embed=true
instructs methods that would have returned a URI to expand that and dereference the full document in its placeThese parameters are all mutually exclusive except
embed
and passing multiple or a nonsense combo ("?view=html&embed=true") is an error.