From 260cd992935e049f3fad35b791fe1578d74e0aa7 Mon Sep 17 00:00:00 2001 From: Graham Esau Date: Sun, 7 Jun 2020 22:33:57 +0100 Subject: [PATCH] v0.8.0-alpha-2 --- CHANGELOG.md | 3 ++- README.md | 1 + docs/4-features.md | 1 + schemars/Cargo.toml | 4 ++-- schemars/src/lib.rs | 2 +- schemars_derive/Cargo.toml | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e35cb7..a8f3a75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Changelog -## In-dev - version TBC +## **In-dev** - [0.8.0] ### Added: - `visit::Visitor`, a trait for updating a schema and all schemas it contains recursively. A `SchemaSettings` can now contain a list of visitors. - `into_object()` method added to `Schema` as a shortcut for `into::()` +- Preserve order of schema properties under `preserve_order` feature flag (https://github.com/GREsau/schemars/issues/32) ### Removed (**BREAKING CHANGES**): - `SchemaSettings::bool_schemas` - this has been superseded by the `ReplaceBoolSchemas` visitor diff --git a/README.md b/README.md index 750ea48..7f57132 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,7 @@ fn main() { ## Feature Flags - `derive` (enabled by default) - provides `#[derive(JsonSchema)]` macro - `impl_json_schema` - implements `JsonSchema` for Schemars types themselves +- `preserve_order` - keep the order of struct fields in `Schema` and `SchemaObject` ## Optional Dependencies Schemars can implement `JsonSchema` on types from several popular crates, enabled via optional dependencies (dependency versions are shown in brackets): diff --git a/docs/4-features.md b/docs/4-features.md index 6bfee2f..010195c 100644 --- a/docs/4-features.md +++ b/docs/4-features.md @@ -16,6 +16,7 @@ schemars = { version = "0.6", features = ["chrono"] } ## Feature Flags - `derive` (enabled by default) - provides `#[derive(JsonSchema)]` macro - `impl_json_schema` - implements `JsonSchema` for Schemars types themselves +- `preserve_order` - keep the order of struct fields in `Schema` and `SchemaObject` ## Optional Dependencies Schemars can implement `JsonSchema` on types from several popular crates, enabled via optional dependencies (dependency versions are shown in brackets): diff --git a/schemars/Cargo.toml b/schemars/Cargo.toml index cb727c9..f3052ed 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.7.6" +version = "0.8.0-alpha-2" authors = ["Graham Esau "] edition = "2018" license = "MIT" @@ -13,7 +13,7 @@ categories = ["encoding"] build = "build.rs" [dependencies] -schemars_derive = { version = "=0.7.6", optional = true, path = "../schemars_derive" } +schemars_derive = { version = "=0.8.0-alpha-2", optional = true, path = "../schemars_derive" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" dyn-clone = "1.0" diff --git a/schemars/src/lib.rs b/schemars/src/lib.rs index cd2e068..c81f051 100644 --- a/schemars/src/lib.rs +++ b/schemars/src/lib.rs @@ -199,7 +199,7 @@ fn main() { ## Feature Flags - `derive` (enabled by default) - provides `#[derive(JsonSchema)]` macro. - `impl_json_schema` - implements `JsonSchema` for Schemars types themselves. -- `preserve_order` - keep the order of structure fields in `Schema` and `SchemaObject`. +- `preserve_order` - keep the order of struct fields in `Schema` and `SchemaObject` ## Optional Dependencies Schemars can implement `JsonSchema` on types from several popular crates, enabled via optional dependencies (dependency versions are shown in brackets): diff --git a/schemars_derive/Cargo.toml b/schemars_derive/Cargo.toml index ad4433c..499429e 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.7.6" +version = "0.8.0-alpha-2" authors = ["Graham Esau "] edition = "2018" license = "MIT"