Releases: GREsau/schemars
Releases Β· GREsau/schemars
v1.0.0-alpha.15
Added
SchemaSettings
now has acontract
field which determines whether the generated schemas describe how types are serialized or deserialized. By default, this is set toDeserialize
, as this more closely matches the behaviour of previous versions - you can change this toSerialize
to instead generate schemas describing the type's serialization behaviour (#48 / #335)
Changed
- Schemas generated for enums with no variants will now generate
false
(or equivalently{"not":{}}
), instead of{"enum":[]}
. This is so generated schemas no longer violate the JSON Schema spec's recommendation that a schema'senum
array "SHOULD have at least one element".
v1.0.0-alpha.14
Added
- Read
#[garde(...)]
attributes as an alternative to#[validate(...)]
(#233 / #331). See the documentation for a full list of supported attributes.
v1.0.0-alpha.13
Fixed
- Fix compile errors when using
#[validate(regex(path = *expr))]
attribute
v1.0.0-alpha.12
Fixed
- Allow
regex(path = ...)
value to be a non-string expression (#302 / #328) - Respect
#[serde(rename_all_fields = ...)]
attribute (#273 / #304)
Changed (β οΈ possibly-breaking changes β οΈ )
- Invalid attributes that were previously silently ignored (e.g. setting
schema_with
on structs) will now cause compile errors - Validation attribute parsing has been altered to match the latest version of the validator crate:
- Remove the
phone
attribute - Remove the
required_nested
attribute regex
andcontains
attributes must now be specified in list form#[validate(regex(path = ...))]
rather than name/value form#[validate(regex = ...)]
- Remove the
v1.0.0-alpha.11
v1.0.0-alpha.10
v1.0.0-alpha.9
v1.0.0-alpha.8
Changed
v1.0.0-alpha.7
v1.0.0-alpha.6
Fixed
- Fixed a configuration error that caused rustdoc generation to fail on docs.rs