You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Public functions that have no side-effects are now marked with #[must_use] so that they report a lint warning when the returned value is unused, as this likely indicates a mistake.
Fixed
Improve accuracy of schemas for flattened enums, in particular: unit variants of externally-tagged enums, and enums wrapped in Option<>. (#464 / #483)
This is a major release with many additions, fixes and changes since 0.8 (but not many since 0.9). While the basic usage (deriving JsonSchema and using schema_for!() or SchemaGenerator) is mostly unchanged, you may wish to consult the migration guide which covers some of the most significant changes.
Changes since 1.0.0-rc.2:
Added
#[schemars(bound = ...)] attributes are now used from fields as well as containers
The Schema::pointer(...) method now works when given a JSON pointer in URI Fragment representation with a leading # character. In particular, this means that you can now lookup a schema from a $ref value using that method.
Fixed
Schema names that contain special characters are now correctly encoded when used inside a $ref value (#436)
Optimise type param usage in SchemaGenerator::subschema_for, reducing LLVM line count and improving compile times (#439)
Serde attributes that you want schemars to ignore can now be "unset" by including them in a schemars attribute with a ! prefix, e.g. #[schemars(!from)] (#433 / #434)
Removed
⚠️ Deprecated items have been removed:
SchemaSettings::option_nullable and SchemaSettings::option_add_null_type fields
Support with/into/from/try_from container attributes (#210 / #267)
Changed
Use oneOf when generating schema for serialized mixed-type sequences (#348) - the previous behaviour was to always use true schema (i.e. any value) for mixed-type sequences