Skip to content

Releases: GREsau/schemars

v1.2.0

25 Dec 21:38

Choose a tag to compare

🎅 Merry Christmas! 🎄

Added

  • Add smol_str03 feature (#486)

Changed

  • Schemas generated for HashMap/BTreeMap with enum keys are now more specific (#452)

v1.1.0

05 Nov 19:50

Choose a tag to compare

Added

  • Public functions that have no side-effects are now marked with #[must_use] so that they report a lint warning when the returned value is unused, as this likely indicates a mistake.

Fixed

  • Improve accuracy of schemas for flattened enums, in particular: unit variants of externally-tagged enums, and enums wrapped in Option<>. (#464 / #483)

v1.0.5

03 Nov 18:27

Choose a tag to compare

Fixed

  • Fix schema.pointer_mut() to resolve URI fragment identifiers like #/$defs/foo, matching current behaviour of schema.pointer() (#478 / #479)

v1.0.4

06 Jul 09:35

Choose a tag to compare

Fixed

  • Fix JsonSchema impl on atomic types being ignored on non-nightly compilers due to a buggy cfg check (#453)
  • Fix compatibility with minimal dependency versions, e.g. old(-ish) versions of syn (#450)
  • Fix derive for empty tuple variants (#455)

v1.0.3

28 Jun 11:31

Choose a tag to compare

Fixed

  • Fix compile error when a doc comment is set on both a transparent (or newtype) struct and its field (#446)
  • Fix json_schema!() macro compatibility when used from pre-2021 rust editions (#447)

v1.0.2

26 Jun 19:26

Choose a tag to compare

Fixed

  • Fix schema properties being incorrectly reordered during serialization (#444)

v1.0.1

24 Jun 17:12

Choose a tag to compare

Fixed

  • Deriving JsonSchema with no_std broken due to std::borrow::ToOwned trait not being in scope (#441)

v1.0.0

23 Jun 09:58

Choose a tag to compare

This is a major release with many additions, fixes and changes since 0.8 (but not many since 0.9). While the basic usage (deriving JsonSchema and using schema_for!() or SchemaGenerator) is mostly unchanged, you may wish to consult the migration guide which covers some of the most significant changes.

Changes since 1.0.0-rc.2:

Added

  • #[schemars(bound = ...)] attributes are now used from fields as well as containers
  • The Schema::pointer(...) method now works when given a JSON pointer in URI Fragment representation with a leading # character. In particular, this means that you can now lookup a schema from a $ref value using that method.

Fixed

  • Schema names that contain special characters are now correctly encoded when used inside a $ref value (#436)
  • Optimise type param usage in SchemaGenerator::subschema_for, reducing LLVM line count and improving compile times (#439)

v1.0.0-rc.2

19 Jun 15:56

Choose a tag to compare

v1.0.0-rc.2 Pre-release
Pre-release

Added

  • Serde attributes that you want schemars to ignore can now be "unset" by including them in a schemars attribute with a ! prefix, e.g. #[schemars(!from)] (#433 / #434)

Removed

  • ⚠️ Deprecated items have been removed:
    • SchemaSettings::option_nullable and SchemaSettings::option_add_null_type fields
    • gen module

v1.0.0-rc.1

16 Jun 09:52
7fde92e

Choose a tag to compare

v1.0.0-rc.1 Pre-release
Pre-release

Added

  • Impl JsonSchema for chrono::TimeDelta (#357)
  • Support with/into/from/try_from container attributes (#210 / #267)

Changed

  • Use oneOf when generating schema for serialized mixed-type sequences (#348) - the previous behaviour was to always use true schema (i.e. any value) for mixed-type sequences