openverse-api icon indicating copy to clipboard operation
openverse-api copied to clipboard

The mature filter is not working

Open obulat opened this issue 3 years ago • 1 comments

Description

Search for something setting the mature filter to true, e.g.: https://api-dev.openverse.engineering/v1/images/?q=car&mature=true This returns items that have mature=false in them.

Additional context

The check for mature parameter being a boolean works correctly. When I use mature as the value for mature query parameter, it returns an error:

GET /v1/images/?q=car&mature=mature

HTTP 400 Bad Request
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
    "detail": {
        "mature": [
            "Must be a valid boolean."
        ]
    }
}


Resolution

  • [ ] 🙋 I would be interested in resolving this bug.

obulat avatar Jun 14 '22 15:06 obulat

The mature filter isn't meant to only show mature images, just include them. So mature results would contain results that are true and false, I think? We have very few images on the API side actually flagged as mature, so I'm not confident how to test this.

zackkrida avatar Jun 14 '22 19:06 zackkrida