Closed catwell closed 11 months ago
Actually, disregard this. It is just cleaner to define three routes with the same path and a different method rather than passing all three methods to a single route. I am just used to this pattern which does not make sense with quart-schema.
Suppose I have a REST API with an endpoint supporting multiple verbs (for instance GET, PUT and DELETE). The request parameters for those verbs are likely different but Flask and Quart treat them as the same route. How can we deal with this in quart-schema?
One possibility I can see is to use the same kind of mechanism as for
@validate_response
: add an optionalmethods
attribute to the validator and ignore it if the method does not match. That way we can stack multiple validators like with@validate_response
.If there is already another solution to this, please tell me! If not I can try implementing it and making a PR if my solution sounds good to you.