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
Currently, the way the models constructors are being generated are as follow:
late ObjectId id; // generates a positional parameter
late String? maybeDescription; // generates an named nullable parameter
late double milesTravelled = 0; // generates a named non-nullable parameter with a default value
What if you wanted a non-nullable named parameter without a default value? (For example, if the default value is generated from a function call, and not a constant.) You're out of luck, you're stuck with positional params - which is fine when there are only a couple. When there are more than a couple of them, it becomes harder to manage. It would be nice to have an option to generate a required field.
Solution
Solution: Add a @required PropertyAnnotation that will generate a required named param instead of a positional param
Alternatives
Alternative solution: Turn all positional parameter into required name parameter.
How important is this improvement for you?
I would like to have it but have a workaround
Feature would mainly be used with
Atlas App Services: Auth or Functions etc
The text was updated successfully, but these errors were encountered:
Hi @lhengl!
Thanks for giving your feedback!
It seems to be important for people using the Realm, since we have received the same request before. Probably you will be interest to read the conversation here #292.
We already have this issue in the list, but we are currently working on other priority tasks.
Probably, we can close this issue as duplicated.
Problem
Currently, the way the models constructors are being generated are as follow:
What if you wanted a non-nullable named parameter without a default value? (For example, if the default value is generated from a function call, and not a constant.) You're out of luck, you're stuck with positional params - which is fine when there are only a couple. When there are more than a couple of them, it becomes harder to manage. It would be nice to have an option to generate a required field.
Solution
Solution: Add a @required PropertyAnnotation that will generate a required named param instead of a positional param
Alternatives
Alternative solution: Turn all positional parameter into required name parameter.
How important is this improvement for you?
I would like to have it but have a workaround
Feature would mainly be used with
Atlas App Services: Auth or Functions etc
The text was updated successfully, but these errors were encountered: