I have this model done in loopback 4:
@property({
type: 'string',
id: true,
default: () => uuid(),
})
id: string;
@property({
type: 'string',
required: true,
})
name: string;
As you see, the id is generated by default. But in the loopback/explorer
The id appears. I want to hide it, if is going to be auto generated, It could produce a confusion to the developers that want to use this API. Anybody knows how to put a property in a model, and hide it from the /explorer
?
Thanks.
Just exclude the id from the request body schema
@requestBody({
content: {
'application/json': {
schema: getModelSchemaRef(Model, {exclude: ['id']}),
},
},
}
Hope this helps Thanks