Releases: GREsau/schemars
Releases · GREsau/schemars
v0.7.5
Added:
- Setting
#[deprecated]
attribute will now cause generated schemas to have thedeprecated
property set totrue
- 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
v0.7.3
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
v0.7.1
Added:
- Added
examples
(https://tools.ietf.org/html/draft-handrews-json-schema-validation-02#section-9.5) toMetadata
Fixed
- Fixed a bug in schemars_derive causing a compile error when the
default
,skip_serializing_if
, andserialize_with
/with
attributes are used together (#26)
v0.7.0
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)
- assign it to a
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-stdString
type is in scope (#19) - This will now compile:
#[schemars(with="()")]
Added:
- Added
allow_ref_siblings
setting toSchemaSettings
. When enabled, schemas with a$ref
property may have other properties set. - Can create JSON Schema 2019-09 schemas using
SchemaSettings::draft2019_09()
(which enablesallow_ref_siblings
)
v0.7.0-alpha-2
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
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)
- assign it to a
Added:
- Added
allow_ref_siblings
setting toSchemaSettings
. When enabled, schemas with a$ref
property may have other properties set. - Can create JSON Schema 2019-09 schemas using
SchemaSettings::draft2019_09()
(which enablesallow_ref_siblings
)