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
I am wondering why @MvcBinding can only be used on fields, methods and parameters. (Probably because JAX-RS binding annotations can only be used on this types?)
Annotating all fields of a JAX-RS bean parameter with @MvcBinding looks way more common to me than annotating some fields and some not. Wouldn't it be convenient if a class could be annotated with @MvcBinding instead of annotating each field separately?
Maybe I am missing something here?
The text was updated successfully, but these errors were encountered:
Thanks a lot for bringing this up. I agree that using @MvcBinding on all fields of a @BeanParam class is a very common case. So allowing @MvcBinding on classes could be a good option.
However, you are correct that @MvcBinding is closely integrated with the JAX-RS binding mechanism, which (AFAIK) does not support binding metadata on the class level. But this could be something to bring up to the JAX-RS EG. Maybe some JAX-RS implementations even support it?
@mvc-spec/expert-group Any other thoughts on this?
Although I agree that allowing @MvcBinding on classes would be a great way to simplify creating classes used with @BeanParam, I currently don't see any way we can implement this in the RI. JAX-RS only provides annotations directly placed on method parameters and fields. So there seems to be no way for us to get annotations placed on classes in the @BeanParam case.
Therefore, I'll change the milestone to Future for now. We should bring up this topic to the JAX-RS EG. Maybe future JAX-RS versions could provide this information in a portable way. And if we find some other way to implement it in the RI, we can provide this functionality in the RI on top of what MVC 1.0 requires and make it a requirement it in a later version of the spec. I created mvc-spec/ozark#196 to track this feature.
Saturday May 26, 2018 at 15:08 GMT
Originally opened as mvc-spec/mvc-spec#161
Hello,
I am wondering why
@MvcBinding
can only be used on fields, methods and parameters. (Probably because JAX-RS binding annotations can only be used on this types?)Annotating all fields of a JAX-RS bean parameter with
@MvcBinding
looks way more common to me than annotating some fields and some not. Wouldn't it be convenient if a class could be annotated with@MvcBinding
instead of annotating each field separately?Maybe I am missing something here?
The text was updated successfully, but these errors were encountered: