fix(form): Set default value for form fields (#4047)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
- Use specified default value in struct tags when binding a request input to struct for validation, even if sent empty, not only when not sent at all. - Add string field to `TestMappingDefault` test case. - Add test case for not sent form field to default to the value specified via code. - Add test case for form field sent empty to default to the value specified via code.
authored by Ahmad Saeed Goda · committed by GitHub · parent 3cb3067 · Browse files · 2 files+23 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Fixes: How to apply default value if empty value provided by client during model binding? #4042, #13042df, #a41721a
Diff stats
2 files+23 added−0 removed
- other:+23 added−0 removed