Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GREsau/schemars
/ functions
Functions
543 in github.com/GREsau/schemars
⨍
Functions
543
◇
Types & classes
298
↓ 107 callers
Method
assert_snapshot
Checks the generated schema against the saved schema in the snapshots directory, for manual verification of changes. Run tests with the SNAPSHOTS env
schemars/tests/integration/test_helper.rs:73
↓ 100 callers
Method
assert_matches_de_roundtrip
Checks that the "deserialize" schema allows only the given sample values that successfully deserialize and pass validation. This is intended to be gi
schemars/tests/integration/test_helper.rs:272
↓ 97 callers
Function
arbitrary_values
Returns an iterator over an selection of arbitrary JSON values. This is intended to be used as `test!(...).assert_matches_de_roundtrip(arbitrary_valu
schemars/tests/integration/test_helper.rs:395
↓ 77 callers
Method
assert_allows_ser_roundtrip
Checks that the "serialize" schema allows the given sample values when serialized to JSON and, if the value can then be deserialized, that the "deseri
schemars/tests/integration/test_helper.rs:193
↓ 36 callers
Method
assert_allows_ser_roundtrip_default
Checks that both the "serialize" and "deserialize" schema allow the type's default value when serialized to JSON.
schemars/tests/integration/test_helper.rs:363
↓ 34 callers
Method
insert
Inserts a property into the schema, replacing any previous value. If the schema wraps a bool value, it will first be converted into an equivalent obj
schemars/src/schema.rs:226
↓ 27 callers
Method
assert_rejects_de
Checks that the "deserialize" schema does not allow any of the given sample values. While `assert_matches_de_roundtrip()` would also work in this cas
schemars/tests/integration/test_helper.rs:318
↓ 20 callers
Method
clone
(&self)
schemars/src/generate.rs:252
↓ 20 callers
Method
custom
(&self, assertion: impl Fn(&Schema, Contract))
schemars/tests/integration/test_helper.rs:141
↓ 19 callers
Method
assert_allows_de_roundtrip
Checks that the "deserialize" schema allow the given sample values, and the "serialize" schema allows the value obtained from deserializing then re-se
schemars/tests/integration/test_helper.rs:233
↓ 16 callers
Function
from
()
schemars/tests/integration/from_into.rs:61
↓ 16 callers
Method
get
(&self, key: &Q)
schemars/src/schema.rs:248
↓ 16 callers
Method
path
(&self)
schemars_derive/src/attr/custom_meta.rs:48
↓ 15 callers
Method
error_spanned_by
(&self, obj: A, msg: T)
schemars_derive/src/attr/mod.rs:510
↓ 15 callers
Method
remove
If the `Schema`'s underlying JSON value is an object, removes and returns its value for the given key. This always returns `None` for bool schemas, w
schemars/src/schema.rs:371
↓ 13 callers
Function
arbitrary_values_except
Returns an iterator over an selection of arbitrary JSON values, except for value that match the given filter predicate. This is to handle known cases
schemars/tests/integration/test_helper.rs:434
↓ 12 callers
Method
into_generator
(self)
schemars/src/generate.rs:170
↓ 11 callers
Method
ensure_object
(&mut self)
schemars/src/schema.rs:191
↓ 10 callers
Method
as_object_mut
(&mut self)
schemars/src/schema.rs:158
↓ 10 callers
Method
parse
(input: ParseStream)
schemars_derive/src/attr/parse_meta.rs:212
↓ 8 callers
Function
json_schema
(_: &mut schemars::SchemaGenerator)
schemars/tests/integration/enums.rs:255
↓ 8 callers
Method
serialize
(&self, serializer: S)
schemars/src/schema.rs:80
↓ 8 callers
Method
with
(mut self, configure_fn: impl FnOnce(&mut Self))
schemars/src/generate.rs:155
↓ 7 callers
Method
add_mutators
(&self, expr: &mut SchemaExpr)
schemars_derive/src/ast/mod.rs:75
↓ 7 callers
Method
collect_str
(self, _value: &T)
schemars/src/ser.rs:78
↓ 7 callers
Method
duplicate_error
(&self, meta: &CustomMeta)
schemars_derive/src/attr/mod.rs:531
↓ 7 callers
Method
name
(&'a self)
schemars_derive/src/ast/mod.rs:79
↓ 7 callers
Function
path_str
(path: &Path)
schemars_derive/src/attr/mod.rs:470
↓ 6 callers
Method
get_mut
(&mut self, key: &Q)
schemars/src/schema.rs:273
↓ 5 callers
Method
apply_transforms
(&mut self, schema: &mut Schema)
schemars/src/generate.rs:606
↓ 5 callers
Method
as_object
(&self)
schemars/src/schema.rs:151
↓ 5 callers
Function
expr_for_field
( cont: &Container, field: &Field, is_internal_tagged_enum_newtype: bool, )
schemars_derive/src/schema_exprs.rs:177
↓ 5 callers
Method
next
(&mut self)
schemars/tests/integration/bound.rs:10
↓ 5 callers
Method
transform
(&mut self, schema: &mut Schema)
schemars/src/transform.rs:138
↓ 5 callers
Method
with_validator
(&mut self, validator: fn(&T) -> bool)
schemars/tests/integration/test_helper.rs:65
↓ 4 callers
Method
add_definitions
( &mut self, schema_object: &mut JsonMap<String, Value>, mut definitions: JsonMap<Stri
schemars/src/generate.rs:589
↓ 4 callers
Method
assert_rejects_invalid
Checks that neither "serialize" nor "deserialize" schemas allow any of the given sample values when serialized to JSON due to the values failing valid
schemars/tests/integration/test_helper.rs:339
↓ 4 callers
Function
deserialize
(deser: D)
schemars/tests/integration/enums.rs:220
↓ 4 callers
Function
expr_for_untagged_enum_variant
This function is also used for tagged variants, in which case the resulting SchemaExpr will be embedded or mutated to include the tag. `is_actually_un
schemars_derive/src/schema_exprs.rs:562
↓ 4 callers
Method
mutual_exclusive_error
(&self, meta: &CustomMeta, other_attr: &str)
schemars_derive/src/attr/mod.rs:518
↓ 4 callers
Function
parse_meta_list_with
( meta: &CustomMeta, cx: &AttrCtxt, parser: F, )
schemars_derive/src/attr/parse_meta.rs:278
↓ 4 callers
Function
parse_name_value_expr
(meta: CustomMeta, cx: &AttrCtxt)
schemars_derive/src/attr/parse_meta.rs:38
↓ 4 callers
Function
parse_nested_meta
( meta: &CustomMeta, cx: &AttrCtxt, )
schemars_derive/src/attr/parse_meta.rs:270
↓ 4 callers
Function
type_for_schema
(cont: &Container, with_attr: &WithAttr)
schemars_derive/src/schema_exprs.rs:213
↓ 4 callers
Method
validate
(value: &Value)
schemars/src/schema.rs:387
↓ 4 callers
Function
variant_subschemas
Callers must determine if all subschemas are mutually exclusive. The current behaviour is to assume that variants are mutually exclusive except for un
schemars_derive/src/schema_exprs.rs:472
↓ 4 callers
Method
with_contract_check
(&self, action: TokenStream)
schemars_derive/src/ast/mod.rs:103
↓ 3 callers
Method
as_value
(&self)
schemars/src/schema.rs:138
↓ 3 callers
Function
contains_immediate_subschema
(schema_obj: &Map<String, Value>)
schemars/src/_private/mod.rs:445
↓ 3 callers
Method
default
()
schemars/src/schema.rs:453
↓ 3 callers
Function
draft07
()
schemars/tests/integration/settings.rs:28
↓ 3 callers
Function
expr_for_struct
( cont: &Container, fields: &[Field], default: &SerdeDefault, deny_unknown_fields: bool, )
schemars_derive/src/schema_exprs.rs:679
↓ 3 callers
Function
expr_for_tuple_struct
(cont: &Container, fields: &[Field])
schemars_derive/src/schema_exprs.rs:646
↓ 3 callers
Function
expr_for_unit_struct
()
schemars_derive/src/schema_exprs.rs:635
↓ 3 callers
Function
external_container_json_with_extra_field
()
schemars/tests/integration/enums_option_flattened.rs:114
↓ 3 callers
Function
external_container_json_with_extra_field
()
schemars/tests/integration/enums_flattened.rs:100
↓ 3 callers
Method
has_type
(&self, ty: &str)
schemars/src/schema.rs:379
↓ 3 callers
Function
process_attrs
(ctxt: &Ctxt, attrs: &mut Vec<Attribute>)
schemars_derive/src/attr/schemars_to_serde.rs:75
↓ 3 callers
Function
require_path_only
(meta: &CustomMeta, cx: &AttrCtxt)
schemars_derive/src/attr/parse_meta.rs:10
↓ 3 callers
Method
syn_error
(&self, err: syn::Error)
schemars_derive/src/attr/mod.rs:514
↓ 3 callers
Method
take_definitions
Returns the collection of all [non-inlined](JsonSchema::inline_schema) schemas that have been generated, leaving an empty `Map` in its place. The key
schemars/src/generate.rs:427
↓ 3 callers
Function
transform_immediate_subschemas
Similar to `transform_subschemas`, but only transforms subschemas that apply to the top-level object, e.g. "oneOf" but not "properties".
schemars/src/transform.rs:202
↓ 3 callers
Method
visit_type
(&mut self, field: &Field, ty: &syn::Type)
schemars_derive/src/bound.rs:158
↓ 2 callers
Method
_as_any
(&self)
schemars/src/generate.rs:769
↓ 2 callers
Function
allow_null
(generator: &mut SchemaGenerator, schema: &mut Schema)
schemars/src/_private/mod.rs:451
↓ 2 callers
Method
as_bool
(&self)
schemars/src/schema.rs:144
↓ 2 callers
Method
assert_allows_ser_only
Checks that the "serialize" schema allows the given sample values when serialized to JSON. If `T implements `DeserializeOwned`, prefer using `assert_a
schemars/tests/integration/test_helper.rs:171
↓ 2 callers
Function
build_validator
(schema: &Schema)
schemars/tests/integration/test_helper.rs:161
↓ 2 callers
Method
contract
(&self)
schemars/src/generate.rs:573
↓ 2 callers
Method
definitions
(&self)
schemars/src/generate.rs:405
↓ 2 callers
Function
derive_json_schema
(mut input: syn::DeriveInput, repr: bool)
schemars_derive/src/lib.rs:46
↓ 2 callers
Method
for_serialize
(mut self)
schemars/src/generate.rs:183
↓ 2 callers
Function
get_meta_items
(attrs: &[Attribute], attr_type: &'static str, cx: &Ctxt)
schemars_derive/src/attr/mod.rs:453
↓ 2 callers
Method
into_root_schema_for_value
Consumes `self` and generates a JSON Schema for the given example value. If the value implements [`JsonSchema`], then prefer using the [`into_root_s
schemars/src/generate.rs:542
↓ 2 callers
Method
is_default
(&self)
schemars_derive/src/attr/mod.rs:168
↓ 2 callers
Method
is_unit
(&self)
schemars_derive/src/ast/mod.rs:95
↓ 2 callers
Function
parse_lit_str
(lit_str: &LitStr, cx: &AttrCtxt)
schemars_derive/src/attr/parse_meta.rs:83
↓ 2 callers
Method
parse_meta
( &mut self, mut handle: impl FnMut(CustomMeta, &str, &Self) -> Result<(), CustomMeta>, )
schemars_derive/src/attr/mod.rs:496
↓ 2 callers
Function
parse_name_value_expr_handle_lit_str
Like `parse_name_value_expr`, but if the result is a string literal, then parse its contents.
schemars_derive/src/attr/parse_meta.rs:301
↓ 2 callers
Function
percent_decode
(s: &str)
schemars/src/encoding.rs:45
↓ 2 callers
Method
process_attr
(&mut self, cx: &mut AttrCtxt)
schemars_derive/src/attr/validation.rs:147
↓ 2 callers
Function
process_serde_attrs
If a struct/variant/field has any #[schemars] attributes, then create copies of them as #[serde] attributes so that serde_derive_internals will parse
schemars_derive/src/attr/schemars_to_serde.rs:50
↓ 2 callers
Function
process_serde_field_attrs
(ctxt: &Ctxt, fields: impl Iterator<Item = &'a mut Field>)
schemars_derive/src/attr/schemars_to_serde.rs:69
↓ 2 callers
Function
require_name_value_lit_str
(meta: CustomMeta, cx: &AttrCtxt)
schemars_derive/src/attr/parse_meta.rs:54
↓ 2 callers
Method
settings
(&self)
schemars/src/generate.rs:296
↓ 2 callers
Function
struct_value
()
schemars/tests/integration/from_value.rs:33
↓ 2 callers
Method
to_tokens
(&self, tokens: &mut proc_macro2::TokenStream)
schemars_derive/src/attr/custom_meta.rs:14
↓ 2 callers
Method
to_value
(self)
schemars/src/schema.rs:180
↓ 2 callers
Method
transparent_field
(&'a self)
schemars_derive/src/ast/mod.rs:65
↓ 2 callers
Function
type_for_field_schema
(cont: &Container, field: &Field)
schemars_derive/src/schema_exprs.rs:206
↓ 2 callers
Method
visit_path
(&mut self, field: &Field, path: &syn::Path)
schemars_derive/src/bound.rs:132
↓ 2 callers
Method
visit_return_type
(&mut self, field: &Field, return_type: &syn::ReturnType)
schemars_derive/src/bound.rs:225
↓ 1 callers
Method
_as_any_mut
(&mut self)
schemars/src/generate.rs:773
↓ 1 callers
Method
_debug_type_name
(&self, f: &mut core::fmt::Formatter<'_>)
schemars/src/transform.rs:129
↓ 1 callers
Method
_into_any
(self: Box<Self>)
schemars/src/generate.rs:777
↓ 1 callers
Method
add_mutators2
(&self, mutators: &mut Vec<TokenStream>, mut_ref_schema: &TokenStream)
schemars_derive/src/attr/validation.rs:73
↓ 1 callers
Method
attr_str
(self)
schemars_derive/src/attr/validation.rs:24
↓ 1 callers
Method
definitions_path_stripped
Returns `self.settings.definitions_path` as a plain JSON pointer to the definitions object, i.e. without a leading '#' or trailing '/'
schemars/src/generate.rs:614
↓ 1 callers
Function
draft2020_12
()
schemars/tests/integration/settings.rs:44
↓ 1 callers
Method
end
(self)
schemars/src/ser.rs:265
next →
1–100 of 543, ranked by callers