pulibrary / allsearch_api

0 stars 0 forks source link

BestBet, Database, and Staff get an ArgumentError if you search for 0%000 #245

Closed sandbergja closed 4 months ago

sandbergja commented 4 months ago

Expected behavior

These don't throw an error:

Actual behavior

They do throw a ArgumentError error

Steps to replicate

curl "https://allsearch-api.princeton.edu/search/best-bet?query=0%000"
curl "https://allsearch-api.princeton.edu/search/database?query=0%000"
curl "https://allsearch-api.princeton.edu/search/staff?query=0%000"

Impact of this bug

Probably pretty low, but it is unexpected/undefined behavior. And it means that there is a gap in our swagger documentation.

Honeybadger links

Note

I found this with schemathesis. To try it locally from your allsearch_api directory:

brew install schemathesis
schemathesis run swagger/v1/swagger.yaml --base-url="https://allsearch-api.princeton.edu/"
rladdusaw commented 4 months ago

I think you can fix this with the rescue_uri_error method I created in https://github.com/pulibrary/allsearch_api/pull/241