note: This question is different than what is asked here, in that I need it to work with swagger.
Given a FastAPI GET endpoint, I want to allow any arbitrary set of url parameters while maintaining swagger support.
My use case is that I want to support a Json:API like set of query parameters such as
/api/books/?include=author&sort=name,zip&sort[author]=-lname&fields=name,phone,street
The use of square brackets prevents me from using traditional classes to model query parameters, so I'm directly using the Request object instead. However, I would like to use swagger to test the endpoint. I can't find a way to provide arbitrary url parameters. I'm happy to type them in as a single string.
One would think something like the following;
def books(**params):
....
That gives a curl statement of;
api/books?params=sort%5Bone%5D%3Dtwo'
what I really want is;
api/books?sort&one%5D%3Dtwo'