Skip to content

Commit

Permalink
Merge branch 'GREsau:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
s-fabian authored Nov 16, 2023
2 parents 195a475 + e04e3a3 commit ebff57e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [0.8.16] - 2023-11-11

### Fixed:

- Reduce size of MIR output (and improve release-mode compile time) when deriving `JsonSchema`

## [0.8.15] - 2023-09-17

### Added:
Expand Down
4 changes: 2 additions & 2 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.15"
version = "0.8.16"
authors = ["Graham Esau <gesau@hotmail.co.uk>"]
edition = "2021"
license = "MIT"
Expand All @@ -14,7 +14,7 @@ build = "build.rs"
rust-version = "1.60"

[dependencies]
schemars_derive = { version = "=0.8.15", optional = true, path = "../schemars_derive" }
schemars_derive = { version = "=0.8.16", optional = true, path = "../schemars_derive" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.25"
dyn-clone = "1.0"
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.15"
version = "0.8.16"
authors = ["Graham Esau <gesau@hotmail.co.uk>"]
edition = "2021"
license = "MIT"
Expand Down
7 changes: 4 additions & 3 deletions schemars_derive/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ impl<'a> SchemaMetadata<'a> {
pub fn apply_to_schema(&self, schema_expr: &mut TokenStream) {
let setters = self.make_setters();
if !setters.is_empty() {
*schema_expr = quote! {
schemars::_private::apply_metadata(#schema_expr, schemars::schema::Metadata {
*schema_expr = quote! {{
let schema = #schema_expr;
schemars::_private::apply_metadata(schema, schemars::schema::Metadata {
#(#setters)*
..Default::default()
})
}
}}
}
}

Expand Down

0 comments on commit ebff57e

Please sign in to comment.