Skip to content

Conversation

@mhamid3d
Copy link

@mhamid3d mhamid3d commented Mar 5, 2025

FastAPI does not natively support comma separated lists in query parameters. Instead, lists are ingested via repeating key patterns. Forcing comma separated lists also breaks docs and schemas. It is preferred to be consistent with how FastAPI natively handles lists.

In order for FastAPI to parse a field as a list, it must be either annotated with a Query or have its default value be a Query. We can do this in FilterDepends. Checking for Union types is no longer needed and splitting comma string is no longer needed.

@netlify
Copy link

netlify bot commented Mar 5, 2025

Deploy Preview for fastapi-filter ready!

Name Link
🔨 Latest commit 704992e
🔍 Latest deploy log https://app.netlify.com/sites/fastapi-filter/deploys/67c86bd00c87550008385b0b
😎 Deploy Preview https://deploy-preview-620--fastapi-filter.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mhamid3d
Copy link
Author

mhamid3d commented Mar 6, 2025

As this will not pass checks because of tests are using comma separated strings, I will just leave this PR as a reference in case the future maintainer needs a hint on how to support native python lists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant