flask-smorest
flask-smorest copied to clipboard
Handling multiple dynamic nested query parameters in Flask-Smorest
Context
I'm trying to handle multiple dynamic filters in query parameters with Flask-Smorest. The query string looks like this:
filters[status][0]=value1&filters[status][1]=value2&filters[type][0]=valueA
Question
What's the recommended way in Flask-Smorest to handle this type of query parameters without manually parsing request.args? Specifically:
- Is there a built-in method to automatically parse these into a nested dictionary or list structure?
- Can we configure a schema to handle this pattern of parameters?
- What's the most idiomatic approach in Flask-Smorest for this scenario?
Desired Outcome
Ideally, I'd like to end up with a structure like this:
{
"filters": {
"status": ["value1", "value2"],
"type": ["valueA"]
}
}
Any insights or best practices for handling such dynamic, nested query parameters in Flask-Smorest would be greatly appreciated.