alexa-skills-kit-sdk-for-java
alexa-skills-kit-sdk-for-java copied to clipboard
Make SDK explicit about nullability in parameters and returned values - Kotlin friendly
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)
@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.
can you please assign it to me , would like to contribute
@pkatre2 feel free to submit a PR. assignment is not necessary ihmo
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.
yes, it is. I even provided a way how to implement it, but since templates are not public I cannot contribute.