This commit is contained in:
Graham Esau 2019-12-09 21:06:44 +00:00
parent 3fb625e08c
commit 351ff1572a
4 changed files with 7 additions and 7 deletions

View file

@ -1,15 +1,15 @@
# Changelog # Changelog
## [0.6.0] - TBD ## [0.6.0] - 2019-12-09
### Added: ### Added:
- When deriving `JsonSchema`, the schema's `title` and `description` are now set from `#[doc]` comments (https://github.com/GREsau/schemars/issues/7) - When deriving `JsonSchema`, the schema's `title` and `description` are now set from `#[doc]` comments (https://github.com/GREsau/schemars/issues/7)
- When deriving `JsonSchema` on structs using a `#[serde(default)]` attribute, the schema's properties will now include `default` whenever the default is not null (https://github.com/GREsau/schemars/issues/6) - When deriving `JsonSchema` on structs using a `#[serde(default)]` attribute, the schema's properties will now include `default`, unless the default value is skipped by the field's `skip_serializing_if` function (https://github.com/GREsau/schemars/issues/6)
### Changed: ### Changed:
- When the `option_nullable` setting is enabled (e.g. for openapi 3), schemas for `Option<T>` will no longer inline `T`'s schema when it should be referenceable. - When the `option_nullable` setting is enabled (e.g. for openapi 3), schemas for `Option<T>` will no longer inline `T`'s schema when it should be referenceable.
## [0.5.1] - 2019-10-30 ## [0.5.1] - 2019-10-30
### Fixed: ### Fixed:
- Added missing doc comment for "title" schema property - Added missing doc comment for `title` schema property
## [0.5.0] - 2019-10-30 ## [0.5.0] - 2019-10-30
### Added: ### Added:

View file

@ -2,7 +2,7 @@
name = "schemars" name = "schemars"
description = "Generate JSON Schemas from Rust code" description = "Generate JSON Schemas from Rust code"
repository = "https://github.com/GREsau/schemars" repository = "https://github.com/GREsau/schemars"
version = "0.6.0-alpha-2" version = "0.6.0"
authors = ["Graham Esau <gesau@hotmail.co.uk>"] authors = ["Graham Esau <gesau@hotmail.co.uk>"]
edition = "2018" edition = "2018"
license = "MIT" license = "MIT"
@ -12,7 +12,7 @@ categories = ["encoding"]
build = "build.rs" build = "build.rs"
[dependencies] [dependencies]
schemars_derive = { version = "0.6.0-alpha-2", path = "../schemars_derive" } schemars_derive = { version = "0.6.0", path = "../schemars_derive" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
chrono = { version = "0.4", default-features = false, optional = true } chrono = { version = "0.4", default-features = false, optional = true }

View file

@ -2,7 +2,7 @@
name = "schemars_derive" name = "schemars_derive"
description = "Macros for #[derive(JsonSchema)], for use with schemars" description = "Macros for #[derive(JsonSchema)], for use with schemars"
repository = "https://github.com/GREsau/schemars" repository = "https://github.com/GREsau/schemars"
version = "0.6.0-alpha-2" version = "0.6.0"
authors = ["Graham Esau <gesau@hotmail.co.uk>"] authors = ["Graham Esau <gesau@hotmail.co.uk>"]
edition = "2018" edition = "2018"
license = "MIT" license = "MIT"

View file

@ -12,7 +12,7 @@ pub fn get_with_from_attrs(field: &syn::Field) -> Option<syn::Result<syn::ExprPa
.attrs .attrs
.iter() .iter()
.filter(|at| match at.path.get_ident() { .filter(|at| match at.path.get_ident() {
// FIXME this is relying on order of attributes (schemars before serde) from preprocess.rs // FIXME this is relying on order of attributes (schemars before serde) from schemars_to_serde.rs
Some(i) => i == "schemars" || i == "serde", Some(i) => i == "schemars" || i == "serde",
None => false, None => false,
}) })