Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

API crahes upon queries with empty parts #407

@hermannsblum

Description

@hermannsblum

The API crahes in case that a where query contains an empty part, e.g. where={"$and":[{"$or":[]},{"group":"5ac933284db3bd0001e9f2a9"}]}. The same query succeeds if the part {"$or":[]} is removed.

Easier query to reproduce (no auth required):

https://api-dev.amiv.ethz.ch/events?where=%7B%22%24and%22%3A%5B%7B%22%24or%22%3A%5B%5D%7D%2C%7B%22_id%22%3A%225b042d6f872eae0001b459d6%22%7D%5D%7D

vs

https://api-dev.amiv.ethz.ch/events?where=%7B%22%24and%22%3A%5B%7B%22_id%22%3A%225b042d6f872eae0001b459d6%22%7D%5D%7D

The expected behaviour should be that the query returns a 4xx error code because it is ill defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions