Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update hierarchical IIIF collection creation to use PUT and POST #75

Open
1 task
JackLewis-digirati opened this issue Oct 11, 2024 · 1 comment
Open
1 task

Comments

@JackLewis-digirati
Copy link
Collaborator

JackLewis-digirati commented Oct 11, 2024

Currently, collections work like the following:

POST /collection1/collectionChild
{
  "@context":  "standard iiif context",
   "(my vanilla collection)"
}

but it needs to work like this on the hierarchical URL:

/// slug is explicitly provided but requires non-standard property
// TODO - Disallow this? Only vanilla IIIF on hierarchical URLs?
POST /collection1/
{
  "@context":  [
        "standard iiif context",
        "dlcs context
   ],
   "(my not completely vanilla collection)"
   "slug": "collectionChild"
}

// recognise id as one of our own, slug is implied by last path element of id
POST /collection1/
{
  "id": "https://dlc.services/iiif/collection1/collectionChild,
  "@context":  "standard iiif context",
   "(my vanilla collection)"
}

// recognise id is not one of ours, but what's the slug?
400 Bad Request - you need to do a PUT to get this one in because we can't work out what the slug should be
POST /collection1/
{
  "id": "https://bl.uk/gary-collection",
  "@context":  "standard iiif context",
   "(my vanilla completely external collection)"
}

// (no id, or ignore id) - don't need it
PUT /collection1/collectionChild
{
  "@context": "standard iiif context",
   "(my vanilla collection)"
} 

// This is fine, parent and slug defined by PUT URL
PUT /collection1/collectionChild
{
  "id": "https://bl.uk/gary-collection",
  "@context":  "standard iiif context",
   "(my vanilla completely external collection)"
} 
  • Any id property on the resource supplied in either PUT or POST is ignored - the URL PUT to, or the URL POSTed to + slug, tells us what the id will be in the hierarchy.

https://deploy-preview-2--dlcs-docs.netlify.app/api-doc/iiif#example-create-a-iiif-collection-within-a-storage-collectionhierarchical

@tomcrane tomcrane changed the title update hierarchical collection creation to use PUT and POST update hierarchical IIIF collection creation to use PUT and POST Oct 11, 2024
@sarahos sarahos added SoW5 SoW5 and removed SoW5 SoW5 labels Nov 1, 2024
@JackLewis-digirati
Copy link
Collaborator Author

JackLewis-digirati commented Nov 4, 2024

for this:

// recognise id as one of our own, slug is implied by last path element of id
POST /collection1/
{
  "id": "https://dlc.services/iiif/collection1/collectionChild,
  "@context":  "standard iiif context",
   "(my vanilla collection)"
}

is there a need to verify that the id matches the hierarchical URL, and reject if it doesn't match? Assuming this is the case based on the next case which gets rejected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants