0
ループバックでは、表示されたswagger jsonからPKを削除する方法を教えてください。 ループバックswaggerでpkを削除します
この
は、JSON私の闊歩に表示されている:0:私は "ID" を削除できるか{
"user_id": "string",
"order_type": "string",
"date": "2016-04-28",
"payload": {
"id": 0
},
"id": 0
}
画像SWAGGER
detail-?
これは私のorder.jsonです:
{
"name": "Order",
"plural": "Orders",
"base": "Model",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"user_id": {
"type": "string",
"required": true
},
"order_type": {
"type": "string",
"required": true
},
"date": {
"type": "date",
"required": true
},
"payload": {
"type": "Payload",
"required": true
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
これは私のorder.jsです:
module.exports = (Order) => {
Order.create = function(body, cb) {
//
}
Order.remoteMethod('create', {
'http': {'path': '/'},
'accepts': [
{'arg': 'body', 'type': 'Order', 'required': true, 'http': { 'source': 'body' } }
]
});
};
をしました。これがあなたが望むものでない場合は、無効にしてください。 '' id ":false'プロパティを追加することで、モデル内に隠すこともできます。 – CherryDT
idInjectionは効果がありません – Sergio