Skip to content

Commit

Permalink
Add support for camino
Browse files Browse the repository at this point in the history
  • Loading branch information
snaggen authored and tiagolobocastro committed Feb 20, 2025
1 parent bf57e12 commit 1e99747
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ actix3-validator = ["paperclip-core/actix3-validator"]
actix4-validator = ["paperclip-core/actix4-validator"]
chrono = ["paperclip-core/chrono"]
jiff01 = ["paperclip-core/jiff01"]
camino = ["paperclip-core/camino"]
rust_decimal = ["paperclip-core/rust_decimal"]
url = ["paperclip-core/url"]
uuid = ["uuid0","uuid1"]
Expand Down
2 changes: 2 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ actix-web-validator3 = { version = "3.0", optional = true, package = "actix-web-
validator12 = { version = "0.12", features = ["derive"], optional = true, package = "validator" }
validator14 = { version = "0.14", features = ["derive"], optional = true, package = "validator" }
openapiv3-paper = { version = "2.0", optional = true }
camino = { version = "1.1", optional = true }

[features]
# actix-web support
Expand All @@ -49,6 +50,7 @@ actix-base = ["v2", "pin-project-lite"]
actix3-validator = ["actix-web-validator2", "validator12"]
actix4-validator = ["actix-web-validator3", "validator14"]
jiff01 = ["jiff"]
camino = ["dep:camino"]

# Enable nightly if nightly compiler can be allowed
nightly = ["paperclip-macros/nightly"]
Expand Down
6 changes: 6 additions & 0 deletions core/src/v2/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ impl<T: TypedData> TypedData for &T {
impl_type_simple!(char, DataType::String);
impl_type_simple!(String, DataType::String);
impl_type_simple!(PathBuf, DataType::String);
#[cfg(feature = "camino")]
impl_type_simple!(
camino::Utf8PathBuf,
DataType::String,
DataTypeFormat::Binary
);
impl_type_simple!(bool, DataType::Boolean);
impl_type_simple!(f32, DataType::Number, DataTypeFormat::Float);
impl_type_simple!(f64, DataType::Number, DataTypeFormat::Double);
Expand Down

0 comments on commit 1e99747

Please sign in to comment.