You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New remote method generator removing matching named methods in other models #20
@WoodyWoodsta@idushes would you like to contribute the fix yourself? I am happy to help you along the way, just mention my GH handle in the pull request description.
Hello, I am afraid I don't have enough time to look into this in details. The value used for the id property is usually composed from multiple parts, I'd expect that a remote-method id should be something like {facet}.{model}.{method}, e.g. common.User.findById. A name property should already exist on all workspace models, IIRC it's inherited from WorkspaceEntity or Definition base model.
I don't think a middleware based approach would work, we have many places that's invoking the JavaScript API directly, loopback-cli being a prime example (via generator-loopback).
Activity
idushes commentedon Apr 9, 2017
+1
bajtos commentedon Jun 7, 2017
Nice catch. I suspect this is a bug in loopback-workspace and the way how it creates unique id for remote methods. See
@WoodyWoodsta @idushes would you like to contribute the fix yourself? I am happy to help you along the way, just mention my GH handle in the pull request description.
WoodyWoodsta commentedon Jun 8, 2017
@bajtos If I manage to find time for it, I will certainly have a look.
karanssj4 commentedon Sep 28, 2017
@bajtos from what i can make out in model-method.json, id refers to the name of the method hence it can't be repeated
If we keep the id unique and introduce a new property, say 'name' then we wont need unique names, but i think that would introduce the name field in model definition json too due to this https://github.com/strongloop/loopback-workspace/blob/d9431392d4fcbf355a7e8f3765c201df41398e7a/common/models/model-definition.json#L97-L105
can we have a middleware that rewrites the method key in model definition file as the 'name' field or can we somehow mention in the model definition here https://github.com/strongloop/loopback-workspace/blob/d9431392d4fcbf355a7e8f3765c201df41398e7a/common/models/model-definition.json#L97-L105 that embed it against using the key 'name' and not 'id'
otherwise there might be some breaking changes and same method names in different models work fine in the projects currently
bajtos commentedon Oct 5, 2017
Hello, I am afraid I don't have enough time to look into this in details. The value used for the
idproperty is usually composed from multiple parts, I'd expect that a remote-method id should be something like{facet}.{model}.{method}, e.g.common.User.findById. Anameproperty should already exist on all workspace models, IIRC it's inherited from WorkspaceEntity or Definition base model.I don't think a middleware based approach would work, we have many places that's invoking the JavaScript API directly, loopback-cli being a prime example (via generator-loopback).