Streamline content negotiation #56
elmerbulthuis
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One very cool feature that http has is content negotiation! OpenApi42 embraces this by providing content negitaiotio as a first class citizen. It does need a little bit of streamlining.
current situation
We want to not manually throw the error. We can do this by allowing undefined to be a result of the operatinhandler. This should throw an error that can be translated by the error middleware into a 406 not acceptable.
Now content negotiation is somewhat verbose but this is considered an advanced feature, it requires some extra work for some extra relatively complex functionality. On could also designg their in a way that every content type has the same structure. That way the negotiation would be implicit. Like this:
This will take the first (the preferred) content type from the accept header and use that in the response. Would be great if this could be implicit as well.
Beta Was this translation helpful? Give feedback.
All reactions