Skip to content

Commit

Permalink
Merge branch 'master' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
GREsau authored May 23, 2024
2 parents 1247b89 + 5e20a37 commit 25aca66
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [0.8.21] - 2024-05-23

### Fixed:

- Fix `null` default not being set on generated schemas (https://github.com/GREsau/schemars/issues/295 / https://github.com/GREsau/schemars/pull/296)

## [0.8.20] - 2024-05-18

### Fixed:

- Revert unintentional change in behaviour when combining `default` and `required` attributes (https://github.com/GREsau/schemars/issues/292)

## [0.8.19] - 2024-05-06

### Fixed:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions schemars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "schemars"
description = "Generate JSON Schemas from Rust code"
homepage = "https://graham.cool/schemars/"
repository = "https://github.com/GREsau/schemars"
version = "0.8.19"
version = "0.8.21"
authors = ["Graham Esau <gesau@hotmail.co.uk>"]
edition = "2021"
license = "MIT"
Expand All @@ -14,8 +14,8 @@ build = "build.rs"
rust-version = "1.60"

[dependencies]
schemars_derive = { version = "=0.8.19", optional = true, path = "../schemars_derive" }
serde = "1.0"
schemars_derive = { version = "=0.8.21", optional = true, path = "../schemars_derive" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.25"
dyn-clone = "1.0"
ref-cast = "1.0.22"
Expand Down
1 change: 1 addition & 0 deletions schemars/tests/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ where
struct MyStruct {
my_int: i32,
my_bool: bool,
my_optional_string: Option<String>,
#[serde(serialize_with = "custom_serialize")]
my_struct2: MyStruct2,
#[serde(
Expand Down
7 changes: 7 additions & 0 deletions schemars/tests/expected/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
"type": "boolean",
"default": false
},
"my_optional_string": {
"default": null,
"type": [
"string",
"null"
]
},
"my_struct2": {
"$ref": "#/$defs/MyStruct2",
"default": "i:0 b:false"
Expand Down
2 changes: 1 addition & 1 deletion schemars_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "schemars_derive"
description = "Macros for #[derive(JsonSchema)], for use with schemars"
homepage = "https://graham.cool/schemars/"
repository = "https://github.com/GREsau/schemars"
version = "0.8.19"
version = "0.8.21"
authors = ["Graham Esau <gesau@hotmail.co.uk>"]
edition = "2021"
license = "MIT"
Expand Down

0 comments on commit 25aca66

Please sign in to comment.