Conal-Tuohy / TroveProxy

A transforming proxy and harvester for the National Library of Australia's Trove API
Apache License 2.0
1 stars 0 forks source link

extend RESTfulness with additional url attributes #8

Open Conal-Tuohy opened 9 months ago

Conal-Tuohy commented 9 months ago

The v3 API has taken the approach of assigning absolute URIs to resources, and including those URIs as the values of url attributes in various places, but some places are missing, and could benefit from this extending this approach consistently throughout the interface.

e.g. the resource at https://api.trove.nla.gov.au/v3/newspaper/titles?state=qld is a list of Queensland newspaper titles. Each title is represented by a <newspaper> element, e.g.

  <newspaper id="1055">
    <title>Brisbane Telegraph (Qld. : 1948 - 1954)</title>
    <state>Queensland</state>
    <issn>22051449</issn>
    <troveUrl>https://nla.gov.au/nla.news-title1055</troveUrl>
    <startDate>1948-01-01</startDate>
    <endDate>1954-12-31</endDate>
  </newspaper>

The newspaper element has an id attribute, but if it were consistent with other parts of the API, it would also include a url attribute with the value https://api.trove.nla.gov.au/v3/newspaper/title/1055 e.g.

  <newspaper id="1055" url="https://api.trove.nla.gov.au/v3/newspaper/title/1055">
    <title>Brisbane Telegraph (Qld. : 1948 - 1954)</title>
    <state>Queensland</state>
    <issn>22051449</issn>
    <troveUrl>https://nla.gov.au/nla.news-title1055</troveUrl>
    <startDate>1948-01-01</startDate>
    <endDate>1954-12-31</endDate>
  </newspaper>
Conal-Tuohy commented 7 months ago

TODO send enhancement request to Trove