-
Notifications
You must be signed in to change notification settings - Fork 124
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
Add ProblemDetails Support #1150
Comments
Thank you for pointing us to this RFC! My personal opinion in is:
Having said that, I like to present some counter-proposal to discuss (not counter proposals to RFC 7807, but to
My personal favorite is the interface solution, as providing the cause in the same way we already provide the error feals like Java. |
In Spring 6, when handling a response body of ProblemDetails, it will update the HTTP status(code and message) with status value in the problemDetails object automatically if the response is not set HTTP Status explicitly. |
Understood, but as Jakarta REST's way of error handling is an If we go with |
I hope there is an annotation which can handle a collection of exceptions like the Spring For me, ExceptionMapper handles exceptions one by one is a little tedious. |
I am confused by your last posting. Is it a beginner's question or a feature proposal? |
Very interesting topic. A few spontaneous thoughts:
Just my 2 cents. Would love to hear more thoughts. |
Reading @chkal's response I think it would be a wise and extensible solution if we do not discuss |
My initial reaction to this is that, although an interesting RFC for sure, it probably shouldn't be part of the core Jakarta REST (or in any way integrated with default exception mappers). Given our API's extensibility, it should be possible for implementations to provide an additional module to support this RFC is they so choose. This alternative would make it easy for application developers to opt in without the need to possibly need to opt out. |
@spericas Recently you were +1 for integrating status codes that also could easily get added using the extension mechanism, so I am rather confused about your comment. Can you elaborate why you are +1 for the status codes but -1 for this RFC? |
@mkarg Unless I'm missing something, adding a few more status codes is very different from incorporating an RFC that defines a machine-readable payload format that Jakarta REST would need to follow. |
Actually I do not see such a difference, a feature is a feature to me, independent of its size or complexity (in fact, those new status codes do not bring much benefit, but this new payload would, IMHO). But I certainly respect your opinion. So is your -1 really a veto (i. e. we MUST NOT adopt this RFC, even in case a majority wants to)? Could I convince you to change it from a vetoing -1 to a 0? |
You're usually the first one to be in opposition to adding new functionality to the "core JAX-RS" (you've used that argument many times in the past). It is exactly the same thing I'm saying here, I don't see why this couldn't be part of an extension in an implementation. So, no, not all features are or should be consider equally (and certainly supporting an RFC such as this and adding a few more error codes is not the same). I could change my vote after hearing the right argument as to why this should be part of the core. |
To be more precise: I am not generally in opposition to any new functionality, I am just in opposition to new functionality that can easily be done in an external library. ;-) Don't get me wrong, I have no problem with doing this features in an external library-- I really love the idea to provide some kind of "JAX-RS Essentials" extension lib. I just was confused because I expected that you will be +1 here, just because you were +1 for the status codes. I am absolutely fine with doing this in an external library, if you really want to put a veto here. |
Just for reference, it looks like #839 was requesting this as well and it was closed. |
I would be in favor of closing this one too :) |
@spericas So jaxrs no plan for it? |
@hantsy Santiago already pointed out that he is vetoing unless we provide a good reason. The discussion as shown that there is no such good reason. Hence I am closing this issue hereby. The feature can easily get implemented by a third-party library thanks to the various extension points of JAX-RS (like filters, interceptors, features, services, etc.). The proposed feature undoubtly might be commonly beneficial to a lot of applications, so I like to encourage you to start an open source project for providing such a filter, and put a link to it here. |
@t1 Great work. |
Since this issue is still open wanted to comment here. @mkarg @spericas Going through this thread and this earlier thread from @t1, the main opposition seems to be that this project focuses on the "core of REST-over-HTTP" and this feature request doesn't align with that, but I'd argue that it does. The Problem Details standard doesn't just standardize field and field types/values, but also the returned In my opinion this change is less like adding in a common MVC implementation/support that I think requires more freedom for implementation, and instead is a more contractual detail on your API and how it presents itself to your client. Similar to how there is |
@mabraithwaite We need to draft a new spec proposal for ProblemDetails rfc? |
ProblemDetials improves the error description, if we are stuck on it is not related to REST? why JSON Patch/Merge Patch are accepted as parts of REST spec. In my opinion, I do not think these two Patch rfcs are more popular than ProblemDetails when we develop RESTful APIs. |
Spring has already added ProblemDetails support in the new Spring 6.
https://www.rfc-editor.org/rfc/rfc7807
The text was updated successfully, but these errors were encountered: