Skip to content

Commit

Permalink
Make code compile with schemars_0_8/preserve_order enabled (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbb authored Jul 3, 2024
2 parents 2274dd1 + 4c8c2db commit 19bfe18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions serde_with/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

* Fix compile issues when dependency `schemars_0_8` is used with the `preserve_order` features (#762)

## [3.8.2] - 2024-06-30

### Changed
Expand Down
6 changes: 2 additions & 4 deletions serde_with/src/schemars_0_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,8 @@ where

let properties = &mut object.object().properties;
for schema in one_of {
let mut schema = schema.into_object();

if let Some(object) = &mut schema.object {
properties.append(&mut object.properties);
if let Some(object) = schema.into_object().object {
properties.extend(object.properties.into_iter());
}
}

Expand Down

0 comments on commit 19bfe18

Please sign in to comment.