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

Can't have parameters in content-types #132

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

Can't have parameters in content-types #132

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

Comments

@p-himik
Copy link

p-himik commented May 14, 2023

The RFC describing content-type allows for arbitrary semicolon-separated key-value pairs as parameters. Currently, Muuntaja cares only about charset and won't work correctly if there are other parameters.

Apart from the "not working" part, having custom parameters is also helpful when attempting to customize the representation without changing the format, where the customization is possible at the application level.
E.g. in addition to application/json and application/edn it's useful to handle application/json;pretty=true and application/edn;pretty=true, in particular when dealing with Swagger UI.

My current workaround is to use an extra content type of application/edn-pretty where I care about pretty-printing.

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