Skip to content

Encode strings as JSON in where clauses #1118

Open
@dantownsend

Description

@dantownsend

We just added more powerful JSON filtering, but when integrating it into Piccolo Admin, I realised there's a bug here:

if not isinstance(value, (str, QueryString)):
value = dump_json(value)

We should also encode strings as JSON e.g. 'hello world' -> '"hello world"'. However, if the string is already valid JSON, we should leave it alone (e.g. '{"message": "hello world"}').

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions