Skip to content

Report/book types and subtypes displayed in the REST API

Background

The content types books and reports are not returning the full results in the REST API due to the confusion with subtypes.

Each subtype can be filtered in the API so you can get the exact content for e.g. "monographs" by adding filter=type:monograph and if an attribute in the book metadata has not been added with one of these subtypes the type is shown as just book. However filtering on this value filter=type:book does not then include the monographs or any with attributes included in the XML.

There is a need for a subtype to be added in the return from the REST API and Shayn has come up with a table as per below that shows what it could be returned like:

What's in the XML deposited What it should be in the REST API New field for subtype?
<book book_type="monograph"> "type": "book" "subtype": "monograph"
<book book_type="reference"> "type": "book" "subtype": "monograph"
<book book_type="edited_book"> "type": "book" "subtype": "monograph"
<book book_type="other"> "type": "book" "subtype": "monograph"
<book> "type": "book" "subtype": "monograph"
<content_item component_type="chapter"> "type": "component" "subtype": "chapter"
<content_item component_type="section"> "type": "component" "subtype": "section"
<content_item component_type="part"> "type": "component" "subtype": "part"
<content_item component_type="track"> "type": "component" "subtype": "track"
<content_item component_type="reference_entry"> "type": "component" "subtype": "reference_entry"
<content_item component_type="other"> "type": "component" "subtype": "other"
<content_item> "type": "component" "subtype": "chapter"

If at all technically possible it would be good to have the component in the type section also have the parent element before it so if it was part of a book it would be "type": "book component" and likewise if it was part of a report, albeit rarely then it would show "type": "report component".

Definition of ready

  • Product owner:
  • Tech lead:
  • Service:: label applied
  • Definition of done updated
  • Acceptance testing plan:
  • Weight applied

Definition of done

  • Unit tests identified, implemented, and passing
  • Code reviewed
  • Available for acceptance testing via a staging URL, or otherwise
  • Consider any impacts to current or future architecture/infrastructure, and update specifications and documentation as needed
  • Knowledge base reviewed and updated
  • Public documentation reviewed and updated
  • Acceptance criteria met
    • AC 1
    • AC 2
  • Acceptance testing passed

Notes