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

Error Format #61

Merged
merged 22 commits into from
Oct 13, 2021
Merged

Error Format #61

merged 22 commits into from
Oct 13, 2021

Conversation

gmourier
Copy link
Member

@gmourier gmourier commented Aug 13, 2021

Summary

The error format is updated to no longer contain unnecessary error prefix terms in the names of these attributes. e.g. errorType. The context is clear enough to understand that this is an error object.

This specification also serves as a reference point for the complete list of API errors that the user may encounter.

Summary Key Points

  • error is removed from the attributes name and type values.
  • An exhaustive list of API errors is defined. See Errors List part.

Motivation

The main motivation is to stabilize the current error resource to a version that conforms to our API convention and thus allows future evolutions on a more solid base. This specification avoids adding unnecessary information in the error object's attribute names.

The second motivation is to describe in an exhaustive way all the errors that the user may encounter during his use of the API.

@gmourier gmourier added In Progress Feature specification is in elaboration. Important changes can still occurs in the specification. v0.22 Q3:2021 OpenAPI Update OpenAPI specification. labels Aug 13, 2021
@meilisearch meilisearch deleted a comment from github-actions bot Aug 13, 2021
@gmourier gmourier changed the base branch from main to develop August 17, 2021 11:58
@meilisearch meilisearch deleted a comment from github-actions bot Aug 18, 2021
@gmourier gmourier added 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 Aug 18, 2021
@gmourier gmourier added this to Todo in Specification Workflow via automation Aug 18, 2021
@gmourier gmourier moved this from Todo to Ready For Review in Specification Workflow Aug 18, 2021
@gmourier gmourier marked this pull request as ready for review August 18, 2021 15:27
@guimachiavelli guimachiavelli mentioned this pull request Aug 19, 2021
@gmourier gmourier added In Progress Feature specification is in elaboration. Important changes can still occurs in the specification. and removed Ready For Review Feature specification must be reviewed. labels Aug 23, 2021
@gmourier
Copy link
Member Author

gmourier commented Aug 23, 2021

Status changed to In Progress because it needs a detailed definition of all our errors.

@gmourier gmourier moved this from Ready For Review to In Progress in Specification Workflow Aug 23, 2021
@gmourier
Copy link
Member Author

gmourier commented Aug 24, 2021

I've fleshed out the specification by doing a complete error cleanup and listing thanks to @Kerollmops, @MarinPostma, @irevoire and @bidoubiwa who helped to dig into it.

Errors added by external specifications like ndjson, csv, geo search, and sort are also included. I have completed an overview of our known API errors which you can see here https://miro.com/app/board/o9J_l0i--Zo=/ as a mind map.

@gmourier gmourier added 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 Aug 24, 2021
@github-actions
Copy link

🚨 Breaking API change detected:

Updated: GET /indexes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes
  Response modified: 400
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: PUT /indexes/{indexUid}
  Response modified: 400
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/documents
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: PUT /indexes/{indexUid}/documents
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
  Response modified: 413
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/documents
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
  Response modified: 413
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/documents
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/documents/delete-batch
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/documents/{documentId}
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/documents/{documentId}
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/search
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/search
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/tasks
  Response modified: 200
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/tasks/{taskUid}
  Response modified: 200
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /tasks
  Response modified: 200
Updated: GET /tasks/:taskUid
  Response modified: 200
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
  Response modified: 404
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /keys
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/settings
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/settings
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/settings
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/settings/synonyms
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/settings/synonyms
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/settings/synonyms
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/settings/sortable-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/settings/sortable-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/settings/sortable-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/settings/stop-words
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/settings/stop-words
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/settings/stop-words
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/settings/ranking-rules
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/settings/ranking-rules
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/settings/ranking-rules
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/settings/filterable-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/settings/filterable-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/settings/filterable-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/settings/distinct-attribute
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/settings/distinct-attribute
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/settings/distinct-attribute
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/settings/searchable-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/settings/searchable-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/settings/searchable-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/settings/displayed-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /indexes/{indexUid}/settings/displayed-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: DELETE /indexes/{indexUid}/settings/displayed-attributes
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /indexes/{indexUid}/stats
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /stats
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /version
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: POST /dumps
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
Updated: GET /dumps/{dumpUid}/status
  Response modified: 401
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink
  Response modified: 404
    Body attributes added: code, type, link
    [Breaking] Body attributes removed: errorCode, errorType, errorLink

View documentation diff

Powered by Bump

