This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
Fix unhandled error when match_all/match_any format is incorrect #978
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.
Issue/Task Number: #975
Closes #975
Overview
Fixes the internal server error returned when the provided with an invalid
match_all
/match_any
filter attributes.Changes
MatchParser
rejects filter attributes that are invalid (i.e. not in a list).:missing_filter_param
error description to"Invalid parameter provided. Expecting an array of filter parameters."
for clarityImplementation Details
Server was crashing because
Enum.reduce_while/3
could be enumerated both over a list or a map. Since the expected value is a list, but a map could easily be mistaken (using only 1 set of filter, passed that set without wrapping in a list), this will be caught now before being handled.Did this instead of supporting a single filter without list to keep the API consistent.
Usage
Request:
Response:
Impact
No changes to DB schema or API specs.