-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
Problem
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