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
| Name | Type | Default | Description |
|---|---|---|---|
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 |
label | string | ReactElement | false | label from the schema | Heading 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"}
]}}
- Python
- Ruby
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
- SchemaObjectArrayInput — the form counterpart
- SchemaObjectField — a single nested object