Skip to main content

Module schemars

Module schemars 

Source

Structs§

AllowTrailingCommas
Defaults allowTrailingCommas to true, for use with json-language-server. This can be applied to any schema that will be treated as jsonc.
DefaultDenyUnknownFields
Defaults additionalProperties to true, as if #[schemars(deny_unknown_fields)] was on every struct. Skips structs that have additionalProperties set (such as if #[serde(flatten)] is used on a map).

Functions§

add_new_subschema
Adds a new JSON schema definition and returns a reference to it. Panics if the name is already in use.
replace_subschema
Replaces the JSON schema definition for some type if it is in use (in the definitions list), and returns a reference to it.