Skip to content

Support registering multiple adjuncts in single payload #1110

@donaldgray

Description

@donaldgray

Ticket number #1073 added endpoint POST /customers/{c}/spaces/{s}/images/{i}/adjuncts to support registering a single adjunct.

This ticket is to extend that same endpoint to support registering 1:n adjuncts in a single payload, see registering multiple adjuncts documentation. From that documentation:

This POST to the asset's adjuncts collection can take a single adjunct, an array of adjuncts, or a Hydra Collection with an array of adjuncts as member.

The following would all be equivalent, examples 2 + 3 only show a single adjunct for brevity.

Single Adjunct (currently supported)

{
  "id": "mets-from-origin",
  "origin": "https://dlcs.example/mets.xml",
  "@type": "Dataset",
  "mediaType": "text/xml",
  "profile": "http://www.loc.gov/standards/alto/v3/alto.xsd",
  "label": { "en": [ "METS-ALTO XML" ] },
  "iiifLink": "seeAlso"
}

Array

[
  {
    "id": "mets-from-origin",
    "origin": "https://dlcs.example/mets.xml",
    "@type": "Dataset",
    "mediaType": "text/xml",
    "profile": "http://www.loc.gov/standards/alto/v3/alto.xsd",
    "label": { "en": [ "METS-ALTO XML" ] },
    "iiifLink": "seeAlso"
  }
]

Hydra Collection

{
  "@type": "Collection",
  "members": [
    {
      "id": "mets-from-origin",
      "origin": "https://dlcs.example/mets.xml",
      "@type": "Dataset",
      "mediaType": "text/xml",
      "profile": "http://www.loc.gov/standards/alto/v3/alto.xsd",
      "label": { "en": [ "METS-ALTO XML" ] },
      "iiifLink": "seeAlso"
    }
  ]
}

Processing of each adjunct follow rules for single (e.g. notify Engine if it has an "origin", finish in API if it's "external" etc).

  • Support POSTing an array of adjuncts
  • Support POSTing an Hydra Collection of adjuncts
  • Return 200 if overall save succeeds, or 4xx/5xx if at least one fails
    • If possible avoid partial failures - strive for full success or failure (to discuss)
  • Return a Hydra Collection of adjuncts, regardless of the format of the body

Metadata

Metadata

Labels

APIhttps://dlcs-book.readthedocs.io/en/latest/adjunctsTickets that relate to "adjuncts" functionality to store additional linked files to an asset.refinedIdentify refined tickets in the backlog

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions