NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #494 most downloaded on crates.io
Macros for #[derive(JsonSchema)], for use with schemars
Last release 2 months ago
27 Jul 2026
Release timing varies
gaps range from 8 days to 6 months
Most releases are documented
notes for 48 of 60 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
93 releases · first in 2019
Nothing published for this version
Nothing published for this version
### Added: - #[schemars(example = "...")] attribute for setting examples on generated schemas
#[schemars(example = "...")] attribute for setting examples on generated schemas (https://github.com/GREsau/schemars/issues/23)One column per quarter.
Setting #[deprecated] attribute will now cause generated schemas to have the deprecated property set to true
#[deprecated] attribute will now cause generated schemas to have the deprecated property set to true#[serde(transparent)] attribute (https://github.com/GREsau/schemars/issues/17)#[schemars(title = "...", description = "...")] can now be used to set schema title/description. If present, these values will be used instead of doc comments (https://github.com/GREsau/schemars/issues/13)If a struct is annotated with #[serde(deny_unknown_fields)], generated schema will have additionalProperties set to false
#[serde(deny_unknown_fields)], generated schema will have additionalProperties set to false (https://github.com/GREsau/schemars/pull/30)type property to string on simple enums (https://github.com/GREsau/schemars/issues/28)Some compiler errors generated by schemars_derive should now have more accurate spans
#[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 (https://github.com/GREsau/schemars/issues/15)#[serde(with = "...")]/#[schemars(with = "...")] attributes on enum variants are now respectedEnable deriving JsonSchema on adjacent tagged enums
Added examples (https://tools.ietf.org/html/draft-handrews-json-schema-validation-02#section-9.5) to Metadata
examples (https://tools.ietf.org/html/draft-handrews-json-schema-validation-02#section-9.5) to Metadatadefault, skip_serializing_if, and serialize_with/with attributes are used together (https://github.com/GREsau/schemars/issues/26)BREAKING CHANGE - SchemaSettings can no longer be created using struct initialization syntax. Instead, if you need to use custom schema settings, you…
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:
mut variable and modify its public fieldswith(|s| ...) method on the settings and modify the settings inside the closure/function (as in the custom_settings.rs example)JsonSchema on structs, Option<T> struct fields are no longer included in the list of required properties in the schema (https://github.com/GREsau/schemars/issues/11)JsonSchema when a non-std String type is in scope (https://github.com/GREsau/schemars/pull/19)#[schemars(with="()")]allow_ref_siblings setting to SchemaSettings. When enabled, schemas with a $ref property may have other properties set.SchemaSettings::draft2019_09() (which enables allow_ref_siblings)Nothing published for this version
Nothing published for this version
Implemented JsonSchema on types from smallvec and arrayvec (as optional dependencies)
JsonSchema on types from smallvec and arrayvec (as optional dependencies)Implemented JsonSchema on types from indexmap, either and uuid (as optional dependencies)
JsonSchema on types from indexmap, either and uuid (as optional dependencies)No actual code changes - this version was just published to fix broken README on crates.io
Documentation website available at https://graham.cool/schemars/!
derive_json_schema to impl_json_schema. derive_json_schema is still available for backward-compatibility, but will be removed in a future version.#[serde(remote = "Duration")] attribute is now treated similarly to #[serde(rename = "Duration")].$ref property. If necessary, wrap the $ref in an allOf.Fix a compile error that can occur when deriving JsonSchema from a project that doesn't reference serde_json
JsonSchema from a project that doesn't reference serde_jsonWhen deriving JsonSchema, the schema's title and description are now set from #[doc] comments
JsonSchema, the schema's title and description are now set from #[doc] comments (https://github.com/GREsau/schemars/issues/7)JsonSchema on structs using a #[serde(default)] attribute, the schema's properties will now include default, unless the default value is skipped by the field's skip_serializing_if function (https://github.com/GREsau/schemars/issues/6)option_nullable setting is enabled (e.g. for openapi 3), schemas for Option<T> will no longer inline T's schema when it should be referenceable.Nothing published for this version
Nothing published for this version
Nothing published for this version
Implemented JsonSchema for more standard library types
JsonSchema for more standard library types (https://github.com/GREsau/schemars/issues/3)minimum explicitly set to zeroResult<MyStruct, Vec<String>> has changed from "Result_Of_MyStruct_Or_Array_Of_String" to "Result_of_MyStruct_or_Array_of_String"JsonSchema implementations with the same type but different formats (e.g. i8 and usize) used the type as their name. They have now been updated to use format as their name.
MyStruct<i8> and MyStruct<usize> were identical, and give them a single schema definition called MyStruct_for_Integer despite the fact they should have different schemas. Now they will each have their own schema (MyStruct_for_i8 and MyStruct_for_usize respectively).Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →