Remove usage of MutableValidationReport where possible
Most usages of the MutableValidationReport
can be changed to merge operations (e.g. map/reduce with merge) and use of the ValidationReport#singleton()
factory method.
Ideally we could remove as much of the report mutation as possible.
This may mean some work to make ValidationReport#merge
more efficient - e.g create a view of the merged reports instead of creating a new list to store the messages.
Comments (3)
-
reporter -
reporter Most of the work for this has been done as part of https://bitbucket.org/atlassian/swagger-request-validator/pull-requests/25 (big thanks to @sdoeringNew).
The only usage of
MutableValidationReport
that remain are in theValidationReport
merge operations and theValidationReportFormatterTest
. Issue#35aims to improve the merge operations to avoid the use of theMutableValidationReport
, which will allow this issue to be closed. -
reporter - changed status to resolved
Available in v1.0.16 - thanks to @sdoeringNew
- Log in to comment
Use of the
MutableValidationReport
within a single method is fine. I would like to remove the pattern of passing a mutable report around to collect errors.