Skip to main content

SchemaObjectField

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

It is a thin wrapper: the component builds a BoxSchema of type object from the field's properties and hands the rendering to SchemaObjectBox.

Example​

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

Props​

NameTypeDefaultDescription
source (required)string—Path to the object on the 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
caution

Plain object fields render nothing in a list — the dispatcher only mounts this component outside list views. Expose the individual properties as separate columns if you need them in a list.

Schema mapping​

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

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

A nested serializer becomes an object field — 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​