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

Error message for HAPI-0302 shows misleading names for known resource types #5874

Closed
holly-smile opened this issue Apr 24, 2024 · 0 comments · Fixed by #5875
Closed

Error message for HAPI-0302 shows misleading names for known resource types #5874

holly-smile opened this issue Apr 24, 2024 · 0 comments · Fixed by #5875
Assignees

Comments

@holly-smile
Copy link
Collaborator

holly-smile commented Apr 24, 2024

Describe the bug
When a request is made for an unknown resource type, the server returns the resource types that it does know how to handle. When it does so, "List" is shown as "ListResource", which can (and already has) mislead someone trying to debug the error, especially if they then try to request a ListResource (which doesn't exist).

To Reproduce
Steps to reproduce the behavior:

  1. Make a GET request to any invalid resource, like GET /Abcdefgh/1326.
  2. See that "ListResource" is in the error message.

Expected behavior
The "List" resource is correctly shown as "List" in the list of resource types.

Screenshots
image

image

Environment:

  • HAPI FHIR Version: 7.3.0-SNAPSHOT

Additional context
Fix is ready and incoming.

I believe that this happens specifically with "List" because List is already a type in the Java standard library, so the resource class for "List" is named differently.

@holly-smile holly-smile self-assigned this Apr 24, 2024
lukedegruchy pushed a commit that referenced this issue Apr 25, 2024
…source types (#5875)

* A solution, but perhaps not the best one

* Make behavior more robust and extendable. Fixes #5874

* Apply spotless

* Add changelog

* 😅

* Add unit test

* Get name from context instead of hard-coding remapping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant