Feature Request: @Default Annotation
See original GitHub issueCurrently it is very unhandy to set a default value for properties in case of a validation failure. You have to evaluate the ValidationError and set the default value on your own. It would be nice to have a new annotation, something like @Default(‘en-GB’), which allows the user to set a default value.
Instead of
@IsNotEmpty()
locale: string;
const localeErrors = validationErrors.find(error => error.property === 'locale');
if (localeErrors) {
initialQueryParameters.locale = 'en-GB';
}
you could simply write
@Default('en-GB')
@IsNotEmpty()
locale: string;
which sets a default value in case of an ocuring error.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Feature request: Set default annotation values #3840 - GitHub
There are many annotations which provide a default value out of the box, but only of a few the default value can be...
Read more >[Feature request] Default values not used in annotations
Hi,. It seems there is an option called default - you could support this its working, but skipper of course overwrites my changes....
Read more >Feature request: add option to set default color for annotations ...
Annotations in evince are yellow by default. When marking up PDFs with a yellow background, however, it is more appropriate to use a ......
Read more >Annotations Feature Request - GdPicture Imaging Forums
Hi, I would like to add a feature request. Allow setting default annotation font family, font size, and annotation text so that when...
Read more >Ability to change default annotation color - Evernote Forum
I'd love the abiliy to change the default color for the annotation tools such as the text tool and arrow tool. I'd also...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

For those interested; this is the decorator I quickly threw together using the Transform function.
Example form my paginationQueryValidator (for lists)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.