ConsumerDataRight / mock-data-holder

A mock version of a Consumer Data Right Data Holder solution that can be used in the development and testing of CDR solutions
MIT License
17 stars 23 forks source link

Endpoint returns a 400 error but no error object #26

Closed tom-schier closed 2 years ago

tom-schier commented 3 years ago

Describe the bug The standard stipulates that if a http error code 400 is returned the body should contain an error object.

To Reproduce Steps to reproduce the behavior:

  1. Follow the setup instructions as per ReadME file, then Run the mock-data-holder, mock-register, mock-data-recipient as Docker container
  2. Start at https://localhost:9001 and go through the process of "Discover Data Holders", "Get SSA", "Dynamic Client Registration", "Consent and Authorisation"
  3. Click on the Authorisation URI, login, verify, and then get an access token
  4. In the Postman collection run the Get Common Customer person request with the access token in the header. This will return an Http code 400 with an empty error object.

Expected behaviour If a 400 code is returned the body should have an error object

Screenshots

ErrorCapture

Additional context If you hit this endpoint and change the x-v version to a higher number, the result is as expected. That is a 406 is returned with an appropriate error message. If you hit that endpoint with an invalid access token, the result is as expected, ie a 401 is returned

CDR-AndrewG commented 2 years ago

Thank you for getting in touch with us to raise this issue.

We have replicated the issue using steps provided.

We have logged the issue and will include a fix in a future release.

CDR-AndrewG commented 2 years ago

The fix for this issue has now been merged in to the main branch. https://github.com/ConsumerDataRight/mock-data-holder/pull/37