MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / getIdSchema

Function getIdSchema

packages/rest-crud/src/crud-rest.controller.ts:293–301  ·  view source on GitHub ↗
(
  modelCtor: typeof Entity & {prototype: T},
)

Source from the content-addressed store, hash-verified

291}
292
293function getIdSchema<T extends Entity>(
294 modelCtor: typeof Entity & {prototype: T},
295): SchemaObject {
296 const idProp = modelCtor.getIdProperties()[0];
297 const modelSchema = jsonToSchemaObject(
298 getJsonSchema(modelCtor),
299 ) as SchemaObject;
300 return modelSchema.properties?.[idProp] as SchemaObject;
301}
302
303// Temporary implementation of a short-hand version of `@requestBody`
304// See https://github.com/loopbackio/loopback-next/issues/3493

Callers 1

defineCrudRestControllerFunction · 0.85

Calls 3

jsonToSchemaObjectFunction · 0.85
getJsonSchemaFunction · 0.85
getIdPropertiesMethod · 0.80

Tested by

no test coverage detected