Interface: PropertyMetadata
Defined in: schema/types/PropertyMetadata.ts:168
Metadata for a property used in serialization and deserialization. Defines how a property should be processed during data transformation. This is the main interface used for defining schema properties.
Example
// Required string property
const nameMetadata: PropertyMetadata = {
type: 'string',
required: true,
description: 'User\'s full name'
};
// Optional array property
const tagsMetadata: PropertyMetadata = {
type: { container: 'array', itemType: 'string' },
required: false,
description: 'List of user tags'
};
Properties
description?
optionaldescription:string
Defined in: schema/types/PropertyMetadata.ts:191
Optional description of the property. Used for documentation and schema generation.
required?
optionalrequired:boolean
Defined in: schema/types/PropertyMetadata.ts:185
Whether the property is required during serialization/deserialization.
- true: Property must be present (default)
- false: Property is optional
Default
true
type
type:
PropertyType
Defined in: schema/types/PropertyMetadata.ts:176
The type of the property. Can be one of:
- Primitive type ('string', 'number', 'boolean', 'Date')
- Class constructor (for class instances)
- Interface name (for registered interfaces)
- Container type (for arrays and maps)