Closed uris77 closed 12 years ago
Good,Your pull request is useful,but the method name "renderErrorsAsMap" is confused.
May be it's good to use "renderErrorsWithMap" or use polymorphic that use the same name "renderErrors".
I agree, I realized that last night. I'm thinking of refactoring it out unto a class of its own so I can test it. Was also thinking of a name like : renderMapAsErrors. Suggestions are welcome.
The name "renderMapAsErrors" is good and refactoring it out unto a class of its own also a good idea.
Cheers
In a Composer, it is now possible to do: self.renderErrorsAsMap(bean:map) This does the same as renderErrors, but instead of taking domain class, it takes a list of maps. The map is structured as follows: [field: field, error: error]. This is useful whenever one is using an api that returns json , or a map.