| Nested | R Documentation |
Nest a Schema inside a field
staypuft::FieldABC -> staypuft::Field -> Nested
new()Create a new Nested object
Nested$new( nested, default = miss_ing, exclude = NULL, only = NULL, many = FALSE, unknown = "raise", ... )
nestedThe Schema class or class name (character)
to nest, or "self" to nest the Schema within itself
excludeA list or tuple of fields to exclude
onlyA list or tuple of fields to marshal. If NULL, all fields
are marshalled. This parameter takes precedence over exclude.
manyWhether the field is a collection of objects.
unknownWhether to exclude, include, or raise an error for unknown fields in the data. Use "raise", "exclude", or "include"
schema()Nested$schema()
serialize_()Nested$serialize_(value, nested_obj, attr = NULL, obj = NULL)
test_list()Nested$test_list(self, value)
load_()Nested$load_(value, data = NULL, partial = FALSE)
deserialize_()Nested$deserialize_(value, attr = NULL, data = NULL, partial = FALSE)
clone()The objects of this class are cloneable with this method.
Nested$clone(deep = FALSE)
deepWhether to make a deep clone.
artist_schema <- Schema$new("ArtistSchema",
name = fields$character()
)
x <- Nested$new(artist_schema)
x
x$nested
x$deserialize_(value = list(name = 6)) # good
if (interactive()) x$deserialize_(value = list(foobar = 6)) # bad
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.