Validation Errors: important additional info isn't provided
Can you rewrite logic about ValidationException handling?
For example, if several invoices will be posted to Xero and one cause validation error, no way to understand which invoice caused the error.
Xero.Api.Infrastructure.Http.XeroHttpClient -> HandleErrors:
var data = JsonMapper.From<ApiException>(response.Body);
Here error response provides detailed information about who and why caused the errors.
But during deserialization it just takes all validation messages and saves them to array without any other really important information.
-
Phil Mulligan commented
you can get this functionality using parameter summarizeErrors=true, but this should be the default handling rather than having to specify it directly
-
Phil Mulligan commented
Checkout the documentation - under the heading Creating many resources ..
https://developer.xero.com/documentation/api/requests-and-responsesThe recommended method for creating Many Resources is
POST /api.xro/2.0/Invoices?summarizeErrors=false
The response then includes all submitted objects, but for each object it will have an additional field for validation_errors.
For objects that have been successfully created/updated it will include the xero id for the object.