Skip to content

Allow returning schema instances from endpoints without revalidating them #1669

@maxhollmann

Description

@maxhollmann

Is your feature request related to a problem? Please describe.
We have some endpoints where it would make sense to construct the return schema instance inside the endpoint and return that instead of returning some other object that gets transformed through the schema. Currently, if an endpoint returns a schema instance, that instance will be validated using the endpoint's response schema into a second instance before being returned as JSON.

Describe the solution you'd like
Skip the transformation if the object returned by an endpoint is already of the endpoint's response type. Or maybe add an explicit flag to the endpoint decorators to force this behavior.

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