@gmourier gmourier merged commit bd5fa68 into develop Oct 13, 2021
@gmourier gmourier deleted the update-error-object-format branch October 13, 2021 08:31
Specification Workflow automation moved this from In Progress to Ready to be implemented Oct 13, 2021
@gmourier gmourier added Ready To Be Implemented Feature specification is ready to be implemented. v0.24 Q4:2021 and removed Ready For Review Feature specification must be reviewed. labels Oct 13, 2021
gmourier added a commit that referenced this pull request Nov 1, 2021
* Patch GeoSearch specification to mention technical limit on `desc` ordering around a _geoPoint (#66)

* mention decision and expected behavior for a desc ordering around a geoPoint

* add desc ordering around a geoPoint as a future possibility

* add descending order capability for _geoPoint built-in sort (#77)

* Sort (#55)

* initialize sort specification

* wip specification body

* fix typos and details

* Add OpenAPI changes

* Rename API routes

* fix typo

* add a part about measuring success

* specify metrics to send on Amplitude

* add lexicographical order for string type

* Typos, invalid_sort error definition

* Apply suggestions from code review

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>

* remove non correct information about mistyped ranking rule that do not raise error

* fix typos from reviews

* Update text/0055-sort.md

Co-authored-by: gui machiavelli <gui@meilisearch.com>

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
Co-authored-by: gui machiavelli <gui@meilisearch.com>

* Initialize draft specification for error object format

* reorganize and fix typos

* update oas with the new error format

* Add full list of errors

* Add invalid_geo_field error description

* Add task_not_found definition

* Add mention of error object fields order in response

* Apply suggestions from code review

Co-authored-by: gui machiavelli <gui@meilisearch.com>

* enhance the missing_primary_key error

* add know variants for message for a given error

* fix oas

* remove invalid_sort variant message for _geoPoint descending order

* fix typos

* sync new variants with geosearch error handling on ranking rule

* Update variants for invalid_filter and invalid_sort regarding geosearch

* add missing dot at the end of error message

* experiment bump.sh diff fixs

* update bump.yml

* update errors in oas

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
Co-authored-by: gui machiavelli <gui@meilisearch.com>
gmourier added a commit that referenced this pull request Nov 16, 2021
* Raise `1000` positions limit to `65535` for document attribute (#80)

* Add specification file

* fix typos

* Update text/0077-words-position-limit.md

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>

* Error Format (#61)

* Patch GeoSearch specification to mention technical limit on `desc` ordering around a _geoPoint (#66)

* mention decision and expected behavior for a desc ordering around a geoPoint

* add desc ordering around a geoPoint as a future possibility

* add descending order capability for _geoPoint built-in sort (#77)

* Sort (#55)

* initialize sort specification

* wip specification body

* fix typos and details

* Add OpenAPI changes

* Rename API routes

* fix typo

* add a part about measuring success

* specify metrics to send on Amplitude

* add lexicographical order for string type

* Typos, invalid_sort error definition

* Apply suggestions from code review

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>

* remove non correct information about mistyped ranking rule that do not raise error

* fix typos from reviews

* Update text/0055-sort.md

Co-authored-by: gui machiavelli <gui@meilisearch.com>

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
Co-authored-by: gui machiavelli <gui@meilisearch.com>

* Initialize draft specification for error object format

* reorganize and fix typos

* update oas with the new error format

* Add full list of errors

* Add invalid_geo_field error description

* Add task_not_found definition

* Add mention of error object fields order in response

* Apply suggestions from code review

Co-authored-by: gui machiavelli <gui@meilisearch.com>

* enhance the missing_primary_key error

* add know variants for message for a given error

* fix oas

* remove invalid_sort variant message for _geoPoint descending order

* fix typos

* sync new variants with geosearch error handling on ranking rule

* Update variants for invalid_filter and invalid_sort regarding geosearch

* add missing dot at the end of error message

* experiment bump.sh diff fixs

* update bump.yml

* update errors in oas

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
Co-authored-by: gui machiavelli <gui@meilisearch.com>

* Patch error format and messages (#87)

* Describes invalid_document_id error

* fix document_fields_limit_reached payload representation

* add backtick character for interpolated value on all error message

* Add variant for malformed_payload and add current primaryKey information on index_primary_key_already_exist error message

* update index_primary_key_already_exists error message since behavior has changed

* update index_primary_key_already_exists error message

* update payload_too_large message

* update payload_too_large message

* bump open-api file MeiliSearch version to v0.24.0

* update error examples

* Rework Analytics Stack (#84)

* Rework analytics specification

* Rephrase and fix typos

* Apply suggestions from code review

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
Co-authored-by: Irevoire <tamo@meilisearch.com>

* Add requests count on search endpoints

* Update context.app and infos

* Add an event table and a summarized Metrics/Events table views

* Rephrase aggregated metrics

* remove launched as trigger for instance system, stats, infos metrics

* Standardize metric and event descriptions (#86)

* update primary_key on aggregated events Documents Added and Documents Updated

* fix typos

* Keep native content-type

* Update text/0034-telemetry-policies.md

Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Remove usage of /tmp and use common config_dir instead

* fix typos

* fix uuid to uid

* remove stats before start_since_days

* fix order of magnitude for database_size, disk_size and ram_size

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
Co-authored-by: Irevoire <tamo@meilisearch.com>
Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>

* Fix documentation of search `sort` query param (#91)

It seems there's a missing empty line to differentiate two call-outs in the documentation of the `sort` query parameter of the `GET` search route.

Strangely enough, the `POST` search route doesn't have this `info` call-out maybe it's an oversight?

Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
Co-authored-by: gui machiavelli <gui@meilisearch.com>
Co-authored-by: Irevoire <tamo@meilisearch.com>
Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com>
Co-authored-by: Paul B <paul+gh@bonaud.fr>
@gmourier gmourier added Implemented Feature specification has been implemented. and removed Ready To Be Implemented Feature specification is ready to be implemented. labels Nov 16, 2021
@gmourier gmourier moved this from Ready to be implemented to Implemented in Specification Workflow Nov 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Implemented Feature specification has been implemented. OpenAPI Update OpenAPI specification. Q4:2021 v0.24
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants