Releases: GREsau/schemars
Releases · GREsau/schemars
v0.6.2
Added:
- Documentation website available at https://graham.cool/schemars/!
Changed:
- Rename
derive_json_schema
toimpl_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 anallOf
.
v0.6.1
v0.6.0
Added:
- When deriving
JsonSchema
, the schema'stitle
anddescription
are now set from#[doc]
comments (#7) - When deriving
JsonSchema
on structs using a#[serde(default)]
attribute, the schema's properties will now includedefault
, unless the default value is skipped by the field'sskip_serializing_if
function (#6)
Changed:
- When the
option_nullable
setting is enabled (e.g. for openapi 3), schemas forOption<T>
will no longer inlineT
's schema when it should be referenceable.
v0.5.1
v0.5.0
Added:
- Implemented
JsonSchema
for more standard library types (#3)
Changed:
- Unsigned integer types (
usize
,u8
etc.) now have theirminimum
explicitly set to zero - Made prepositions/conjunctions in generated schema names lowercase
- e.g. schema name for
Result<MyStruct, Vec<String>>
has changed from "Result_Of_MyStruct_Or_Array_Of_String" to "Result_of_MyStruct_or_Array_of_String"
- e.g. schema name for
- Some provided
JsonSchema
implementations with the sametype
but differentformat
s (e.g.i8
andusize
) used thetype
as their name. They have now been updated to useformat
as their name.- Previously, schema generation would incorrectly assume types such as
MyStruct<i8>
andMyStruct<usize>
were identical, and give them a single schema definition calledMyStruct_for_Integer
despite the fact they should have different schemas. Now they will each have their own schema (MyStruct_for_i8
andMyStruct_for_usize
respectively).
- Previously, schema generation would incorrectly assume types such as