module@warp-drive/schema-dsl
Call Signature
ts
function array(target, key): void;Defined in: fields/array.ts:60
Decorator
Marks a property as an ArrayField — an array of primitive values. For arrays of well-defined objects, use a schema array instead.
Parameters
target
object
key
string
Returns
void
Example
ts
import { Resource, field, array } from '@warp-drive/schema-dsl';
@Resource
export class Post {
@field declare title: string;
@array declare tags: string[];
}json
[
{ "kind": "array", "name": "tags" }
]Since
5.9.0
Call Signature
ts
function array(options): (target, key) => void;Defined in: fields/array.ts:61
Decorator
Marks a property as an ArrayField — an array of primitive values. For arrays of well-defined objects, use a schema array instead.
Parameters
options
Returns
(target, key) => void
Example
ts
import { Resource, field, array } from '@warp-drive/schema-dsl';
@Resource
export class Post {
@field declare title: string;
@array declare tags: string[];
}json
[
{ "kind": "array", "name": "tags" }
]Since
5.9.0