Skip to content

Can't have parameters in content-types #132

@p-himik

Description

@p-himik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions