I've noticed that Actix-specific components like Either are being used outside the scope of the actix feature flag, which could lead to issues in non-Actix environments where the feature is not enabled.
#[cfg(feature = "actix")]
use crate::{PathItemDefinition, ResponseWrapper};
use actix_web::Either;
The Either type is used without proper feature gating.
Expected Behavior:
Actix-specific imports and types should be guarded by the appropriate #[cfg(feature = "actix")] to ensure compatibility with non-Actix environments.
Steps to Reproduce:
Try to compile apistos-core without the actix feature enabled, and errors related to actix_web::Either will occur.
Proposed Solution:
Wrap all Actix-related imports and code with #[cfg(feature = "actix")] to ensure they are only included when the feature is enabled.
I've noticed that Actix-specific components like
Either
are being used outside the scope of theactix
feature flag, which could lead to issues in non-Actix environments where the feature is not enabled.For instance, in this snippet from this file:
The
Either
type is used without proper feature gating.Expected Behavior:
Actix-specific imports and types should be guarded by the appropriate
#[cfg(feature = "actix")]
to ensure compatibility with non-Actix environments.Steps to Reproduce:
Try to compile
apistos-core
without theactix
feature enabled, and errors related toactix_web::Either
will occur.Proposed Solution:
Wrap all Actix-related imports and code with
#[cfg(feature = "actix")]
to ensure they are only included when the feature is enabled.