Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Invalid filter comparison parameters do not generate InvalidRequest #78

Copy link
Copy link
@tjchambers

Description

@tjchambers
Issue body actions

By experimentation I have determined that an invalid filter comparison parameter is ignored without warning. The result is that the filter that was intended is not applied without notice to the client.

Example:

c = BlockScore::Person.all('create_at[gt]' => Time.now.to_i+1)

should in fact return an empty array. However it returns most recent 25 Persons because the create_at should be created_at. This could leave the impression that interface code is working when in fact it is NOT.

Note that this is in contrast to mistyping the actual comparison operator:

c = BlockScore::Person.all('created_at[gtx]' => Time.now.to_i+1)
BlockScore::InvalidRequestError: (Type: invalid_request_error) Received unknown filter directive: gtx (gtx) (Status: 400)

which DOES return a suitable message.

...and in contrast to bad filter parameters

c = BlockScore::Person.all('filter[name_second]' => 'valid')
BlockScore::InvalidRequestError: (Type: invalid_request_error) Received unknown filter parameter: name_second (name_second) (Status: 400)

which are acknowledged as invalid properly.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.