Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode strings as JSON in where clauses #1118

Open
dantownsend opened this issue Oct 25, 2024 · 0 comments · May be fixed by #1119
Open

Encode strings as JSON in where clauses #1118

dantownsend opened this issue Oct 25, 2024 · 0 comments · May be fixed by #1119
Labels
bug Something isn't working

Comments

@dantownsend
Copy link
Member

dantownsend commented Oct 25, 2024

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"}').

@dantownsend dantownsend added the bug Something isn't working label Oct 25, 2024
@dantownsend dantownsend added this to Bugs Oct 25, 2024
@github-project-automation github-project-automation bot moved this to Needs triage in Bugs Oct 25, 2024
@dantownsend dantownsend linked a pull request Oct 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Needs triage
Development

Successfully merging a pull request may close this issue.

1 participant