On Mar 21, 2018, at 11:26 AM, Joey Benenati <joey.b...@gmail.com> wrote:
This is regarding the loopback-component-explorer - Is there a way to have any control over which models and/or endpoints are shown in the API explorer? I've been looking through the source code and couldn't find anything.
--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/e30da0dd-42ef-4749-b7aa-25ae9d4b9345%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I just began with loopback and created a very simple app with two models only: customer and club.
I created a hasAndBelongToMany relation between these models.
i see that i have got the below end point in the explorer:
POST /customers/{id}/clubs
But I don't want to expose the create method for club from within customer.
I tried to use the below methods inside customer.js as explained in the loopback documentation, but it still keeps showing the above end point (POST /customers/{id}/clubs) in explorer.
Is this a bug or am i doing something incorrectly here ? I would really appreciate any help or pointers.
customer.json --
{
"name": "customer",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"name": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {
"clubs": {
"type": "hasAndBelongsToMany",
"model": "club",
"foreignKey": "clubId",
"options": {
"nestRemoting": true,
"disableInclude": true
}
}
},
"acls": [],
"methods": {}
}
thanks in advance,
Vipul
On Mar 21, 2018, at 1:28 PM, Joey Benenati <joey.b...@gmail.com> wrote:Hi Raymond,I have looked at that, and use those methods to disable remote methods on my models. However, what I am trying to accomplish is not to disable models or methods on the api. I only want to HIDE certain models from the API EXPLORER for security purposes. Whereas "disableRemoteMethodByName" and the remoting settings in model-config.json actually disable the methods from being used at all.Seems like this would need to be done component-explorer or loopback-swagger level?Thank you for the response!
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/c7d26727-21cb-4683-b0d3-135ab7f370a9%40googlegroups.com.