-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate identifier 'options' #310
Comments
Seems to be this commit in the loopback repo which has added the extra argument of options to the sharedCtor method. I can confirm using loopback v3.1.0 is a sufficient temporary solution.
|
I'm still experiencing this in 2.1.0-rc.8.2 |
Yes, this is actually a bug introduced by the framework itself not the builder. The builder analyzes all the parameters and the IBM guys actually added the options parameter as @paulussup is stating. I need to know if that feature it is supposed to work with loopback 2 or not? if not I need to figure out a way to remove it from the options for loopback 2 users. But as for now and to be honest I have no idea what the options is supposed to do and in which contexts should work. |
Oh, awesome, okay, I'm bugging the loopback guys. Thank you so much for
responding!
…On Tue, Jan 10, 2017 at 12:41 PM, Jonathan Casarrubias < ***@***.***> wrote:
Yes, this is actually a bug introduced by the framework itself not the
builder. The builder analyzes all the parameters and the IBM guys actually
added the options parameter as @paulussup <https://github.com/paulussup>
is stating.
I need to know if that feature it is supposed to work with loopback 2 or
not? if not I need to figure out a way to remove it from the options for
loopback 2 users.
But as for now and to be honest I have no idea what the options is
supposed to do and in which contexts should work.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#310 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEnlQeRRPgFmcMziVokWW7xDCr61WW_Oks5rQ-zngaJpZM4Le7w6>
.
--
-=-=-==-=-=-=-==-=-=-=-=-=-=-=-=-=-
Pol Stafford
Storyteller, Writer, Geek, Sensei
|
Cool, no worries I also asked @bajtos in which contexts should that work, lets wait for an answer. Maybe the solution would be to set options as optional and verify it is not duplicated |
👍
…On Tue, Jan 10, 2017 at 1:13 PM, Jonathan Casarrubias < ***@***.***> wrote:
Cool, no worries I also asked @bajtos <https://github.com/bajtos> in
which contexts should that work, lets wait for an answer.
Maybe the solution would be to set options as optional and verify it is
not duplicated
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#310 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEnlQW7ffXB_B81_w1XAeXbCNoO95GXfks5rQ_R2gaJpZM4Le7w6>
.
--
-=-=-==-=-=-=-==-=-=-=-=-=-=-=-=-=-
Pol Stafford
Storyteller, Writer, Geek, Sensei
|
Thanks so much for quick responses. Downgrading to |
Hello, first of all, notice that the Here is a code snippet from loopback-swagger showing how to correctly filter "accepts" arguments: // Filter out parameters that are generated from the incoming request,
// or generated by functions that use those resources.
accepts = accepts.filter(function(arg) {
if (!arg.http) return true;
// Don't show derived arguments.
if (typeof arg.http === 'function') return false;
// Don't show arguments set to the incoming http request.
// Please note that body needs to be shown, such as User.create().
if (arg.http.source === 'req' ||
arg.http.source === 'res' ||
arg.http.source === 'context') {
return false;
}
return true;
}); |
IIUC, this method invokes two server-side methods under the hood: IMO, LoopBack cannot guarantee that
|
Modify remoting metadata of data-access methods in PersistedModel and relation method in Model and add an "options" argument to "accepts" list.
Cross-posting strongloop/loopback@60ea3e9#commitcomment-20427860:
In LB2, the new "options" parameter is added to remoting metadata only when a model-level setting
In strong-remoting, all parameters are optional, unless their metadata specify |
@jonathan-casarrubias I tried to give you as much information and wider context as possible in the comments above, I hope it will help you to better understand advanced features of strong-remoting metadata. IMO, to fix this particular bug, you should filter out computed "accepts" arguments as shown in my #310 (comment). In the longer term, you may want to take into account the information from my other comments. It makes me wonder, how can we capture this information in our docs so that future code-generator authors don't repeat this mistake? SDK builder is no the first project that forgot to handle computed arguments :) |
Hi @bajtos I really appreciate you taking the time to beautifully elaborate your. answer, I believe this information Is fair enough to solve this issue. I was not totally sure if it was supposed to be exposed or not, but now it makes totally sense. btw I would recommend to add a note here http://loopback.io/doc/en/lb3/Remote-methods.html that specifies these 3 http will not be available at client side. I believe it states other great information but didnt see anything about these options being exclusive for server side. Again thanks a lot for elaborating your answer and I will be sending a fix for this asap. Cheers |
@jonathan-casarrubias that sounds like a good start to me. Would you mind sending a pull request with the changes yourself? In my experience, the documentation is written by the users is often the best, as the users know bests what they would expect to see in the docs. Just mention my handle cc @crandmck |
@bajtos sure I can do that, I will fix this issue, update the LB documentation and send a pull request for the docs ASAP. Cheers! |
You guys are teh MEN!
…On Thu, Jan 12, 2017 at 8:51 AM, Jonathan Casarrubias < ***@***.***> wrote:
@bajtos <https://github.com/bajtos> sure I can do that, I will fix this
issue, update the LB documentation and send a pull request for the docs
ASAP.
Cheers!
Jon
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#310 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEnlQeD-NuaPqYRRGbScZ3Fn6j3zsenjks5rRloggaJpZM4Le7w6>
.
--
-=-=-==-=-=-=-==-=-=-=-=-=-=-=-=-=-
Pol Stafford
Storyteller, Writer, Geek, Sensei
|
Any updates on this? |
Don't show internal server only remote method arguments in the client sdk declaration ref mean-expert-official#310
I'm sorry for the late response, this month is kind of crazy for me, I have 2 deliveries so its being difficult to work on these issues. Anyway, what I love from the community is that I have been receiving the last week a bunch of pull requests that I'm right now integrating. I see @josephsnow referenced his work to this issue, so he may be adding a pull request, otherwise it will need to wait a little until my work pressure decreases or somebody else do the pull request. Regards, |
@wvanrensburg I am creating my first loopback project and hitting the same issue you said to downgrading to 3.1.1 helped you as a workaround. May I ask what module did you downgrade? |
loopback itself:
|
@alemhnan Thanks for your reply. I have tried 3.0.0, 3.1.1 and 3.2.1 with the same error as the OP. |
I'm using |
@alemhnan I have tried deleting the node_modules folder and clearing the npm cache with no luck "@mean-expert/loopback-sdk-builder": "^2.1.0-rc.8.2", |
Lock loopback version
|
Thanks for the help everybody, that fixed my issue. |
What type of issue are you creating?
What version of this module are you using?
Write other if any:
Please add a description for your issue:
Ran the generator, included the necessary sdk, and got the following error for each method defined in every Service
Upon looking further, it appears that the
options
parameter is being duplicated in the method signature. Example of a built-in one from loopbackNotice that
options
has been duplicated. This is happening to every method in every Service. Any ideas?The text was updated successfully, but these errors were encountered: