When a glossary term is requested by ID, and no term matches that ID, the API returns an HTTP status 500 instead of 404.
This appears to be due to a change in the NEST client between versions 5.x and 7.x, whereby response.IsValid is now false when the term is not found.
As part of fixing this issue, it will be necessary to review the unit tests and verify that all methods are tested for appropriate behaviors when Elasticsearch returns a non-200 status.
ESTIMATE TBD
Steps to reproduce the issue
Spin up the Docker containers in the integration-tests/docker-glossary-api directory.
Issue description
When a glossary term is requested by ID, and no term matches that ID, the API returns an HTTP status 500 instead of 404.
This appears to be due to a change in the NEST client between versions 5.x and 7.x, whereby
response.IsValid
is nowfalse
when the term is not found.As part of fixing this issue, it will be necessary to review the unit tests and verify that all methods are tested for appropriate behaviors when Elasticsearch returns a non-200 status.
Steps to reproduce the issue
integration-tests/docker-glossary-api
directory.What's the expected result?
{"Message":"No match for dictionary 'cancer.gov', audience 'Patient', language 'en' and id '5."}
What's the actual result?
{"Message":"Invalid response when searching for dictionary 'cancer.gov', audience 'Patient', language 'en' and id '5."}
Additional details / screenshot
Related Tickets