MCPcopy Create free account

hub / github.com/GREsau/schemars / functions

Functions543 in github.com/GREsau/schemars

↓ 107 callersMethodassert_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 callersMethodassert_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 callersFunctionarbitrary_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 callersMethodassert_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 callersMethodassert_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 callersMethodinsert
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 callersMethodassert_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 callersMethodclone
(&self)
schemars/src/generate.rs:252
↓ 20 callersMethodcustom
(&self, assertion: impl Fn(&Schema, Contract))
schemars/tests/integration/test_helper.rs:141
↓ 19 callersMethodassert_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 callersFunctionfrom
()
schemars/tests/integration/from_into.rs:61
↓ 16 callersMethodget
(&self, key: &Q)
schemars/src/schema.rs:248
↓ 16 callersMethodpath
(&self)
schemars_derive/src/attr/custom_meta.rs:48
↓ 15 callersMethoderror_spanned_by
(&self, obj: A, msg: T)
schemars_derive/src/attr/mod.rs:510
↓ 15 callersMethodremove
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 callersFunctionarbitrary_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 callersMethodinto_generator
(self)
schemars/src/generate.rs:170
↓ 11 callersMethodensure_object
(&mut self)
schemars/src/schema.rs:191
↓ 10 callersMethodas_object_mut
(&mut self)
schemars/src/schema.rs:158
↓ 10 callersMethodparse
(input: ParseStream)
schemars_derive/src/attr/parse_meta.rs:212
↓ 8 callersFunctionjson_schema
(_: &mut schemars::SchemaGenerator)
schemars/tests/integration/enums.rs:255
↓ 8 callersMethodserialize
(&self, serializer: S)
schemars/src/schema.rs:80
↓ 8 callersMethodwith
(mut self, configure_fn: impl FnOnce(&mut Self))
schemars/src/generate.rs:155
↓ 7 callersMethodadd_mutators
(&self, expr: &mut SchemaExpr)
schemars_derive/src/ast/mod.rs:75
↓ 7 callersMethodcollect_str
(self, _value: &T)
schemars/src/ser.rs:78
↓ 7 callersMethodduplicate_error
(&self, meta: &CustomMeta)
schemars_derive/src/attr/mod.rs:531
↓ 7 callersMethodname
(&'a self)
schemars_derive/src/ast/mod.rs:79
↓ 7 callersFunctionpath_str
(path: &Path)
schemars_derive/src/attr/mod.rs:470
↓ 6 callersMethodget_mut
(&mut self, key: &Q)
schemars/src/schema.rs:273
↓ 5 callersMethodapply_transforms
(&mut self, schema: &mut Schema)
schemars/src/generate.rs:606
↓ 5 callersMethodas_object
(&self)
schemars/src/schema.rs:151
↓ 5 callersFunctionexpr_for_field
( cont: &Container, field: &Field, is_internal_tagged_enum_newtype: bool, )
schemars_derive/src/schema_exprs.rs:177
↓ 5 callersMethodnext
(&mut self)
schemars/tests/integration/bound.rs:10
↓ 5 callersMethodtransform
(&mut self, schema: &mut Schema)
schemars/src/transform.rs:138
↓ 5 callersMethodwith_validator
(&mut self, validator: fn(&T) -> bool)
schemars/tests/integration/test_helper.rs:65
↓ 4 callersMethodadd_definitions
( &mut self, schema_object: &mut JsonMap<String, Value>, mut definitions: JsonMap<Stri
schemars/src/generate.rs:589
↓ 4 callersMethodassert_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 callersFunctiondeserialize
(deser: D)
schemars/tests/integration/enums.rs:220
↓ 4 callersFunctionexpr_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 callersMethodmutual_exclusive_error
(&self, meta: &CustomMeta, other_attr: &str)
schemars_derive/src/attr/mod.rs:518
↓ 4 callersFunctionparse_meta_list_with
( meta: &CustomMeta, cx: &AttrCtxt, parser: F, )
schemars_derive/src/attr/parse_meta.rs:278
↓ 4 callersFunctionparse_name_value_expr
(meta: CustomMeta, cx: &AttrCtxt)
schemars_derive/src/attr/parse_meta.rs:38
↓ 4 callersFunctionparse_nested_meta
( meta: &CustomMeta, cx: &AttrCtxt, )
schemars_derive/src/attr/parse_meta.rs:270
↓ 4 callersFunctiontype_for_schema
(cont: &Container, with_attr: &WithAttr)
schemars_derive/src/schema_exprs.rs:213
↓ 4 callersMethodvalidate
(value: &Value)
schemars/src/schema.rs:387
↓ 4 callersFunctionvariant_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 callersMethodwith_contract_check
(&self, action: TokenStream)
schemars_derive/src/ast/mod.rs:103
↓ 3 callersMethodas_value
(&self)
schemars/src/schema.rs:138
↓ 3 callersFunctioncontains_immediate_subschema
(schema_obj: &Map<String, Value>)
schemars/src/_private/mod.rs:445
↓ 3 callersMethoddefault
()
schemars/src/schema.rs:453
↓ 3 callersFunctiondraft07
()
schemars/tests/integration/settings.rs:28
↓ 3 callersFunctionexpr_for_struct
( cont: &Container, fields: &[Field], default: &SerdeDefault, deny_unknown_fields: bool, )
schemars_derive/src/schema_exprs.rs:679
↓ 3 callersFunctionexpr_for_tuple_struct
(cont: &Container, fields: &[Field])
schemars_derive/src/schema_exprs.rs:646
↓ 3 callersFunctionexpr_for_unit_struct
()
schemars_derive/src/schema_exprs.rs:635
↓ 3 callersFunctionexternal_container_json_with_extra_field
()
schemars/tests/integration/enums_option_flattened.rs:114
↓ 3 callersFunctionexternal_container_json_with_extra_field
()
schemars/tests/integration/enums_flattened.rs:100
↓ 3 callersMethodhas_type
(&self, ty: &str)
schemars/src/schema.rs:379
↓ 3 callersFunctionprocess_attrs
(ctxt: &Ctxt, attrs: &mut Vec<Attribute>)
schemars_derive/src/attr/schemars_to_serde.rs:75
↓ 3 callersFunctionrequire_path_only
(meta: &CustomMeta, cx: &AttrCtxt)
schemars_derive/src/attr/parse_meta.rs:10
↓ 3 callersMethodsyn_error
(&self, err: syn::Error)
schemars_derive/src/attr/mod.rs:514
↓ 3 callersMethodtake_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 callersFunctiontransform_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 callersMethodvisit_type
(&mut self, field: &Field, ty: &syn::Type)
schemars_derive/src/bound.rs:158
↓ 2 callersMethod_as_any
(&self)
schemars/src/generate.rs:769
↓ 2 callersFunctionallow_null
(generator: &mut SchemaGenerator, schema: &mut Schema)
schemars/src/_private/mod.rs:451
↓ 2 callersMethodas_bool
(&self)
schemars/src/schema.rs:144
↓ 2 callersMethodassert_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 callersFunctionbuild_validator
(schema: &Schema)
schemars/tests/integration/test_helper.rs:161
↓ 2 callersMethodcontract
(&self)
schemars/src/generate.rs:573
↓ 2 callersMethoddefinitions
(&self)
schemars/src/generate.rs:405
↓ 2 callersFunctionderive_json_schema
(mut input: syn::DeriveInput, repr: bool)
schemars_derive/src/lib.rs:46
↓ 2 callersMethodfor_serialize
(mut self)
schemars/src/generate.rs:183
↓ 2 callersFunctionget_meta_items
(attrs: &[Attribute], attr_type: &'static str, cx: &Ctxt)
schemars_derive/src/attr/mod.rs:453
↓ 2 callersMethodinto_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 callersMethodis_default
(&self)
schemars_derive/src/attr/mod.rs:168
↓ 2 callersMethodis_unit
(&self)
schemars_derive/src/ast/mod.rs:95
↓ 2 callersFunctionparse_lit_str
(lit_str: &LitStr, cx: &AttrCtxt)
schemars_derive/src/attr/parse_meta.rs:83
↓ 2 callersMethodparse_meta
( &mut self, mut handle: impl FnMut(CustomMeta, &str, &Self) -> Result<(), CustomMeta>, )
schemars_derive/src/attr/mod.rs:496
↓ 2 callersFunctionparse_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 callersFunctionpercent_decode
(s: &str)
schemars/src/encoding.rs:45
↓ 2 callersMethodprocess_attr
(&mut self, cx: &mut AttrCtxt)
schemars_derive/src/attr/validation.rs:147
↓ 2 callersFunctionprocess_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 callersFunctionprocess_serde_field_attrs
(ctxt: &Ctxt, fields: impl Iterator<Item = &'a mut Field>)
schemars_derive/src/attr/schemars_to_serde.rs:69
↓ 2 callersFunctionrequire_name_value_lit_str
(meta: CustomMeta, cx: &AttrCtxt)
schemars_derive/src/attr/parse_meta.rs:54
↓ 2 callersMethodsettings
(&self)
schemars/src/generate.rs:296
↓ 2 callersFunctionstruct_value
()
schemars/tests/integration/from_value.rs:33
↓ 2 callersMethodto_tokens
(&self, tokens: &mut proc_macro2::TokenStream)
schemars_derive/src/attr/custom_meta.rs:14
↓ 2 callersMethodto_value
(self)
schemars/src/schema.rs:180
↓ 2 callersMethodtransparent_field
(&'a self)
schemars_derive/src/ast/mod.rs:65
↓ 2 callersFunctiontype_for_field_schema
(cont: &Container, field: &Field)
schemars_derive/src/schema_exprs.rs:206
↓ 2 callersMethodvisit_path
(&mut self, field: &Field, path: &syn::Path)
schemars_derive/src/bound.rs:132
↓ 2 callersMethodvisit_return_type
(&mut self, field: &Field, return_type: &syn::ReturnType)
schemars_derive/src/bound.rs:225
↓ 1 callersMethod_as_any_mut
(&mut self)
schemars/src/generate.rs:773
↓ 1 callersMethod_debug_type_name
(&self, f: &mut core::fmt::Formatter<'_>)
schemars/src/transform.rs:129
↓ 1 callersMethod_into_any
(self: Box<Self>)
schemars/src/generate.rs:777
↓ 1 callersMethodadd_mutators2
(&self, mutators: &mut Vec<TokenStream>, mut_ref_schema: &TokenStream)
schemars_derive/src/attr/validation.rs:73
↓ 1 callersMethodattr_str
(self)
schemars_derive/src/attr/validation.rs:24
↓ 1 callersMethoddefinitions_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 callersFunctiondraft2020_12
()
schemars/tests/integration/settings.rs:44
↓ 1 callersMethodend
(self)
schemars/src/ser.rs:265
next →1–100 of 543, ranked by callers