Skip to content

Session hooks are not called #116

@FelixSchwarz

Description

@FelixSchwarz

When I create an OpenAPI client like this:

api = OpenAPI(spec, use_session=True, session_factory=MySession)

then any hooks that MySession might use are not called.

The bug is caused because paths.py calls .prepare() on the request so the session never comes into play:

result = session.send(self._request.prepare(), verify=verify)

The correct approach is to call session.prepare_request(self._request).

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