Skip to main content

SchemaObjectInput

Collects the properties of a nested object inside an object box.

The component builds a BoxSchema of type object from the field's properties and hands the rendering to SchemaObjectBox; each property is a nested SchemaInput.

Example​

<SchemaObjectInput source="shipping_address" fields={addressSchema.properties} />

Props​

NameTypeDefaultDescription
source (required)string—Path to the object in the form record; the last segment becomes the box target
fields (required)FieldSchema[]—Schemas of the properties to render
labelstring | ReactElement | falselabel from the schemaHeading of the object box

The nested values are submitted as one object under source, so the backend receives {"shipping_address": {"street": "…", "city": "…"}}.

Schema mapping​

type: "object" with properties and no more specific format:

{"name": "shipping_address", "type": "object",
"properties": [
{"name": "street", "type": "string", "required": true},
{"name": "city", "type": "string", "required": true},
{"name": "zip", "type": "string", "required": true}
]}

A writable nested serializer — AdminModelSerializer handles creating and updating the related row, see Nested serializers:

class AddressSerializer(AdminModelSerializer):
class Meta:
model = Address
fields = ["street", "city", "zip"]


class OrderSerializer(AdminModelSerializer):
shipping_address = AddressSerializer()

class Meta:
model = Order
fields = ["id", "number", "shipping_address"]

See also​