Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jaxrs-dev] [External] : Re: @Status Annotation?



On Sep 2, 2021, at 3:15 PM, Jan Supol <jan.supol@xxxxxxxxxx> wrote:

There are a couple of corner cases to be thought through:

 Yes, we’d need to define these precisely. First thoughts:
  • If @Status is used and an exception occurs, should the @Status apply? (Possibly not, but doable with wrapping WebApplicationException with the status)
 No.
  • If both Response with status and @Status are present, who gets priority?
 Response. Programmatic should override declarative.
  • If null is returned, has @Status priority over 204?
 Should have priority over all defaults regardless of possible pilot error.
  • In the case of sub-resource locators, should the annotation be on the locator or on the subresource method?
 I don’t think it should apply to locators.
  • Is it applicable for SSE (as we just have seen with 201/200 TCK issue there)/AsyncResponse resources?
 Good question, maybe.

— Santiago



From: jaxrs-dev <jaxrs-dev-bounces@xxxxxxxxxxx> on behalf of Santiago Pericasgeertsen <santiago.pericasgeertsen@xxxxxxxxxx>
Sent: Thursday, September 2, 2021 8:27 PM
To: jaxrs developer discussions <jaxrs-dev@xxxxxxxxxxx>
Subject: Re: [jaxrs-dev] [External] : Re: @Status Annotation?
 


> On Sep 2, 2021, at 2:08 PM, Reza Rahman <reza_rahman@xxxxxxxxx> wrote:
> 
> Seems like a nice usability enhancement, but probably not a very high priority. I would do it if it is easy.

 My thought exactly. Thanks for the feedback.

— Santiago

> Please note views expressed here are my own as an individual community member and do not reflect the views of my employer.
> 
>> On Sep 2, 2021, at 12:16 PM, Santiago Pericasgeertsen <santiago.pericasgeertsen@xxxxxxxxxx> wrote:
>> 
>> Hi All,
>> 
>> Trying to get some quick feedback before doing anything. 
>> 
>> There are some use cases in which the default status return for a resource method that does not return Response needs to be overridden. For example, a POST request that wants to return 201 instead of 200. Of course, you can fix this by returning a Response, but that may not be ideal in all cases (e.g., tools that do static analysis would prefer to see Foo over Response as return type). I believe some impls already support this.
>> 
>> Shall we try to squeeze this in 3.1?
>> 
>> — Santiago
>> _______________________________________________
>> jaxrs-dev mailing list
>> jaxrs-dev@xxxxxxxxxxx
>> To unsubscribe from this list, visit https://urldefense.com/v3/__https://www.eclipse.org/mailman/listinfo/jaxrs-dev__;!!ACWV5N9M2RV99hQ!bxuQ6WKrg_Yer0F_937K1JOXda8v2tzzTCm21Zi6tuNIYwBnQjzpYn3pqRN9Hrt4e1Jt28iHVg$ 
> _______________________________________________
> jaxrs-dev mailing list
> jaxrs-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://urldefense.com/v3/__https://www.eclipse.org/mailman/listinfo/jaxrs-dev__;!!ACWV5N9M2RV99hQ!bxuQ6WKrg_Yer0F_937K1JOXda8v2tzzTCm21Zi6tuNIYwBnQjzpYn3pqRN9Hrt4e1Jt28iHVg$ 

_______________________________________________
jaxrs-dev mailing list
jaxrs-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://urldefense.com/v3/__https://www.eclipse.org/mailman/listinfo/jaxrs-dev__;!!ACWV5N9M2RV99hQ!cXF-nGFgLwGvf9ByAQQQo3Qy2dutlrpslYr-2maxfJPrejOOOimNGQmzOqyRxoMc$ 
_______________________________________________
jaxrs-dev mailing list
jaxrs-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://urldefense.com/v3/__https://www.eclipse.org/mailman/listinfo/jaxrs-dev__;!!ACWV5N9M2RV99hQ!ZlTq07-36Bb0lo1kIEXpHYJly_tDfRDxe7Xh9kxIiVy6fYUSu-nDzNSC7ruDs9x1l6L13jrReA$


Back to the top