Skip to content

Commit

Permalink
Change Option<T> compose to OneOfBuilder
Browse files Browse the repository at this point in the history
This commit change the `Option<T>` compose implementation from
`AllOfBuilder` to `OneOfBuilder`. This comes as follow up for #1135
which changed the `utoipa-gen` side nullable types from `allOf` to
`oneOf`.

Closes #1050 Closes #1135
  • Loading branch information
juhaku committed Oct 15, 2024
1 parent ea498f3 commit d9a3c0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions utoipa/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ to look into changes introduced to **`utoipa-gen`**.
* 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)

### Changed

* Change Option<T> compose to OneOfBuilder (https://github.com/juhaku/utoipa/pull/1141)

## 5.0.0 - Oct 14 2024

### Added
Expand Down
2 changes: 1 addition & 1 deletion utoipa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ pub mod __dev {
fn compose(
schemas: Vec<utoipa::openapi::RefOr<utoipa::openapi::schema::Schema>>,
) -> utoipa::openapi::RefOr<utoipa::openapi::schema::Schema> {
utoipa::openapi::schema::AllOfBuilder::new()
utoipa::openapi::schema::OneOfBuilder::new()
.item(
utoipa::openapi::schema::ObjectBuilder::new()
.schema_type(utoipa::openapi::schema::Type::Null),
Expand Down

0 comments on commit d9a3c0f

Please sign in to comment.