OpenSourceFellows / amplify-back-end

The API backend for ProgramEquity
https://www.programequity.com/
MIT License
11 stars 0 forks source link

Zip Code Validation in Representatives API #217

Closed computate closed 2 years ago

computate commented 2 years ago

Submitting a request with an invalid zipcode like /api/representatives/cat results in a 500 Internal Server Error, but should be a 400 Bad Request instead.

Expected Behavior

The requests below should result in the following status codes

Current Behavior

Submitting a request with an invalid zipcode like /api/representatives/cat results in a 500 Internal Server Error, but should be a 400 Bad Request instead.

Possible Solution

Perform some zipcode validation in the /api/representatives/zipcode API and write some unit tests around the validation.

Steps to Reproduce

  1. Start a codespace and run the server.
  2. Access your API at /api/representatives/cat to see the 500 error.

Context (Environment)

I was wondering what zipcode formats are supported. I thought it would be good to build some validation around the zipcode format.

Labels

computate commented 2 years ago

Closed by https://github.com/ProgramEquity/amplify-back-end/pull/218