diff --git a/Cargo.toml b/Cargo.toml index f71655529..f9ca6c23c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,20 +18,20 @@ include = ["src/**/*", "LICENSE", "crates-io.md"] [features] chrono = ["chrono04"] -indexmap = ["indexmap2"] +indexmap = ["indexmap1"] linked-hash-map = ["linked-hash-map05"] time = ["time03"] uuid = ["uuid08", "uuid1"] [dependencies] -indexmap = "1.7" +indexmap = "2.0" openapi_type_derive = { path = "./derive", version = "0.4.4" } -openapiv3 = "=1.0.2" +openapiv3 = "=2.0.0" serde_json = "1.0" # optional dependencies / features chrono04 = { package = "chrono", version = "0.4", default-features = false, optional = true } -indexmap2 = { package = "indexmap", version = "2.0", optional = true } +indexmap1 = { package = "indexmap", version = "1.0", optional = true } 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 } diff --git a/src/impls.rs b/src/impls.rs index 45574f387..b33a78528 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -251,9 +251,9 @@ map! { IndexMap(V); } -#[cfg(feature = "indexmap2")] +#[cfg(feature = "indexmap1")] map! { - indexmap2::IndexMap(V); + indexmap1::IndexMap(V); } #[cfg(feature = "linked-hash-map05")] diff --git a/src/visitor/openapi.rs b/src/visitor/openapi.rs index 9ff462df4..203f7d353 100644 --- a/src/visitor/openapi.rs +++ b/src/visitor/openapi.rs @@ -1,8 +1,8 @@ use super::{never::Never, seal, AlternativesVisitor, ObjectVisitor, Visitor}; use indexmap::{map::Entry, IndexMap}; use openapiv3::{ - AdditionalProperties, ArrayType, IntegerFormat, IntegerType, NumberFormat, NumberType, ObjectType, ReferenceOr, Schema, - SchemaData, SchemaKind, StringFormat, StringType, Type, VariantOrUnknownOrEmpty + AdditionalProperties, ArrayType, BooleanType, IntegerFormat, IntegerType, NumberFormat, NumberType, ObjectType, + ReferenceOr, Schema, SchemaData, SchemaKind, StringFormat, StringType, Type, VariantOrUnknownOrEmpty }; use std::fmt::Display; @@ -140,7 +140,7 @@ impl OpenapiVisitor { Self::Bool => Some(OpenapiSchema::new(Schema { schema_data: Default::default(), - schema_kind: SchemaKind::Type(Type::Boolean {}) + schema_kind: SchemaKind::Type(Type::Boolean(BooleanType::default())) })), Self::Int { byte, minimum } => Some(OpenapiSchema::new(Schema {