diff --git a/utoipa/CHANGELOG.md b/utoipa/CHANGELOG.md index 55960c95..77b43bdb 100644 --- a/utoipa/CHANGELOG.md +++ b/utoipa/CHANGELOG.md @@ -8,6 +8,7 @@ to look into changes introduced to **`utoipa-gen`**. ### Added * Implement schema traits for indexset (https://github.com/juhaku/utoipa/pull/1129) +* Add `ToSchema` implementation for serde_json::Value (https://github.com/juhaku/utoipa/pull/1132) ## 5.0.0 - Oct 14 2024 diff --git a/utoipa/src/lib.rs b/utoipa/src/lib.rs index 49a24fcc..766a43c6 100644 --- a/utoipa/src/lib.rs +++ b/utoipa/src/lib.rs @@ -779,6 +779,16 @@ where } } +impl PartialSchema for serde_json::Value { + fn schema() -> openapi::RefOr { + utoipa::openapi::schema::Object::builder() + .schema_type(utoipa::openapi::schema::SchemaType::AnyValue) + .into() + } +} + +impl ToSchema for serde_json::Value {} + // Create `utoipa` module so we can use `utoipa-gen` directly from `utoipa` crate. // ONLY for internal use! #[doc(hidden)]