-
Notifications
You must be signed in to change notification settings - Fork 284
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
[FR] Some way to have @RequestParam(required = false)
be interpreted as @Nullable
#751
Comments
Hi there, if I understand correctly, you would like to treat @lazaroclapp in case you have other ideas here |
Thanks. I'm requesting the feature that allows for matching on parameters. I have used the custom nullability annotations that you mentioned, which is probably good enough for my personal use case but I can imagine it not being sufficient for others. I definitely understand that matching on parameters will be difficult and this is very low priority for me personally. This issue exists mostly to document that the need may be out there. |
Thanks! Matching on parameters may not be difficult but it would have to be done with care to ensure no negative impact on NullAway performance when it is not required. If someone really needs this we are open to discussion / evaluating a PR. |
I just added NullAway 0.10.10 to the build process of a collection of microservices that use Spring Boot and Feign to communicate. The interfaces that the microservices use are annotated to indicate whether the function parameters are put in the URL path , as query parameters, or as a request body. Most query parameters are optional and should be treated as nullable if they have the
required = false
argument to the@RequestParam
annotation. Unfortunately,required = true
is the default and there are many other arguments that the annotation takes.In my case, it seems like treating the
@RequestParam
annotation as equivalent to@Nullable
makes some sense because we userequired = false
99% of the time, but I can imagine other times where the extra accuracy would be helpful.The text was updated successfully, but these errors were encountered: