Skip to main content

SchemaObjectArrayField

Displays an array of objects inside an array box — one block per item.

Use it for lines that belong to the record itself (order items, price tiers). An array of references to another resource renders as chips instead, via SchemaReferenceField.

Example​

<SchemaObjectArrayField source="items" items={orderSchema.fields.items.items} />

Props​

NameTypeDefaultDescription
source (required)string—Path to the array on the record; the last segment becomes the box target
items (required)ItemFieldSchema | FieldSchema—Schema of one item; its properties become the rendered fields
labelstring | ReactElement | falselabel from the schemaHeading of the array box

The component renders nothing when items.properties is missing — an array of scalars is not an object array.

caution

Like SchemaObjectField, this component is skipped in list views.

Schema mapping​

type: "array" whose items.type is object:

{"name": "items", "type": "array",
"items": {"type": "object",
"properties": [
{"name": "product", "type": "integer", "format": "relation", "reference": "eshop/product"},
{"name": "quantity", "type": "integer"},
{"name": "unit_price", "type": "string", "format": "decimal"}
]}}

A nested serializer with many=True:

class OrderItemSerializer(AdminModelSerializer):
class Meta:
model = OrderItem
fields = ["product", "quantity", "unit_price"]


class OrderSerializer(AdminModelSerializer):
items = OrderItemSerializer(many=True)

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

See also​