question: is there a way to get the lowest level constraints messages without building an iterator to get there?
See original GitHub issueI have ValidateNested and just need the message from the constraint that caused the issue.
Current Code:
function retrieveValidationErrorMessage(err: ValidationError): string {
if (err.children && err.children.length > 0) {
return retrieveValidationErrorMessage(err.children[0]);
} else {
return Object.keys(err.constraints).map(key => err.constraints[key])[0];
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
ListIterator in Java - DigitalOcean
First, we need to understand about how to get this iterator object. How to get ListIterator? ListIterator<E> listIterator(). It returns a list ...
Read more >Chapter 6. Creating custom constraints
To create a custom constraint, the following three steps are required: Create a constraint annotation; Implement a validator; Define a default error message...
Read more >Iterators in Java - GeeksforGeeks
A Java Cursor is an Iterator, which is used to iterate or traverse or retrieve a Collection or Stream object's elements one by...
Read more >python - How to build a basic iterator? - Stack Overflow
This method raises a StopIteration exception when there are no more value to return, which is implicitly captured by looping constructs to stop...
Read more >Frequently Asked Questions - GCC, the GNU Compiler Collection
But there's no way to make that work with C++, where much of the library consists of inline functions and templates, which are...
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

You need to traverse down at the moment, but this part will be reworked in the future.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.