From b3f2d1d6345e01bb84e5c33bf790d6410f78b2c4 Mon Sep 17 00:00:00 2001 From: Samyak Sarnayak Date: Tue, 31 Dec 2024 04:19:37 +0530 Subject: [PATCH] fix: conflict with serde deny_unknown_fields attr (#1015) * fix: conflict with serde deny_unknown_fields attr When `#[serde(deny_unknown_fields)]` was used, the compilation failed with: ``` 64 | #[derive(Debug, Serialize, Deserialize, ToSchema)] | ^^^^^^^^ could not find `schema` in `salvo` | = note: this error originates in the derive macro `ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info) ``` * Remove Some --- crates/oapi-macros/src/schema/struct_schemas.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oapi-macros/src/schema/struct_schemas.rs b/crates/oapi-macros/src/schema/struct_schemas.rs index 856334f58..96580fc92 100644 --- a/crates/oapi-macros/src/schema/struct_schemas.rs +++ b/crates/oapi-macros/src/schema/struct_schemas.rs @@ -309,7 +309,7 @@ impl TryToTokens for NamedStructSchema<'_> { .unwrap_or(false) { tokens.extend(quote! { - .additional_properties(Some(#oapi::schema::AdditionalProperties::FreeForm(false))) + .additional_properties(#oapi::oapi::schema::AdditionalProperties::FreeForm(false)) }); }