Skip to content

Function: makeReferenceSchemaFromObjectSchema

core.makeReferenceSchemaFromObjectSchema

makeReferenceSchemaFromObjectSchema(schema, identityName?): GenericObjectSchema & ObjectSchemaProperty

Convenience for creating a reference object schema from an existing schema for the object. Copies over the identity, idProperty, and displayProperty from the schema, and the subset of properties indicated by the idProperty and displayProperty. A reference schema can always be defined directly, but if you already have an object schema it provides better code reuse to derive a reference schema instead.

Parameters

Name Type
schema ObjectSchemaDefinition<string, string> & ObjectSchemaProperty
identityName? string

Returns

GenericObjectSchema & ObjectSchemaProperty

Defined in

schema.ts:2161