Skip to content

Releases: GREsau/schemars

v0.7.3

15 May 17:37
Compare
Choose a tag to compare

Added:

  • #[schemars(schema_with = "...")] attribute can be set on variants and fields. This allows you to specify another function which returns the schema you want, which is particularly useful on fields of types that don't implement the JsonSchema trait (#15)

Fixed

  • #[serde(with = "...")]/#[schemars(with = "...")] attributes on enum variants are now respected
  • Some compiler errors generated by schemars_derive should now have more accurate spans

v0.7.2

30 Apr 13:32
Compare
Choose a tag to compare

Added:

  • Enable deriving JsonSchema on adjacent tagged enums (#4)

v0.7.1

11 Apr 21:19
Compare
Choose a tag to compare

Added:

Fixed

  • Fixed a bug in schemars_derive causing a compile error when the default, skip_serializing_if, and serialize_with/with attributes are used together (#26)

v0.7.0

26 Mar 18:52
Compare
Choose a tag to compare

Changed:

  • BREAKING CHANGE - SchemaSettings can no longer be created using struct initialization syntax. Instead, if you need to use custom schema settings, you can use a constructor function and either:
    • assign it to a mut variable and modify its public fields
    • call the with(|s| ...) method on the settings and modify the settings inside the closure/function (as in the custom_settings.rs example)

Fixed:

  • When deriving JsonSchema on structs, Option<T> struct fields are no longer included in the list of required properties in the schema (#11)
  • Fix deriving JsonSchema when a non-std String type is in scope (#19)
  • This will now compile: #[schemars(with="()")]

Added:

  • Added allow_ref_siblings setting to SchemaSettings. When enabled, schemas with a $ref property may have other properties set.
  • Can create JSON Schema 2019-09 schemas using SchemaSettings::draft2019_09() (which enables allow_ref_siblings)

v0.7.0-alpha-2

24 Mar 18:09
Compare
Choose a tag to compare
v0.7.0-alpha-2 Pre-release
Pre-release

Fixed:

  • When deriving JsonSchema on structs, Option<T> struct fields are no longer included in the list of required properties in the schema (#11)

v0.7.0-alpha-1

29 Dec 22:00
Compare
Choose a tag to compare
v0.7.0-alpha-1 Pre-release
Pre-release

Changed:

  • BREAKING CHANGE - SchemaSettings can no longer be created using struct initialization syntax. Instead, if you need to use custom schema settings, you can use a constructor function and either:
    • assign it to a mut variable and modify its public fields
    • call the with(|s| ...) method on the settings and modify the settings inside the closure/function (as in the custom_settings.rs example)

Added:

  • Added allow_ref_siblings setting to SchemaSettings. When enabled, schemas with a $ref property may have other properties set.
  • Can create JSON Schema 2019-09 schemas using SchemaSettings::draft2019_09() (which enables allow_ref_siblings)

v0.6.5

29 Dec 10:11
Compare
Choose a tag to compare

Added:

  • Implemented JsonSchema on types from smallvec and arrayvec (as optional dependencies)

v0.6.4

27 Dec 22:47
Compare
Choose a tag to compare

Added:

  • Implemented JsonSchema on types from indexmap, either and uuid (as optional dependencies)

Changed

  • Remove trait bounds from Map/Set JsonSchema impls. They are unnecessary as we never create/use any instances of these types.

v0.6.3

27 Dec 22:47
Compare
Choose a tag to compare

No actual code changes - this version was just published to fix broken README on crates.io

v0.6.2

27 Dec 18:35
Compare
Choose a tag to compare

Added:

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.