Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19683

'Update merge strategies' POST API returns plain text 400 response for invalid JSON request bodies

XMLWordPrintable

      Issue Summary

      When an invalid JSON is provided in the request body for the Update Merge Strategies POST API (/api/latest/admin/pull-requests/<<scmId>>) in Bitbucket 9.x, the response for a 400 Bad Request is returned in plain text rather than the documented JSON format. This issue is specific to requests with invalid JSON bodies; other bad requests, like those with unsupported merge strategies, still return responses in the expected JSON format. This inconsistency disrupts integration with external plugins, as they cannot properly handle the exception.

      This is reproducible on Data Center: (yes)

      Steps to Reproduce

      • Send invalid JSON syntax in the request body for the POST API /api/latest/admin/pull-requests/{scmId}

      Expected Results

      • The 400 bad request is formatted in JSON.

      Actual Results

      • The 400 bad request is formatted in plain text instead of JSON.

      Workaround

      • Currently there is no known workaround for this behavior. A workaround will be added here when available

              csubraveti Chandravadan
              ce91f45cf510 Karthik Mahesh
              Votes:
              14 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: