Skip to content
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

Make SDK explicit about nullability in parameters and returned values - Kotlin friendly #225

Open
kkocel opened this issue Aug 30, 2019 · 5 comments

Comments

@kkocel
Copy link
Contributor

kkocel commented Aug 30, 2019

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[X] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Expected Behavior

When passing parameters to API I should know if I can pass null safely.
When I get parameters from API (eg. by implementing it's interfaces, extending classes) I want to be sure wether received object will be null or not.

Current Behavior

Possible Solution

Make use of Nullability annotations - eg. JSR-305 (as runtime dependency)
Annotate appropriate elements with relevant annotations, or even mark whole packages using package-info.java.

Context

Now SDK does not indicate in clear way wether objects can be or can't be null. Such approach forces SDK consumers to write tons of boilerplate defensive code which can turn out to be useless (but consumer does not know that)

@kkocel kkocel changed the title Make SDK explicit about nullability in parameters and retyr Make SDK explicit about nullability in parameters and return values Aug 30, 2019
@kkocel kkocel changed the title Make SDK explicit about nullability in parameters and return values Make SDK explicit about nullability in parameters and returned values Aug 30, 2019
@kkocel kkocel changed the title Make SDK explicit about nullability in parameters and returned values Make SDK explicit about nullability in parameters and returned values - Kotlin friendly Dec 15, 2020
@kkocel
Copy link
Contributor Author

kkocel commented Sep 9, 2021

@Shreyas-vgr Basically, this feature requires modifications in mustache templates. Adding annotations if fields / method parameters and return values are required / optional. Unfortunately, those templates are not published on GitHub so I can't contribute to them.

@pkatre2
Copy link

pkatre2 commented Oct 23, 2021

can you please assign it to me , would like to contribute

@kkocel
Copy link
Contributor Author

kkocel commented Oct 23, 2021

@pkatre2 feel free to submit a PR. assignment is not necessary ihmo

@rahulawl
Copy link
Contributor

Is this issue/feature-request still relevant?
We are working on prioritization of relevant issues and cleanup of rest. If we don’t hear back in 2 weeks, we will assume that the issue is not relevant and we will close it.

@kkocel
Copy link
Contributor Author

kkocel commented Sep 12, 2022

yes, it is. I even provided a way how to implement it, but since templates are not public I cannot contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants