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

Allowing other content types for json #441

Open
sbdchd opened this issue Sep 13, 2022 · 2 comments
Open

Allowing other content types for json #441

sbdchd opened this issue Sep 13, 2022 · 2 comments

Comments

@sbdchd
Copy link

sbdchd commented Sep 13, 2022

looking through the code,

(expected, requested) => {
return Err(HttpError::for_bad_request(
None,
format!(
"expected content type \"{}\", got \"{}\"",
expected.mime_type(),
requested.mime_type()
),
))
, I think currently content types for json besides application/json aren't supported

my use case is I'm trying reimplement an AWS api where the client uses a application/x-amz-json-1.0 header for json so being able to have a route take a custom json content type would be useful

edit: as a work around I think I could skip parsing the body as json, but then I'd lose the fancy open api stuff

@ahl
Copy link
Collaborator

ahl commented Sep 14, 2022

Thanks for filing the issue. Would the parsing of content with application/x-amz-json-1.0 be identical to that of application/json? Perhaps we can provide an interface that allows one to specify aliases for application/json.

@sbdchd
Copy link
Author

sbdchd commented Sep 14, 2022

honestly not entirely sure, but in my use case I would assume they're the same

rel: https://stackoverflow.com/questions/65118844/what-is-application-x-amz-json-and-how-is-it-different-from-application-json

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

2 participants