Skip to content

Releases: GREsau/schemars

v0.7.5

17 May 12:48
Compare
Choose a tag to compare

Added:

  • Setting #[deprecated] attribute will now cause generated schemas to have the deprecated property set to true
  • Respect #[serde(transparent)] attribute (#17)
  • #[schemars(title = "...", description = "...")] can now be used to set schema title/description. If present, these values will be used instead of doc comments (#13)

Changed:

  • schemars_derive is now an optional dependency, but included by default

v0.7.4

16 May 11:30
Compare
Choose a tag to compare

Added:

  • If a struct is annotated with #[serde(deny_unknown_fields)], generated schema will have additionalProperties set to false (#30)
  • Set type property to string on simple enums (#28)

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.