-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Consider the following model:
{
"name": "Person",
"properties": {
"name": { "type": "string", "required": true },
"age": { "type": "number" }
}
}When loaded in LoopBack API Explorer, the endpoint PUT /people/{id} shows the following model for the request body:
Person {
name (string),
age (number, optional),
id (number, optional)
}
Notice that the name property is marked as required, even though the method updateAttributes accepts a partial data (i.e. any subset of model properties).
We should fix the metadata for updateAttributes, updateOrCreate and corresponding relation methods to build a new type for the input argument, where all properties are optional.