Skip to content

response for "Try it out" in docs #567

@valpesendorfer

Description

@valpesendorfer

Description
Hi,

I'm creating an API where authenticated users can trigger a processing chain. The chain requires an input which is provided by the user in the request body.

I'm wondering if there's a way to check if a request has been made through the doc interface via the "Try it out" feature. This way I could return a pre-defined response instead of triggering the chain (which will most likely end in an exception).

I could check the body for the default arguments I've defined and detect it this way. However, that seems a bit hacky, so I hope there's some functionality within FastAPI I could use for that purpose.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions