Skip to content

Commit

Permalink
fix: conflict with serde deny_unknown_fields attr (#1015)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Samyak2 authored Dec 30, 2024
1 parent 378e6a4 commit b3f2d1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oapi-macros/src/schema/struct_schemas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
});
}

Expand Down

0 comments on commit b3f2d1d

Please sign in to comment.