poem-web / poem

A full-featured and easy-to-use web framework with the Rust programming language.
Apache License 2.0
3.49k stars 283 forks source link

In poem_openapi, allow a Query to have additional parameters #787

Open miniluz opened 5 months ago

miniluz commented 5 months ago

I'm trying to implement an OAuth 2.0 compliant authorization server, and for one of the endpoints you should return a 308 permanent redirect to an URL with the same query that was sent in (maybe changing the values of a few of them).

Is there an "additional parameters" option for a Query or a way to get those additional parameters? Is there a way to make Query reject queries that have repeated keys? Is there a way to turn the query into a String?

I'm assuming not, and that I'd need to make a new query struct myself. Would this be possible at all? What traits would I need to implement for it to be usable in place of poem_api::param::Query (or poem::web::Query)?

miniluz commented 5 months ago

I have figured out a lot. I'm pretty sure those options don't exist, and I'd just need to write a parser myself and implement a method to turn it into a string.

miniluz commented 5 months ago

How could I make sure that it was still is all documented under OpenAPI?