Skip to content

Integration conflict with NestJS interceptors #8

Description

@francescobianco

🧩 Integration conflict with NestJS interceptors

Labels: bug, nestjs, middleware
Framework context: NestJS with global interceptors (e.g., LoggingInterceptor, CacheInterceptor)

Description:
When the Openapi SDK is used inside a NestJS provider or service, global interceptors fail to intercept outbound requests.
This happens because the SDK overrides the internal Axios instance, bypassing Nest’s dependency injection and middleware hooks.

Workaround:
Manually wrap SDK calls in a custom Axios adapter — cumbersome and breaks the standard NestJS DI pattern.

Proposal:
Allow injection of a custom axios instance during initialization:

Openapi.configure({ httpClient: myAxiosInstance });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnestjs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions