Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Documents API - displayedAttributes should not impact the documents API / Rename attributesToRetrieve to fields #143

Merged
merged 5 commits into from
Jul 7, 2022

Conversation

gmourier
Copy link
Member

@gmourier gmourier commented Apr 14, 2022

🤖 API Diff

Why?

The documents API is used to manage documents within an index.

displayedAttributes allows limiting the attributes that can be retrieved in the search but also impacts the endpoints of the documents API.

My proposal is to remove this behavior from the documents API. Indeed, in order to manage a Meilisearch instance, it is good to have all the information about it.

Today, it implies the user to modify displayedAttributes to access all the information which will also impact the search. This is not desirable for the developer experience.


Following this discussion

attributesToRetrieve query parameter is renamed to fields on this API. Using a more generic name that does not collide with attributesToRetrieve from the search endpoint could help consistency if we add this feature on another API endpoints in the future.

Rejecting a field from a document in the given response with a negative operator is added as a future possibility. e.g. ?fields=-createdAt

Changes

  • displayedAttributes do not impact the documents API.
  • Rename attributesToRetrieve on the document API to fields. It's more generic and thus can be used on all routes other than search in the future as a query parameter component.

@gmourier gmourier changed the base branch from main to develop April 14, 2022 10:32
@gmourier gmourier added the In Progress Feature specification is in elaboration. Important changes can still occurs in the specification. label Apr 14, 2022
@gmourier gmourier changed the title Documents API - displayedAttributes should not impact the documents API Documents API - displayedAttributes should not impact the documents API / Rename attributesToRetrieve to something more generic for the documents API Apr 14, 2022
@gmourier gmourier mentioned this pull request Apr 14, 2022
1 task
@curquiza curquiza added the v0.28 label Apr 19, 2022
@gmourier gmourier changed the title Documents API - displayedAttributes should not impact the documents API / Rename attributesToRetrieve to something more generic for the documents API Documents API - displayedAttributes should not impact the documents API / Rename attributesToRetrieve to fields Apr 21, 2022
@gmourier gmourier added OpenAPI Update OpenAPI specification. Ready For Review Feature specification must be reviewed. and removed In Progress Feature specification is in elaboration. Important changes can still occurs in the specification. labels Apr 21, 2022
@github-actions
Copy link

github-actions bot commented Apr 21, 2022

🚨 Breaking API change detected:

Modified (2)

  • GET /indexes/{indexUid}/documents
    • Query parameter added: fields
    • [Breaking] Query parameter removed: attributesToRetrieve
  • GET /indexes/{indexUid}/documents/{documentId}
    • Query parameter added: fields

View documentation diff

Powered by Bump

