support new and improved error messages introduced in Ed-Fi API 7.2 #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements support for the new-and-improved error messages introduced in Ed-Fi API 7.2.
Previously, POSTing an invalid payload to an Ed-Fi API endpoint would result in a response like
(usually only the first encountered error is reported, even though the payload may have multiple issues)
In 7.2, a new error response format was introduced, like
(multiple errors can be reported for a single POSTed payload)
Since
lightbeam
was previously looking only for the keymessages
in an error response payload, it would fail with an error on 7.2+ APIs.This PR keeps support for the old error format and adds support for the new format. The main thing that's impacted is the
--results-file
: whereas previously it would report at most one error per file line-number:now it will be possible (when communicating with a 7.2+ API) to get multiple errors per single line of a file:
I think this makes sense, but am open to feedback/concerns.
The edu_data_quality_monitoring package unpacks this results-file format; I looked at it and it doesn't seem like this
lightbeam
change will affect that, but I could be wrong. @rlittle08 could perhaps confirm this change won't break the EDU package?I've tested this against Ed-Fi API versions 5.3, 6.0, 7.0, 7.1, 7.2, and 7.3; all worked with no errors.