You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
When a client posts an invalid event, Nakadi tries to reply with 422 status code and an JSON body.
But if client provides an invalid header, for example "Accept: application/json+problem", Nakadi replies with 406 and does not provide a list of available content types for negotiation.
I suggest that we accept any content type and always return a json regardless of the representation asked by users, since this is the only representation available.
The text was updated successfully, but these errors were encountered:
I suggest that we accept any content type and always return a json regardless of the representation asked by users, since this is the only representation available.
If this is done (ie tie a generic media type to a custom type, or not require a media type), the API will probably have to take a position on what the default return is, if when multiple versioned media types exist. I've seen two forms:
Return the initial (earliest version). Upside: compatibility. Downside: ties the service to the oldest version indefinitely. Notably, performing a deprecation becomes complicated.
Return the current version: Upside: service evolution. Downside: incompatible results [1]. Typically the API needs to document that it has no compatibility guarantees on the general media type (or the absence of a media type).
Requiring a specific, non-floating media type avoids both of these at the cost of being inconvenient. The observation I'd make is that once you support generic or no media types, people will use them and may be surprised when things break, even if it's documented. It's a tricky thing to navigate :)
[1] There's a way around this, if you know something very specific about the caller, eg via a datable token or api key, which can force a transformation to a compatible format. That requires a good level of engineering to not become spaghetti, and the project doesn't have a clear way to support that kind of identification, so I'd rule this one out.
@rcillo@dehora This has been opened almost a year ago, and I don't think we've made any progress on this. Does one of you want to revive the discussion, or should we just close this?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When a client posts an invalid event, Nakadi tries to reply with 422 status code and an JSON body.
But if client provides an invalid header, for example "Accept: application/json+problem", Nakadi replies with 406 and does not provide a list of available content types for negotiation.
I suggest that we accept any content type and always return a json regardless of the representation asked by users, since this is the only representation available.
The text was updated successfully, but these errors were encountered: