Skip to content

Responses at router level #1510

@Muizzyranking

Description

@Muizzyranking

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I do not know if this is a feature, but I looked around and it doesn't seem like there is a way to add response schemas at the router level.
Let say I have a router that has auth set, by default, by implication, if the endpoint was visited by user without authentication, then there would be some sort of unauthorized response. I created a schema for this response but now, I have to add it to all endpoints for documentation.

Describe the solution you'd like
A clear and concise description of what you want to happen.
I would love if the Router() has response option just like the HTTP methods so it add those responses and it can be overridden at endpoint level.

Pardon my choice of words.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions