Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger needs updating for POST ~/contact/send #345

Open
carorm opened this issue Dec 31, 2020 · 1 comment
Open

Swagger needs updating for POST ~/contact/send #345

carorm opened this issue Dec 31, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@carorm
Copy link
Contributor

carorm commented Dec 31, 2020

Describe the bug
Swagger provides the following:

{
  "relationshipTitle": [
    "Primary Contact"
  ],
  "contactIds": [
    "ba262fa3-38d9-4c88-b49b-ab306349124a"
  ],
  "entityIds": [
    "ba262fa3-38d9-4c88-b49b-ab306349124a"
  ],
  "entityType": "Assisted Living Facility"
}

And it still does 400 - Bad Request.

To Reproduce
Steps to reproduce the behavior:

  1. Download bmore project
  2. Run it locally via docker
  3. Run POST {{baseUrl}}/contact/send locally with a payload from swagger example
  4. See that it populates with a 400.

Expected behavior
User should be created based off swagger information or update the swagger to show what it should be instead. Postman had incorrect information based off what swagger had to provide. Once the swagger is updated, can make adjustments to postman as well.

Environment
A concise description of your environment: Catalina 10.15.7. Docker version 20.10.0, build 7287ab3. NPM = 7.0.10. Ran from master branch on 12/31/2020 @ 3:00PM EST.

Additional context
Add any other context about the problem here.

@carorm carorm added the bug Something isn't working label Dec 31, 2020
@jameswgoddard jameswgoddard self-assigned this Jan 24, 2021
@jameswgoddard
Copy link
Contributor

The parameters provided in the body of the request sent to /contacts/send are "AND-ed" together by the backend. The seeders that populate a development database generate random values for contactIds, entityIds, and relationshipTitles. This is why the example query doesn't work with the static query provided in swagger.json. Changing the parameters to values found in the database, or an empty object, will result in a 200 Response.

The only predictable parameter for this endpoint is entityType which is hardcoded to "Test" in the seeders. So we have two choices as far as I can see. We could re-work the seeders or just fix the body of swagger.json to only include "{entityType:"Test"}"

I'd vote for the latter because there are plans to re-factor the backend entirely and effort should likely be focused there. However, I'm definitely interested in hearing what others who are more familiar with the project think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants