Call Signature
function ObjectSchema(target): void;Defined in: entities/object-schema.ts:67
Class Decorator
Marks a class as an object schema — an embedded structure with no independent identity of its own, for use as the value of an @object or alias field on a resource.
The object's type is derived from the class name (dasherized) unless a type string is passed explicitly. Its identity is null unless a property is decorated with hash, in which case that compiled HashField becomes the identity.
Each decorated property on the class contributes one entry to the compiled fields array, in declaration order.
Parameters
target
AnyConstructor
Returns
void
Example
import { ObjectSchema, field } from '@warp-drive/schema-dsl';
@ObjectSchema
export class Address {
@field declare street: string;
@field declare city: string;
}{
"type": "address",
"identity": null,
"fields": [
{ "kind": "field", "name": "street" },
{ "kind": "field", "name": "city" }
]
}Since
5.9.0
Call Signature
function ObjectSchema(type, options?): (target) => void;Defined in: entities/object-schema.ts:68
Class Decorator
Marks a class as an object schema — an embedded structure with no independent identity of its own, for use as the value of an @object or alias field on a resource.
The object's type is derived from the class name (dasherized) unless a type string is passed explicitly. Its identity is null unless a property is decorated with hash, in which case that compiled HashField becomes the identity.
Each decorated property on the class contributes one entry to the compiled fields array, in declaration order.
Parameters
type
string
options?
Returns
(target) => void
Example
import { ObjectSchema, field } from '@warp-drive/schema-dsl';
@ObjectSchema
export class Address {
@field declare street: string;
@field declare city: string;
}{
"type": "address",
"identity": null,
"fields": [
{ "kind": "field", "name": "street" },
{ "kind": "field", "name": "city" }
]
}Since
5.9.0
Call Signature
function ObjectSchema(options): (target) => void;Defined in: entities/object-schema.ts:69
Class Decorator
Marks a class as an object schema — an embedded structure with no independent identity of its own, for use as the value of an @object or alias field on a resource.
The object's type is derived from the class name (dasherized) unless a type string is passed explicitly. Its identity is null unless a property is decorated with hash, in which case that compiled HashField becomes the identity.
Each decorated property on the class contributes one entry to the compiled fields array, in declaration order.
Parameters
options
Returns
(target) => void
Example
import { ObjectSchema, field } from '@warp-drive/schema-dsl';
@ObjectSchema
export class Address {
@field declare street: string;
@field declare city: string;
}{
"type": "address",
"identity": null,
"fields": [
{ "kind": "field", "name": "street" },
{ "kind": "field", "name": "city" }
]
}Since
5.9.0