Treat normalized payload validation errors as warnings #5752
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.
Summary
Follow up on #5730
References #5429
References TheThingsNetwork/lorawan-devices#395
cc @pablojimpas
Changes
This changes the way field validation errors are treated. Before, the error was propagated to the caller and the entire payload wouldn't be considered normalized. This means that one out-of-bounds field renders the entire payload invalid. I think this isn't a nice developer experience: we should still not set these fields to out-of-bounds values but we should accept the rest of the fields and set the errors as warnings.
There's also a small unrelated change to see the
normalized_payload{_warnings}
in the payload simulation view.Testing
CI and simulated uplink:
Regressions
None expected
Notes for Reviewers
Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.