Skip to content

Commit

Permalink
fix: utoipa 使用 schema::Type
Browse files Browse the repository at this point in the history
  • Loading branch information
yangjing committed Aug 29, 2024
1 parent 41a0f41 commit 6a4c997
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions crates/ultimate-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ repository.workspace = true
[lints]
workspace = true

[features]
# default = ["utoipa"]

[dependencies]
ultimate-common.workspace = true
ultimate.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions crates/ultimate-db/src/modql_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ pub fn to_sea_chrono_offset(v: serde_json::Value) -> SeaResult<sea_query::Value>
#[cfg(feature = "utoipa")]
pub fn op_vals_integer_schema() -> utoipa::openapi::Object {
utoipa::openapi::ObjectBuilder::new()
.schema_type(utoipa::openapi::SchemaType::Object)
.schema_type(utoipa::openapi::Type::Object)
.description(Some("opvalfloat64"))
.build()
}

#[cfg(feature = "utoipa")]
pub fn op_vals_string_schema() -> utoipa::openapi::Object {
utoipa::openapi::ObjectBuilder::new()
.schema_type(utoipa::openapi::SchemaType::String)
.schema_type(utoipa::openapi::schema::Type::String)
.description(Some("https://github.com/jeremychone/rust-modql?tab=readme-ov-file#opvalstring-operators"))
.build()
}

#[cfg(feature = "utoipa")]
pub fn op_vals_bool_schema() -> utoipa::openapi::Object {
utoipa::openapi::ObjectBuilder::new()
.schema_type(utoipa::openapi::SchemaType::Boolean)
.schema_type(utoipa::openapi::schema::Type::Boolean)
.description(Some("https://github.com/jeremychone/rust-modql?tab=readme-ov-file#opvalbool-operators"))
.build()
}

0 comments on commit 6a4c997

Please sign in to comment.