alexa-skills-kit-sdk-for-java icon indicating copy to clipboard operation
alexa-skills-kit-sdk-for-java copied to clipboard

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

Open kkocel opened this issue 6 years ago • 5 comments

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 avatar Aug 30 '19 08:08 kkocel

@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.

kkocel avatar Sep 09 '21 10:09 kkocel

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

pkatre2 avatar Oct 23 '21 16:10 pkatre2

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

kkocel avatar Oct 23 '21 21:10 kkocel

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.

rahulawl avatar Sep 12 '22 10:09 rahulawl

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

kkocel avatar Sep 12 '22 11:09 kkocel