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
{{ message }}
Repository navigation
Move the "optional" attribute from TypeReference to Parameter #296
The specification models the optional attribute of parameters on their TypeReference instead of directly on the parameter. This creates a confusion between nullable and optional.
The specification needs to be modified so optional parameters carry an optional attribute, while TypeReferences carry a nullable attribute.
@rix0rrr I think is a different issue than where we model optionality of parameters. This is basically about nullibility of parameters, which is currently not supported by jsii (and should in my mind). Care to raise a separate issue?
it’s a related topic but not the same. This issue is basically just a modeling improvement (move the “optional” indication from the type reference to the parameter/property specification). Nullability is a different attribute of type references which is not the same as optionality.
If at all, nullability should be part of the type-reference while optionality should be part of the consuming specification.
Activity
rix0rrr commentedon Dec 28, 2018
So I wanted a function like such:
Because that method order made most sense (and yet we didn't necessarily have the first argument always available), but this was rejected.
I've had to reorder arguments, which is not a BIG deal but it was suboptimal to my mind.
eladb commentedon Dec 30, 2018
@rix0rrr I think is a different issue than where we model optionality of parameters. This is basically about nullibility of parameters, which is currently not supported by jsii (and should in my mind). Care to raise a separate issue?
rix0rrr commentedon Dec 31, 2018
Isn't adding type nullability something that we need to tackle as part of solving this ticket anyway?
eladb commentedon Dec 31, 2018
it’s a related topic but not the same. This issue is basically just a modeling improvement (move the “optional” indication from the type reference to the parameter/property specification). Nullability is a different attribute of type references which is not the same as optionality.
If at all, nullability should be part of the type-reference while optionality should be part of the consuming specification.
feat(jsii-spec): Model parameter optionality
feat(jsii-spec): Model parameter optionality (#432)