HomeUniteUs icon indicating copy to clipboard operation
HomeUniteUs copied to clipboard

Bug[API] Controllers and OpenAPI response mismatch

Open paulespinosa opened this issue 1 year ago • 3 comments

Overview

The OpenAPI definition specifies that the API will return data following the ApiResponse schema. However, the API returns different data not matching the ApiResponse schema.

Known controller/spec issues found in the host controller.

Action Items

  • [x] Locate controller response and OpenAPI definition mismatches
  • [x] Decide which schema the API response should follow (creating a new one if necessary)
  • [x] Implement a test that will validate the API is responding with data that follows the OpenAPI definition
  • [x] Have the API return data that matches the OpenAPI schema

Resources/Instructions

Known mismatch issues: Create Host

Get all hosts

paulespinosa avatar Aug 28 '23 05:08 paulespinosa

Good find @paulespinosa!

connexion provides response validation, but it is disabled by default.

We should enable this option to find issues like this sooner. We will still need to add test cases to send a request to the hosts endpoints, since those endpoints are currently untested.

Joshua-Douglas avatar Aug 30 '23 03:08 Joshua-Douglas

Hey @johnwroge,

Assigned you this issue. Let me know if you need any help or would like anyone to review your proposed changes.

To make sure this change doesn't break any of our existing endpoints I suggest you add some test cases to cover each of the non-authentication endpoints used by the frontend app (you'll need to review which, if any, endpoints this includes).

Joshua-Douglas avatar Oct 02 '23 22:10 Joshua-Douglas

@Joshua-Douglas @johnwroge An idea: Wait until the new config system lands in the main branch and then add Response Validation. Have Response Validation enabled only for development/testing because it might have a performance impact down the line.

paulespinosa avatar Oct 08 '23 05:10 paulespinosa

Resolved as of #637

tylerthome avatar May 28 '24 23:05 tylerthome