@gmourier gmourier self-assigned this Apr 21, 2022
@gmourier gmourier force-pushed the displayed-attributes-do-not-impact-documents-api branch from 18fb79e to 9dcf9c9 Compare May 16, 2022 12:15
@gmourier gmourier requested a review from brunoocasali May 23, 2022 14:09
@gmourier gmourier requested a review from irevoire June 1, 2022 17:14
@gmourier gmourier force-pushed the displayed-attributes-do-not-impact-documents-api branch from a58f617 to 47d36c9 Compare July 7, 2022 11:28
@gmourier gmourier merged commit fd4ee13 into develop Jul 7, 2022
@gmourier gmourier deleted the displayed-attributes-do-not-impact-documents-api branch July 7, 2022 11:30
gmourier added a commit that referenced this pull request Jul 7, 2022
… API / Rename `attributesToRetrieve` to `fields` (#143)

* Specifies that displayedAttributes setting does not impact the GET documents endpoint

* Rename attributeToRetrieve to fields on /documents

* Add a future possibily to rejectt a field from a document in the given response

* Precise behavior details about fields query parameter

* Add fields query parameter on GET /indexes/{index}/documents/{docId}
gmourier added a commit that referenced this pull request Jul 11, 2022
* Bump open-api.yml to v0.28

* Telemetry - Add `x-meilisearch-client` query parameter (#145)

* Introduce the x-meilisearch-client query parameter

* Update text/0034-telemetry-policies.md

Co-authored-by: Bruno Casali <[email protected]>

* Update text/0034-telemetry-policies.md

Co-authored-by: Bruno Casali <[email protected]>

Co-authored-by: Bruno Casali <[email protected]>

* GeoSearch — Support string type for `_geo` `lat` and `lng` fields (#83)

* Update specification to support string type for _geo lat and lng fields

* mention types mixing for _geo object

* Tasks API - Rename `uid` to `taskUid` in the `202 - Accepted` Summarized Task Response (#144)

* Rename 202 uid to taskUid

* Update text/0060-tasks-api.md

Co-authored-by: cvermand <[email protected]>

Co-authored-by: cvermand <[email protected]>

* Tasks API - Seek/Keyset based pagination (#115)

* Move cursor based pagination spec to tasks API spec

* remove pagination as a future capability

* Clarify boundaries for limit query parameter

* Update OpenApi specification

* Remove limit field boundaries

* Apply suggestions from code review

Co-authored-by: Clément Renault <[email protected]>

* Update open-api.yml and removes cursor term mentions

* Update text/0060-tasks-api.md

Co-authored-by: Tommy <[email protected]>

* Remove  route mention in seek-keyset pagination section

Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: Tommy <[email protected]>

* Tasks API - Filter tasks list by `type`/`status`/`indexUid` (#116)

* move filtering tasks by status/type parameter to task api spec

* Update specification

* Add details about case-sensitivy + rework error message

* Introducing naming changes plus make the specification a source of truth instead of a changelog

* Remove a future possibility being introduced

* misc - replace createIndex to the right type and add the missing type field to the 202 Response resource

* Dumps API - Make dump creation an asynchronous task (#139)

* wip

* Make a dump creation a visible asynchronous task

* Add precisions

* Update open-api.yml

* Add ommited type field for summarized task response

* Add future possibilities

* Apply suggestions from code review

Co-authored-by: cvermand <[email protected]>

* Precise that indexUid can be null

* Precise priorization of dumpCreation task over other task types

* Keep taskUid for 202 response

* remove dumps.get API key action

Co-authored-by: cvermand <[email protected]>

* Search API - Remove/Rename confusing fields (#135)

* Rename nbHits, remove exhaustive* boolean fields

* Rename approximativeNbHits to estimatedTotalHits

* Update open-api.yaml

* Apply naming changes for facet distribution and showing matches position

* Add a telemetry for facet distribution usage

* API Guideline - Return list of API resources under a `results` array (#138)

* Place list of documents under a results array on /documents

* Add results array for indexes object list

* Add the future of indexes pagination

* Update open-api.yml

* Fix typo

* Apply suggestions from code review

Co-authored-by: cvermand <[email protected]>

* Add offset/limit pagination for indexes and API keys

* Try to add multipe refs to a response object

Co-authored-by: cvermand <[email protected]>

* Remove name field (#140)

* Documents API - `displayedAttributes` should not impact the documents API / Rename `attributesToRetrieve` to `fields` (#143)

* Specifies that displayedAttributes setting does not impact the GET documents endpoint

* Rename attributeToRetrieve to fields on /documents

* Add a future possibily to rejectt a field from a document in the given response

* Precise behavior details about fields query parameter

* Add fields query parameter on GET /indexes/{index}/documents/{docId}

* API Keys - Determinist API Keys + Security changes (#148)

* Add an uid to make API Keys determinists, plus add a non-unique human readable name field to ease reading information

* Describe errors for uid and name fields

* Apply suggestions from code review

Co-authored-by: Bruno Casali <[email protected]>

* misc: add precisions

* Reorganize route descriptions

* Update error_code when API Key already exists for a given uid

* Apply suggestions from code review

Co-authored-by: Many the fish <[email protected]>

* Add new keys actions, remove master-key changes, introduce a new error for immutable field and update tenant token

* Update open-api spec

* Update immutable_field error message

* Apply suggestions from code review

Co-authored-by: Many the fish <[email protected]>

* Mention that the Default Admin API Key can manage keys

* Specify that the JWT Tenant Token must be enrypted with the API Key value

* Update the spec regarding the description of the Admin API Key to be up-to-date

* Add uid_or_key url param to update and delete a key

* Update text/0085-api-keys.md

Co-authored-by: Many the fish <[email protected]>

* Update text/0085-api-keys.md

Co-authored-by: Many the fish <[email protected]>

Co-authored-by: Bruno Casali <[email protected]>
Co-authored-by: Many the fish <[email protected]>
Co-authored-by: Kerollmops <[email protected]>

* Geosearch - Enhance lat/lng format error messages (#149)

* Update the geosearch error message

* misc: organiser error message in the right specification

Co-authored-by: Guillaume Mourier <[email protected]>

* Introduces HTTP Verbs changesto be compliant regarding a Rest API (#152)

* Telemetry - Replace `x-meilisearch-client` query parameter by `X-Meilisearch-Client` header (#150)

* Removes x-meilisearch-client, replace it by a header

* Remove capslock

* fix typo (#151)

* Mention telemetry.meilisearch.com (#153)

* update ranking rules error message (#154)

* Misc — Update dump versions compatibility table (#156)

* Update dump table

* Update text/0105-dumps-api.md

* Settings API - Customize the hard limits for `pagination` and `faceting` (#157)

* Introduces specification files

* Update files name

* branch telemetry

* Update open-api.yml

* Update text/0034-telemetry-policies.md

Co-authored-by: Clément Renault <[email protected]>

* update open-api.yml

* Update text/157-faceting-setting-api.md

Co-authored-by: Clément Renault <[email protected]>

* Rename limitedTo to maxTotalHits

* Specify order of returned facet

Co-authored-by: Clément Renault <[email protected]>

* Add dumpCreation task type to OpenAPI.yml

* Tasks filtering params to be in query instead of path on OpenAPI spec

Co-authored-by: Bruno Casali <[email protected]>
Co-authored-by: cvermand <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: Tommy <[email protected]>
Co-authored-by: Many the fish <[email protected]>
Co-authored-by: Kerollmops <[email protected]>
Co-authored-by: Tamo <[email protected]>
Co-authored-by: ad hoc <[email protected]>
Co-authored-by: Clémentine Urquizar - curqui <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
OpenAPI Update OpenAPI specification. Q3:2022 Ready For Review Feature specification must be reviewed. v0.28
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants