Page Contents

Home > @loopback/repository-json-schema

repository-json-schema package

@loopback/repository-json-schema

Enumerations

Enumeration Description
MODEL_TYPE_KEYS TODO(semver-major) remove these constants in the next major version

Functions

Function Description
getFieldsJsonSchemaFor(modelCtor) Build a JSON schema describing the format of the “fields” object used to include or exclude properties of model instances.
getFilterJsonSchemaFor(modelCtor) Build a JSON schema describing the format of the “filter” object used to query model instances.Note we don’t take the model properties into account yet and return a generic json schema allowing any “where” condition.
getJsonSchema(ctor, options) Gets the JSON Schema of a TypeScript model/class by seeing if one exists in a cache. If not, one is generated and then cached.
getJsonSchemaRef(modelCtor, options) Describe the provided Model as a reference to a definition shared by multiple endpoints. The definition is included in the returned schema.
getNavigationalPropertyForRelation(relMeta, targetRef) Checks and return navigational property definition for the relation
getWhereJsonSchemaFor(modelCtor) Build a JSON schema describing the format of the “where” object used to filter model instances to query, update or delete.Note we don’t take the model properties into account yet and return a generic json schema allowing any “where” condition.
isArrayType(type) Determines whether a given string or constructor is array type or not
metaToJsonProperty(meta) Converts property metadata into a JSON property definition
modelToJsonSchema(ctor, jsonSchemaOptions) Converts a TypeScript class into a JSON Schema using TypeScript’s reflection API
stringTypeToWrapper(type) Gets the wrapper function of primitives string, number, and boolean

Interfaces

Interface Description
JsonSchemaOptions  

Variables

Variable Description
JSON_SCHEMA_KEY Metadata key used to set or retrieve repository JSON Schema