Skip to content

204 Status code for nil returns #793

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

Open
jzillmann opened this issue Apr 8, 2025 · 0 comments
Open

204 Status code for nil returns #793

jzillmann opened this issue Apr 8, 2025 · 0 comments

Comments

@jzillmann
Copy link

I have an endpoint which either returns an entity or not.
Instead of returning a 404 I would rather return a 204 which isn't treated as error in the frontend, which is good since the absence of the entity is an expected state.

Reading https://huma.rocks/features/response-outputs/ my only seems to be the Status field in the struct, which is dislike.
Any other option for me like a middleware doing if returnValue = nil... ?

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

No branches or pull requests

1 participant