Problem with commas in filter value when using field[in]=value
I'm running into an issue where filter values that contain commas (,) are not being parsed correctly.
Specifically, if I use a filter value with a comma by itself, it doesn't get parsed as expected:
However, if I add another filter (one that doesn't contain a comma), then the original filter with the comma is parsed correctly:
Here's what the FastAPI server logs show:
Is there a workaround for this issue?
Hi @uriyyo, I can see that you've assigned the question label. Do you need any further information on this?
Hi @vkuzmov,
Sorry for long response, I didn't thought about this use-case while I was implementing this feature.
For now you can just pass every value as a separate main_industry[in] query param, and FastAPI should correctly resolve it:
GET / endpoint?main_industry[in]=1&main_industry[in]=2&main_industry[in]=3
Let me know if it helped you 🙏
Scalar values work well, but issues arise when the value is a string that contains a comma. To work around this, I'm currently using slugs for industry names, like so:
GET / endpoint?main_industry[in]=agriculture-forestry-and-fishing&main_industry[in]=healthcare-and-pharmaceuticals
@vkuzmov Unfortunately, there is no workaroud for now, I will try to fix this issue ASAP