From 3271fbd96a65c0d15e1cc5d5391810842cae0c28 Mon Sep 17 00:00:00 2001 From: Graham Esau Date: Mon, 27 May 2024 15:16:19 +0100 Subject: [PATCH] Update changelog for 1.0.0-alpha.1 --- CHANGELOG.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59eb3ea0..062282f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,61 @@ # Changelog +## [1.0.0-alpha.1] - 2024-05-27 + +### Added + +- `json_schema!` macro for creating a custom `Schema` +- Implement `JsonSchema` for [uuid](https://crates.io/crates/uuid) 1.x types, under the optional `uuid1` feature flag +- `SchemaSettings::draft2020_12()` to construct settings conforming to [JSON Schema draft 2020-12](https://json-schema.org/draft/2020-12/release-notes) + +### Changed (_⚠️ breaking changes ⚠️_) + +- The `Schema` type is now defined as a thin wrapper around a `serde_json::Value` +- The default `SchemaSettings` (used by the `schema_for!()`/`schema_for_value!()` macros and `SchemaGenerator::default()`) now conform to JSON Schema draft 2020-12 instead of draft 7. +- Schemas generated using `SchemaSettings::draft2019_09()` (and `draft2020_12()` and `default()`) now use `$defs` instead of `definitions`. While using `definitions` is allowed by the spec, `$defs` is the preferred property for storing reusable schemas. +- `JsonSchema::schema_name()` now returns `Cow<'static, str>` instead of `String` +- `JsonSchema::is_referenceable()` has been removed, and replaced with the more clearly-named `JsonSchema::always_inline()` (which should returns the **opposite** value to what `is_referenceable` returned!) +- The `SchemaGenerator.definitions` field is now a `serde_json::Map` +- Macros/functions that previously returned a `RootSchema` now return a `Schema` instead +- All optional dependencies are now suffixed by their version: + - `chrono` is now `chrono04` + - `either` is now `either1` + - `smallvec` is now `smallvec1` + - `url` is now `url2` + - `bytes` is now `bytes1` + - `rust_decimal` is now `rust_decimal1` + - `enumset` is now `enumset1` + - `smol_str` is now `smol_str02` + - `semver` is now `semver1` + - `indexmap2`, `arrayvec07` and `bigdecimal04` are unchanged + +### Removed (_⚠️ breaking changes ⚠️_) + +- Removed deprecated `SchemaGenerator` methods `make_extensible`, `schema_for_any` and `schema_for_none` +- Removed the `schema` module + - The `Schema` type is now accessible from the crate root (i.e. `schemars::Schema` instead of `schemars::schema::Schema`) + - All other types that were in the module have been removed: + - `RootSchema` + - `SchemaObject` + - `Metadata` + - `SubschemaValidation` + - `NumberValidation` + - `StringValidation` + - `ArrayValidation` + - `ObjectValidation` + - `InstanceType` + - `SingleOrVec` +- Removed `schemars::Set` and `schemars::Map` type aliases +- Removed the `impl_json_schema` feature flag - `JsonSchema` is now always implemented on `Schema` +- Remove methods `visit_schema_object` and `visit_root_schema` from the `Visitor` trait (`visit_schema` is unchanged) + - Visitors that previously defined `visit_schema_object` should instead define `visit_schema` and use an `if let Some(obj) = schema.as_object_mut()` or similar construct +- Old versions of optional dependencies have been removed - all of these have newer versions (shown in brackets) which are supported by schemars + - `indexmap` (consider using `indexmap2`) + - `uuid08` (consider using `uuid1`) + - `arrayvec05` (consider using `arrayvec07`) + - `bigdecimal03` (consider using `bigdecimal04`) +- Remove the retain_examples field from SetSingleExample, which is now a unit struct + ## [0.8.21] - 2024-05-23 ### Fixed: @@ -99,7 +155,7 @@ ### Added: - ~~Support generic default values in `default` attributes (https://github.com/GREsau/schemars/pull/83)~~ - - ⚠️ **This inadvertently introduced a breaking change and was removed in 0.8.10** + - **This inadvertently introduced a breaking change and was removed in 0.8.10** - Add missing MIT licence text for usage of code from regex_syntax crate (https://github.com/GREsau/schemars/pull/132) - Support uuid v1 and arrayvec 0.7 via feature flags `uuid1` and `arrayvec07` (https://github.com/GREsau/schemars/pull/142) - This also adds `uuid08` and `arrayvec05` feature flags for the previously supported versions of these crates. The existing `uuid` and `arrayvec` flags are still supported for backward-compatibility, but they are **deprecated**.