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

Make it possible to return HTTP 406 when there's no match #133

Open
p-himik opened this issue May 22, 2023 · 0 comments
Open

Make it possible to return HTTP 406 when there's no match #133

p-himik opened this issue May 22, 2023 · 0 comments

Comments

@p-himik
Copy link

p-himik commented May 22, 2023

reitit.coercion.malli/create uses :content-types of a resource to determine which response content types are supported.

Muuntaja completely ignores that key and seemingly doesn't allow its users to configure a strict set of response content types.

E.g. I want for my API to only produce application/edn or application/transit+json. But even if I set :default-format in Muuntaja config to application/edn and restrict :formats to application/edn, a client will get EDN instead of HTTP 406 even when it specifies that it can't handle anything but e.g. application/json by using the Accept header.

An additional point worth considering is that different API endpoints might have different available content types.

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