wellcomecollection / content-api

📖 The API + ETL pipeline for searching the Wellcome Collection Prismic Repository.
MIT License
0 stars 0 forks source link

[1] Align articles/events filters on API faceting principles #121

Open agnesgaroux opened 8 months ago

agnesgaroux commented 8 months ago

https://github.com/wellcomecollection/docs/tree/main/rfcs/037-api-faceting-principles See Principle 1.

Filters are named by the JSON paths of the identified object that they filter or, if applied to an attribute other than the identifier, the path of that attribute

This is not something that has been abided by in content-api: NOTE: this example is articles but same thing with events Article doc XkvmsREAACUAUWwN has a filter object like

        "filter": {
            "contributorIds": [ // should be "contributors.contributor"
              "XjQP8BQAACQANdYu",
              "XjFs8xQAACMAKkcQ"
            ],
            "formatId": "W7TfJRAAAJ1D0eLK",  // should be "format"
            "publicationDate": "2020-02-27T11:31:56.000Z"

and display

 "display": {
      "type": "Article",
      "id": "XkvmsREAACUAUWwN",
      "title": "The ‘undesirable epileptic’",
      "caption": "Abused in her marriage for being 'a sick woman', Aparna Nair looked to history to make sense of the response to her epilepsy. 
She discovered how centuries of fear and discrimination were often endorsed by science and legislation.",
      "format": {
        "type": "ArticleFormat",
        "id": "W7TfJRAAAJ1D0eLK",
        "label": "Article"
      },
      "publicationDate": "2020-02-27T11:31:56+0000",
      "contributors": [
        {
          "type": "Contributor",
          "contributor": {
            "type": "Person",
            "id": "XjQP8BQAACQANdYu",
            "label": "Aparna Nair"
          },
          "role": {
            "type": "EditorialContributorRole",
            "id": "WcUWeCgAAFws-nGh",
            "label": "Author"
          }
        },
        {
          "type": "Contributor",
          "contributor": {
            "type": "Person",
            "id": "XjFs8xQAACMAKkcQ",
            "label": "Tracy Satchwill"
          },
          "role": {
            "type": "EditorialContributorRole",
            "id": "XVQa_xMAACMAqbwo",
            "label": "Illustrator"
          }
        }
      ],
    }

This entails