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.
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:Notice that the
nameproperty is marked as required, even though the methodupdateAttributesaccepts a partial data (i.e. any subset of model properties).We should fix the metadata for
updateAttributes,updateOrCreateand corresponding relation methods to build a new type for the input argument, where all properties are optional.