diff --git a/CHANGELOG.md b/CHANGELOG.md index 89a9ace..0235731 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ # Changelog -## [0.6.2] - TBD +## [0.6.2] - 2019-12-27 ### Added: - Documentation website available at https://graham.cool/schemars/! ### Changed: - Rename `derive_json_schema` to `impl_json_schema`. `derive_json_schema` is still available for backward-compatibility, but will be removed in a future version. - Improve schema naming for deriving on remote types. A `#[serde(remote = "Duration")]` attribute is now treated similarly to `#[serde(rename = "Duration")]`. +- Ensure root schemas do not have a `$ref` property. If necessary, wrap the `$ref` in an `allOf`. ## [0.6.1] - 2019-12-09 ### Fixed: diff --git a/docs/3-generating.md b/docs/3-generating.md index d356d9b..f5c2d83 100644 --- a/docs/3-generating.md +++ b/docs/3-generating.md @@ -15,8 +15,8 @@ let my_schema = schema_for!(MyStruct); This will create a schema that conforms to [JSON Schema Draft 7](https://json-schema.org/specification-links.html#draft-7), but this is liable to change in a future version of Schemars if support for other JSON Schema versions is added. If you want more control over how the schema is generated, you can use the [`gen` module](https://docs.rs/schemars/latest/schemars/gen/). There are two main types in this module: -* [`SchemaSettings`](https://docs.rs/schemars/0.6.1/schemars/gen/struct.SchemaSettings.html), which defines what JSON Schema features should be used when generating schemas (for example, how `Option`s should be represented). -* [`SchemaGenerator`](https://docs.rs/schemars/0.6.1/schemars/gen/struct.SchemaGenerator.html), which manages the generation of a schema document. +* [`SchemaSettings`](https://docs.rs/schemars/latest/schemars/gen/struct.SchemaSettings.html), which defines what JSON Schema features should be used when generating schemas (for example, how `Option`s should be represented). +* [`SchemaGenerator`](https://docs.rs/schemars/latest/schemars/gen/struct.SchemaGenerator.html), which manages the generation of a schema document. See the API documentation for more info on how to use those types for custom schema generation. diff --git a/schemars/Cargo.toml b/schemars/Cargo.toml index d2d0013..bd35e42 100644 --- a/schemars/Cargo.toml +++ b/schemars/Cargo.toml @@ -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.6.1" +version = "0.6.2" authors = ["Graham Esau "] edition = "2018" license = "MIT" @@ -13,7 +13,7 @@ categories = ["encoding"] build = "build.rs" [dependencies] -schemars_derive = { version = "=0.6.1", path = "../schemars_derive" } +schemars_derive = { version = "=0.6.2", path = "../schemars_derive" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" chrono = { version = "0.4", default-features = false, optional = true } diff --git a/schemars_derive/Cargo.toml b/schemars_derive/Cargo.toml index bf6a598..263e4e9 100644 --- a/schemars_derive/Cargo.toml +++ b/schemars_derive/Cargo.toml @@ -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.6.1" +version = "0.6.2" authors = ["Graham Esau "] edition = "2018" license = "MIT"