Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-19263

[FTS] REST: response format should be unified between HTTP 200 and 400

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 5.5.0
    • 4.5.0
    • fts
    • None
    • Untriaged
    • Unknown
    • FTS Sprint Mar-30-2018

    Description

      In FTS, the response format varies depending on the response code:

      • correct requests return HTTP 200 and have a well-defined response format in json
      • malformed requests (eg. syntax errors) return HTTP 400 but with a - seemingly more freeform - text/plain response

      It would make sense to try and have an uniform response format. For example, the text/plain could be transformed and made part of the "status" section of the json response. Please also consider mirroring the whole 1st level of the 200 response, with empty arrays for hits, facets, etc...

      Typically the HTTP code would still be useful to quickly differentiate between a FATAL error vs execution-time errors or success. HTTP 400 would be reflected in "status": "total" == "failed", "success" == 0. Maybe a status string would also make sense at top level?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              abhinav Abhi Dangeti
              simonbasle Simon Baslé (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty