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
* Implement [Validator] RestrictStringLength
- [+] feat(constant.go): add error messages for fields exceeding maximum length
- [+] feat(restrict_string.go): implement RestrictStringLength restrictor for validating string field lengths
- [+] test(validator_test.go): add test cases for RestrictStringLength restrictor
* Update Benchmark result
- [+] docs(README.md): add benchmark results for long description scenarios and JSON/XML encoders
- [+] docs(README.md): add observations and conclusion based on benchmark results
- [+] test(benchmark_test.go): add benchmarks for long description scenarios with Sonic JSON, standard JSON, default XML, and custom XML encoders
* Docs [README] Update Documentation
- [+] docs(readme): add new feature to restrict string length for specified fields with configurable maximum length
Copy file name to clipboardExpand all lines: README.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ The middleware currently supports the following features:
11
11
- Conditional validation skipping based on custom logic
12
12
- Restriction of fields to contain only numbers with an optional maximum value
13
13
- Storing validation results in the request context for advanced use cases
14
+
- Restriction of string length for specified fields with a configurable maximum length
14
15
15
16
More features and validation capabilities will be added in the future to enhance the middleware's functionality and cater to a wider range of validation scenarios.
> Based on the benchmark results, the following observations can be made:
193
+
>
194
+
> - The Sonic JSON encoder/decoder consistently outperforms the standard JSON encoder/decoder in terms of execution time, bytes allocated, and allocations per operation.
195
+
> - The custom XML encoder/decoder performs slightly slower than the default XML encoder/decoder in most cases, with similar memory usage.
196
+
> - The JSON benchmarks generally have better performance compared to the XML benchmarks, with lower execution time, bytes allocated, and allocations per operation.
0 commit comments