diff --git a/Cargo.toml b/Cargo.toml index c32b8b6e6..b08918289 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ include = ["src/**/*", "LICENSE", "crates-io.md"] chrono = ["chrono04"] linked-hash-map = ["linked-hash-map05"] time = ["time03"] -uuid = ["uuid08"] +uuid = ["uuid08", "uuid1"] [dependencies] indexmap = "1.7" @@ -33,6 +33,7 @@ chrono04 = { package = "chrono", version = "0.4", default-features = false, opti linked-hash-map05 = { package = "linked-hash-map", version = "0.5", optional = true } time03 = { package = "time", version = "0.3", features = ["serde-human-readable"], optional = true } uuid08 = { package = "uuid", version = "0.8", optional = true } +uuid1 = { package = "uuid", version = "1", optional = true } [dev-dependencies] paste = "1.0" diff --git a/src/impls.rs b/src/impls.rs index 5a305617c..20c5c8025 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -119,6 +119,13 @@ impl OpenapiType for uuid08::Uuid { } } +#[cfg(feature = "uuid1")] +impl OpenapiType for uuid1::Uuid { + fn visit_type(visitor: &mut V) { + visitor.visit_uuid(); + } +} + //////////////////////////////////////////////////////////////////////////////// #[cfg(any(feature = "time03", feature = "chrono04"))] diff --git a/tests/std_types.rs b/tests/std_types.rs index 12a0bbf77..9a03a9a35 100644 --- a/tests/std_types.rs +++ b/tests/std_types.rs @@ -165,6 +165,12 @@ test_type!(uuid08::Uuid = { "format": "uuid" }); +#[cfg(feature = "uuid1")] +test_type!(uuid1::Uuid = { + "type": "string", + "format": "uuid" +}); + // ### date/time #[cfg(feature = "chrono04")]